<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:34:27 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-10370] &quot;truncate&quot; does not update blocks count on client</title>
                <link>https://jira.whamcloud.com/browse/LU-10370</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Running &lt;tt&gt;truncate --size=N file&lt;/tt&gt; on a file larger than {{N} will correctly update and return the file size to the client, but does not update the client&apos;s idea of the block count.  Running the following test fails on my 2.10.1 system:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;$ dd if=1k bs=1M /myth/tmp/largefile
$ truncate --size 512M /myth/tmp/largefile
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The size is updated on the client to 512MB, but the blocks are left at 1GB in the client cache.&lt;/p&gt;</description>
                <environment></environment>
        <key id="49691">LU-10370</key>
            <summary>&quot;truncate&quot; does not update blocks count on client</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="arshad512">Arshad Hussain</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Tue, 12 Dec 2017 09:09:41 +0000</created>
                <updated>Wed, 13 Feb 2019 04:32:33 +0000</updated>
                            <resolved>Tue, 19 Jun 2018 20:14:37 +0000</resolved>
                                    <version>Lustre 2.10.1</version>
                                    <fixVersion>Lustre 2.12.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                            <comments>
                            <comment id="216031" author="adilger" created="Tue, 12 Dec 2017 09:25:16 +0000"  >&lt;p&gt;The OSS should be replying with the object attributes (blocks, size, timestamps) from the truncate, and these should be updating the client&apos;s cached state.&lt;/p&gt;</comment>
                            <comment id="216565" author="arshad512" created="Mon, 18 Dec 2017 05:07:55 +0000"  >&lt;p&gt;Hi Andreas,&lt;/p&gt;

&lt;p&gt;Will osc_io.c:osc_cache_truncate_end() be the correct place to add the changes. What should be the correct approach for this fix. Could you help out here with the correct approach to follow for this? I can have a look at this one and then adapt the same for fallocate.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Dec 18 09:48:10 mrpel7 kernel: Call Trace:
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff81633ec4&amp;gt;] dump_stack+0x19/0x1b
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0aa5a55&amp;gt;] osc_cache_truncate_end+0x6d5/0xc10 [osc]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa08a0bac&amp;gt;] ? ptlrpc_request_bufs_pack+0x1ec/0x480 [ptlrpc]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0a96272&amp;gt;] ? osc_page_gang_lookup+0x272/0x320 [osc]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0a90400&amp;gt;] ? osc_io_data_version_end+0x190/0x190 [osc]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0a8ffe2&amp;gt;] osc_io_setattr_end+0x162/0x1b0 [osc]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0b1b480&amp;gt;] ? lov_io_iter_fini_wrapper+0x50/0x50 [lov]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa068b8fd&amp;gt;] cl_io_end+0x5d/0x150 [obdclass]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0b1b55b&amp;gt;] lov_io_end_wrapper+0xdb/0xe0 [lov]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0b1bbb5&amp;gt;] lov_io_call.isra.5+0x85/0x140 [lov]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa0b1bca6&amp;gt;] lov_io_end+0x36/0xb0 [lov]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa068b8fd&amp;gt;] cl_io_end+0x5d/0x150 [obdclass]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa068df8f&amp;gt;] cl_io_loop+0x13f/0xc70 [obdclass]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa10ea870&amp;gt;] cl_setattr_ost+0x280/0x3d0 [lustre]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa10c4ea5&amp;gt;] ll_setattr_raw+0x1165/0x1270 [lustre]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffffa10c501c&amp;gt;] ll_setattr+0x6c/0xd0 [lustre]
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff811fb6b9&amp;gt;] notify_change+0x279/0x3d0
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff811dc7a3&amp;gt;] do_truncate+0x73/0xc0
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff811e1038&amp;gt;] ? __sb_start_write+0x58/0x110
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff811dcb4c&amp;gt;] do_sys_ftruncate.constprop.17+0x11c/0x180
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff811dcbee&amp;gt;] SyS_ftruncate+0xe/0x10
Dec 18 09:48:10 mrpel7 kernel: [&amp;lt;ffffffff816448c9&amp;gt;] system_call_fastpath+0x16/0x1b


&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="217406" author="adilger" created="Wed, 3 Jan 2018 20:09:50 +0000"  >&lt;p&gt;Jinshan or Bobijam,&lt;br/&gt;
can you please comment on the best approach for this.  The client should have the blocks count updated by the reply from &lt;tt&gt;OST_PUNCH&lt;/tt&gt;, since it will currently keep the old (pre-truncate) blocks count in cache until the DLM lock is cancelled, which may be an hour or more.&lt;/p&gt;

&lt;p&gt;This may also be a problem for LSOM, since the client&apos;s update of the LSOM state on the MDT will not be correct after a truncate if it is caching the wrong data.&lt;/p&gt;</comment>
                            <comment id="219352" author="gerrit" created="Mon, 29 Jan 2018 13:33:53 +0000"  >&lt;p&gt;Arshad Hussain (arshad.super@gmail.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/31073&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/31073&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10370&quot; title=&quot;&amp;quot;truncate&amp;quot; does not update blocks count on client&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10370&quot;&gt;&lt;del&gt;LU-10370&lt;/del&gt;&lt;/a&gt; osc: truncate does not update blocks count on client&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 4b5055a464d1b2d190d5b7f49f68f7e4a60653c6&lt;/p&gt;</comment>
                            <comment id="220429" author="arshad512" created="Thu, 8 Feb 2018 16:18:45 +0000"  >&lt;p&gt;Hi Andreas,&lt;/p&gt;

&lt;p&gt;Debugging OST_PUNCH found that server does not reply back with updated blocks count to client. Presently OST_PUNCH RPC is processed under lustretre/ofd/ofd_dev.c:ofd_punch_hdl(). Here server does not update repbody with updated block count.&lt;/p&gt;

&lt;p&gt;Addressing this allows the client to fetch these values in RPC reply. Under osc_io.c:osc_io_setattr_end() I could update object attributes with updated values received from server calling cl_object_attr_update(). Ive added tests to verify truncate reflects block count correctly for sparse files as well. &lt;/p&gt;

&lt;p&gt;We can format and push a patch for review if this looks like a good solution.&#160;&lt;/p&gt;


&lt;p&gt;The output of truncate run on Sparse file:&lt;br/&gt;
===============================&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;yes &apos;a&apos; | dd of=/mnt/lustre/sparstest bs=4096 count=2 seek=5&lt;br/&gt;
2+0 records in&lt;br/&gt;
2+0 records out&lt;br/&gt;
8192 bytes (8.2 kB) copied, 0.001071 s, 7.6 MB/s&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;stat /mnt/lustre/sparstest&lt;br/&gt;
&#160; File: &apos;/mnt/lustre/sparstest&apos;&lt;br/&gt;
&#160; Size: 28672&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Blocks: 16&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; IO Block: 4194304 regular file&lt;br/&gt;
Device: 2c54f966h/743766374d&#160;&#160;&#160; Inode: 144115205272502281&#160; Links: 1&lt;br/&gt;
Access: (0644/&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-)&#160; Uid: (&#160;&#160;&#160; 0/&#160;&#160;&#160; root)&#160;&#160; Gid: (&#160;&#160;&#160; 0/&#160;&#160;&#160; root)&lt;br/&gt;
Access: 2018-02-08 18:24:18.000000000 +0530&lt;br/&gt;
Modify: 2018-02-08 18:24:18.000000000 +0530&lt;br/&gt;
Change: 2018-02-08 18:24:18.000000000 +0530&lt;br/&gt;
&#160;Birth: -&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;truncate -s24500 /mnt/lustre/sparstest&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;stat /mnt/lustre/sparstest&lt;br/&gt;
&#160; File: &apos;/mnt/lustre/sparstest&apos;&lt;br/&gt;
&#160; Size: 24500&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Blocks: 8&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; IO Block: 4194304 regular file&lt;br/&gt;
Device: 2c54f966h/743766374d&#160;&#160;&#160; Inode: 144115205272502281&#160; Links: 1&lt;br/&gt;
Access: (0644/&lt;del&gt;rw-r&lt;/del&gt;&lt;del&gt;r&lt;/del&gt;-)&#160; Uid: (&#160;&#160;&#160; 0/&#160;&#160;&#160; root)&#160;&#160; Gid: (&#160;&#160;&#160; 0/&#160;&#160;&#160; root)&lt;br/&gt;
Access: 2018-02-08 18:24:18.000000000 +0530&lt;br/&gt;
Modify: 2018-02-08 18:24:42.000000000 +0530&lt;br/&gt;
Change: 2018-02-08 18:24:42.000000000 +0530&lt;br/&gt;
&#160;Birth: -&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="229545" author="gerrit" created="Thu, 14 Jun 2018 03:56:23 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/31073/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/31073/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10370&quot; title=&quot;&amp;quot;truncate&amp;quot; does not update blocks count on client&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10370&quot;&gt;&lt;del&gt;LU-10370&lt;/del&gt;&lt;/a&gt; ofd: truncate does not update blocks count on client&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 6115eb7fd55abca12c110535be4f777e3eba2b10&lt;/p&gt;</comment>
                            <comment id="229636" author="pjones" created="Tue, 19 Jun 2018 20:14:37 +0000"  >&lt;p&gt;Landed for 2.12&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="19874">LU-3606</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="46203">LU-9538</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="54300">LU-11778</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzzp6v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>