<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:37:34 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-3864] stat() on HSM released file returns st_blocks = 0</title>
                <link>https://jira.whamcloud.com/browse/LU-3864</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;HSM release in not preserving block count as reported by stat()&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;# cd /mnt/lustre
# dd if=/dev/zero of=Antoshka bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0740321 s, 142 MB/s
# stat Antoshka 
  File: `Antoshka&apos;
  Size: 10485760  	Blocks: 20480      IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115205255725060  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-08-30 10:13:48.000000000 -0500
Modify: 2013-08-30 10:13:48.000000000 -0500
Change: 2013-08-30 10:13:48.000000000 -0500
# lfs hsm_archive Antoshka 
# lfs hsm_release Antoshka
# stat Antoshka
  File: `Antoshka&apos;
  Size: 10485760  	Blocks: 0          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115205255725060  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-08-30 10:13:48.000000000 -0500
Modify: 2013-08-30 10:13:48.000000000 -0500
Change: 2013-08-30 10:13:48.000000000 -0500
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I had intended to fix this with &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3811&quot; title=&quot;non-root users cannot archive files, root cannot archive non-root users&amp;#39; files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3811&quot;&gt;&lt;del&gt;LU-3811&lt;/del&gt;&lt;/a&gt; but it will require some work in the MD* attr_set patch.&lt;/p&gt;

&lt;p&gt;If you&apos;re thinking (philosophically) hmm, well maybe it should report a block count of 0 here then you&apos;re just wrong.&lt;/p&gt;</description>
                <environment></environment>
        <key id="20726">LU-3864</key>
            <summary>stat() on HSM released file returns st_blocks = 0</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="20020">LU-3647</parent>
                                    <priority id="1" iconUrl="https://jira.whamcloud.com/images/icons/priorities/blocker.svg">Blocker</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="bfaccini">Bruno Faccini</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>HSM</label>
                    </labels>
                <created>Fri, 30 Aug 2013 15:19:45 +0000</created>
                <updated>Wed, 2 Oct 2013 20:39:43 +0000</updated>
                            <resolved>Wed, 2 Oct 2013 20:39:43 +0000</resolved>
                                    <version>Lustre 2.5.0</version>
                                    <fixVersion>Lustre 2.5.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                            <comments>
                            <comment id="65443" author="jhammond" created="Fri, 30 Aug 2013 15:20:49 +0000"  >&lt;p&gt;Also note that in HSM release the client is already sending the correct LA_BLOCKS to the MDT.&lt;/p&gt;</comment>
                            <comment id="65444" author="jay" created="Fri, 30 Aug 2013 16:01:33 +0000"  >&lt;p&gt;Hi Andreas, do you think we need to show original blocks for a released file? I tend to think it&apos;s fine to set block as 0 because released files won&apos;t consume any blocks in lustre file system.&lt;/p&gt;</comment>
                            <comment id="65461" author="pjones" created="Fri, 30 Aug 2013 17:42:59 +0000"  >&lt;p&gt;Bruno&lt;/p&gt;

&lt;p&gt;Could you please look into this one?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="65469" author="adilger" created="Fri, 30 Aug 2013 18:39:14 +0000"  >&lt;p&gt;I think that this behaviour was by design, but I now see that this could be a source of major data corruption for newer versions of &quot;cp&quot; or &quot;tar&quot; trying to copy the file.  If they call stat() on the file and see st_blocks == 0 the file they will incorrectly assume that the file is completely sparse and not even try to read the file data.  This might easily be tested by something like:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        yes | dd of=$DIR/$tfile bs=1M count=1 conv=sync || error &lt;span class=&quot;code-quote&quot;&gt;&quot;creating $DIR/$tfile&quot;&lt;/span&gt;
        $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $DIR/$tfile
        wait_request_state $(path2fid $DIR/$tfile) ARCHIVE SUCCEED
        $LFS hsm_release $DIR/$tfile

        mkdir $DIR/$tdir
        # only newer versions of cp detect sparse files by stat/FIEMAP (LU-2580)
        cp --sparse $DIR/$tfile $DIR/$tfile.2 || error &lt;span class=&quot;code-quote&quot;&gt;&quot;copying $DIR/$tfile&quot;&lt;/span&gt;
        cmp $DIR/$tfile $DIR/$tfile.2 || error &lt;span class=&quot;code-quote&quot;&gt;&quot;comparing copied $DIR/$tfile&quot;&lt;/span&gt;

        tar cf - --sparse $DIR/$tfile | tar xvf - -C $DIR/$tdir || error &lt;span class=&quot;code-quote&quot;&gt;&quot;tar failed&quot;&lt;/span&gt;
        cmp $DIR/$tfile $DIR/$tdir/$DIR/$tfile || error &lt;span class=&quot;code-quote&quot;&gt;&quot;comparing untarred $DIR/$tfile&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="65487" author="jcl" created="Sat, 31 Aug 2013 06:02:57 +0000"  >&lt;p&gt;For us the block count represent the Lustre block count, so for a released file is 0. Later for partial release, it will be the count of blocks in Lustre, not released. File size is ok, a released file is like a sparse file but with data out of Lustre.&lt;/p&gt;</comment>
                            <comment id="65524" author="adegremont" created="Mon, 2 Sep 2013 07:23:19 +0000"  >&lt;p&gt;&quot;This is not a bug, this is a feature&quot; but as Andreas pointed out, we will have to modify this as this could lead to issue when using, too smart, tools.&lt;/p&gt;

&lt;p&gt;So, where could we store the original block count? There&apos;s no place for that in the inode. Should we put this in HSM EA and use this value when replying to GETATTR?&lt;/p&gt;</comment>
                            <comment id="65531" author="adegremont" created="Mon, 2 Sep 2013 08:55:39 +0000"  >&lt;p&gt;Another workaround, to avoid storing the previous block count, we could be to returned a theoretical maximum block count: computing (FILESIZE / BLOCKSIZE) + 1&lt;/p&gt;

&lt;p&gt;The default of this method will be that st_blocks could be larger than what it was before the file was released. But this is must simpler to patch.&lt;/p&gt;

&lt;p&gt;I imagine we have to also hack FIEMAP for released file?&lt;/p&gt;</comment>
                            <comment id="65620" author="jay" created="Tue, 3 Sep 2013 16:21:09 +0000"  >&lt;p&gt;Hi Andreas, is there any side effect if we set the st_blocks to be nonzero even it doesn&apos;t consume any disk blocks in Lustre?&lt;/p&gt;

&lt;p&gt;To be honest, I&apos;m totally okay to report st_blocks as zero for release files. Backup usually applies to latest files but HSM should move &lt;b&gt;old&lt;/b&gt; files to secondary storage so their target are not conflicted. If backup has to restore every files in the lustre this is probably not what administrator wants.&lt;/p&gt;</comment>
                            <comment id="65667" author="bfaccini" created="Tue, 3 Sep 2013 23:35:57 +0000"  >&lt;p&gt;I am late in this thread (even if ticket is assigned to me !), but even if I understand the possible issue when using &quot;smart&quot; tools, I wonder what will happen when using &quot;simple&quot; tools like &quot;du&quot; if st_blocks no longer reflects the current number of consumed blocks ?&lt;/p&gt;

&lt;p&gt;Do we know how behave other HSMs, like DataMigration and others ? I seem to remember DM did not do anything tricky with st_blocks, but may be it changed since.&lt;/p&gt;

</comment>
                            <comment id="65707" author="adegremont" created="Wed, 4 Sep 2013 09:42:16 +0000"  >&lt;p&gt;Jinshan, even I thought that reporting a 0 value for st_block was a good idea first, we cannot afford to keep doing this due to cp/tar issue.&lt;/p&gt;

&lt;p&gt;This is &lt;b&gt;unacceptable&lt;/b&gt; that users doing &quot;&lt;tt&gt;cp --sparse&lt;/tt&gt;&quot; or &quot;&lt;tt&gt;tar --sparse&lt;/tt&gt;&quot; copy WRONG data if this is applied to a released file.&lt;br/&gt;
After looking at coreutils code and &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2580&quot; title=&quot;cp with FIEMAP support creates completely sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2580&quot;&gt;&lt;del&gt;LU-2580&lt;/del&gt;&lt;/a&gt; I think the bug here is that FIEMAP output for released file is wrong.&lt;br/&gt;
coreutils is just using st_blocks to detect if the file &lt;b&gt;looks&lt;/b&gt; sparse.&lt;/p&gt;

&lt;p&gt;It seems we can return a special FIEMAP for released file, with one region, with FIEMAP_EXTENT_DELALLOC or FIEMAP_EXTENT_UNKNOWN set.&lt;/p&gt;

&lt;p&gt;I&apos;ve not checked &lt;tt&gt;tar&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Andreas, do you think this solution is reasonable?&lt;/p&gt;</comment>
                            <comment id="65726" author="bfaccini" created="Wed, 4 Sep 2013 13:49:52 +0000"  >&lt;p&gt;Aurelien,&lt;br/&gt;
Just to be sure that I fully understand what you mean in your last comment :&lt;/p&gt;

&lt;p&gt;        _ for a released file, we can return st_blocks = 0 with correct st_size as already.&lt;br/&gt;
        _ this allows cp (and tar?) to presume it is a sparse-file and go thru related special logic.&lt;br/&gt;
        _ but then we need to change Lustre FIEMAP to return something like FIEMAP_EXTENT_DELALLOC or FIEMAP_EXTENT_UNKNOWN for released files to make cp happy.&lt;/p&gt;

&lt;p&gt;Did I understand and is this what you mean ?&lt;/p&gt;

&lt;p&gt;Then, only difference I see already is that we will not use the same cp logic for &quot;real&quot; non-sparse (plain or dense) but released files, if any specifics are made in cp mainly for performance but this could be just nothing regarding time for restore.&lt;/p&gt;

</comment>
                            <comment id="65730" author="adegremont" created="Wed, 4 Sep 2013 14:07:23 +0000"  >&lt;p&gt;&amp;gt; Did I understand and is this what you mean ?&lt;/p&gt;

&lt;p&gt;This is perfectly correct!&lt;/p&gt;

&lt;p&gt;&amp;gt; Then, only difference I see already is that we will not use the same cp logic for &quot;real&quot; non-sparse (plain or dense) but released files, if any specifics are made in cp mainly for performance but this could be just nothing regarding time for restore.&lt;/p&gt;

&lt;p&gt;I do not understand what you mean &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.whamcloud.com/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;What I see is that cp will read sequentially the just-previously-released-but-now-restored file, instead of doing something more efficient because the file could really be &quot;a little bit&quot; sparse.&lt;br/&gt;
So before releasing the file, cp would have copied it efficiently, creating a sparse file.&lt;br/&gt;
After restore, it will copy it fully, and the file copy will be no more sparse.&lt;br/&gt;
I think this is acceptable.&lt;/p&gt;</comment>
                            <comment id="65740" author="jay" created="Wed, 4 Sep 2013 15:22:09 +0000"  >&lt;p&gt;Hi Aurelien and Bruno,&lt;/p&gt;

&lt;p&gt;If we can fix this issue by fiemap that&apos;ll be great. I was afraid that we would fix tar issue but import another one by reporting incorrect block number.&lt;/p&gt;

&lt;p&gt;Jinshan&lt;/p&gt;</comment>
                            <comment id="65741" author="jhammond" created="Wed, 4 Sep 2013 15:41:10 +0000"  >&lt;p&gt;I think this is very simple and that we&apos;re being a bit lazy here.&lt;/p&gt;

&lt;p&gt;It is a bug for release to change st_blocks. Remember that HSM is supposed to be transparent to the user. We shouldn&apos;t be trying to guess if some application will depend on st_blocks. Instead we should assume that some application depends on st_blocks and that there will be data loss because of this bug. It can be a blocker or not, I don&apos;t care so much. But it&apos;s a bug.&lt;/p&gt;

&lt;p&gt;The fact that we&apos;re focused on cp and tar is troubling. What about bbcp, rsync, zip, and all of those terrible data movers that the open science sites use? Have we checked them too?&lt;/p&gt;

&lt;p&gt;Moreover, it&apos;s very easy to think of situations where regular users will be confused by this. For example, when they run &apos;du -hs&apos; on their homedir and then tell admin that the 8TB of data they just created must be lost. The admin who uses HSM on the other hand can be told and should know that &apos;dh -hs&apos; will not always reflect the frontend FS usage.&lt;/p&gt;</comment>
                            <comment id="65764" author="jay" created="Wed, 4 Sep 2013 18:39:13 +0000"  >&lt;p&gt;Hi John, by design, st_blocks is the actual disk blocks consumed by the file data. So it should be reasonable to report 0 for st_blocks for released files, this matches the . But I agree that reporting st_blocks to be zero is confusing here because this may cause applications to think this is a totally sparse file so fiemap won&apos;t be consulted at all.&lt;/p&gt;

&lt;p&gt;Any decisions for this problem are reasonable to me &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.whamcloud.com/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="65835" author="adegremont" created="Thu, 5 Sep 2013 13:30:12 +0000"  >&lt;p&gt;John, &lt;/p&gt;

&lt;p&gt;I agree with you that checking each possible tool is not the right way.&lt;/p&gt;


&lt;ul&gt;
	&lt;li&gt;Users will be confused at first by this, but we should teach them. You cannot really consider this will be really fully transparent for them. I&apos;m pretty sure that users will ask admins why their file accesses are random, because they do not realize that files could restored when accessed and this could requires mounting tapes which could be really long.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;DMF, which is the major HSM in HPC environment, and probably the HSM that will be used the most with Lustre/HSM, is exactly doing this. DMF, on their XFS/CXFS frontend, reports st_block == 0 for released(offline) files. DMF is probably doing this for 20 years now. This is the main solution right now on the market and DMF is very interested by Lustre as a frontend because CXFS does not scale (and because Lustre is very well deployed).&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Admins like they can see this difference between theoretical space and real disk usage through stat/du.&lt;/li&gt;
&lt;/ul&gt;



&lt;blockquote&gt;&lt;p&gt;I think this is very simple and that we&apos;re being a bit lazy here.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;What will be your proposal?&lt;/p&gt;


&lt;p&gt;I still consider this behavior could be changed, but this is not as simple as: this is totally wrong to reports 0 for st_blocks. I think reporting st_block as 0 is a feature, not a bug. Only the potential data corruption for some &quot;too-smart&quot; tools is a concern to me.&lt;/p&gt;</comment>
                            <comment id="65923" author="adegremont" created="Fri, 6 Sep 2013 08:12:56 +0000"  >&lt;p&gt;Why this bug as been put as wontfix?&lt;/p&gt;

&lt;p&gt;We must, at least, fix FIEMAP.&lt;/p&gt;</comment>
                            <comment id="65924" author="adegremont" created="Fri, 6 Sep 2013 08:18:56 +0000"  >&lt;p&gt;OK, I&apos;ve checked with GHI (GPFS/HPSS Interface), which is the only concurrent product of Lustre/HSM.&lt;br/&gt;
GHI also returns st_blocks == 0 when files are RELEASED.&lt;/p&gt;

&lt;p&gt;I propose that FIEMAP is modified for RELEASED files, and st_block still return 0. We will see if lot of people complains about that.&lt;/p&gt;</comment>
                            <comment id="66045" author="bfaccini" created="Mon, 9 Sep 2013 09:23:57 +0000"  >&lt;p&gt;Hello Aurelien,&lt;br/&gt;
Seems everybody &quot;agree&quot; with st_blocks to be Null for released files. This is the reason ticket resolution has been set as &quot;won&apos;t fix&quot;.&lt;/p&gt;

&lt;p&gt;Concerning change in FIEMAP, this can be tracked as a new ticket (or still this one), but with lower priority.&lt;/p&gt;

&lt;p&gt;BTW, do we know what answer to FIEMAP do provide DMF and/or GHI ??&lt;/p&gt;

&lt;p&gt;Seems to me that it is not a frozen interface, because when googling I found that a FIEMAP_EXTENT_SECONDARY flag exists (to indicate that extent data are on HSM) in some implementations that may fit our needs here, but then is it used/tested by the coreutils and other tools ? &lt;/p&gt;

&lt;p&gt;But anyway, I wrote a 1st patch attempt that returns a single extent with (FIEMAP_EXTENT_DELALLOC | FIEMAP_EXTENT_UNKNOWN | FIEMAP_EXTENT_LAST). It is &lt;a href=&quot;http://review.whamcloud.com/7584&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7584&lt;/a&gt;.&lt;/p&gt;
</comment>
                            <comment id="66484" author="adegremont" created="Thu, 12 Sep 2013 13:32:18 +0000"  >&lt;p&gt;&amp;gt; BTW, do we know what answer to FIEMAP do provide DMF and/or GHI ??&lt;/p&gt;

&lt;p&gt;Ok I got the information from SGI.&lt;br/&gt;
XFS(for DMF) is returning 1 full extent, with normal flag (not UNKNOWN or DELALLOC, etc)&lt;/p&gt;

&lt;p&gt;I do not know for GHI.&lt;/p&gt;</comment>
                            <comment id="66897" author="adilger" created="Wed, 18 Sep 2013 08:42:48 +0000"  >&lt;p&gt;There is still a patch to land for this bug.&lt;/p&gt;</comment>
                            <comment id="67151" author="bfaccini" created="Fri, 20 Sep 2013 18:33:44 +0000"  >&lt;p&gt;Humm during 1st patch-set testing I also found (seems not already reported) that doing a &quot;filefrag&quot; (ie FIEMAP syscall!) on a released file just crash with the follwing LBUG :&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;LustreError: 13811:0:(lov_obd.c:2488:lov_fiemap()) ASSERTION( fm_local ) failed: 
LustreError: 13811:0:(lov_obd.c:2488:lov_fiemap()) LBUG
Pid: 13811, comm: filefrag

Call Trace:
 [&amp;lt;ffffffffa0206895&amp;gt;] libcfs_debug_dumpstack+0x55/0x80 [libcfs]
 [&amp;lt;ffffffffa0206e97&amp;gt;] lbug_with_loc+0x47/0xb0 [libcfs]
 [&amp;lt;ffffffffa084e56c&amp;gt;] lov_get_info+0x10ac/0x1cb0 [lov]
 [&amp;lt;ffffffff8112fca0&amp;gt;] ? __lru_cache_add+0x40/0x90
 [&amp;lt;ffffffffa08697ab&amp;gt;] ? lov_lsm_addref+0x6b/0x130 [lov]
 [&amp;lt;ffffffffa0dbaab1&amp;gt;] ll_do_fiemap+0x411/0x6b0 [lustre]
 [&amp;lt;ffffffffa0dc5d97&amp;gt;] ll_fiemap+0x117/0x590 [lustre]
 [&amp;lt;ffffffff811956e5&amp;gt;] do_vfs_ioctl+0x505/0x580
 [&amp;lt;ffffffff811957e1&amp;gt;] sys_ioctl+0x81/0xa0
 [&amp;lt;ffffffff8100b072&amp;gt;] system_call_fastpath+0x16/0x1b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and this with or without my patch, this is due to unconditionally freeing &quot;fm_local&quot; at the end of lov_fiemap() routine, even if it was not allocated because of no-object/ENOMEM and also now when released!!&lt;/p&gt;

&lt;p&gt;Will fix that in patch-set #7 in addition to answer/address Andreas comments for patch-set #6.&lt;/p&gt;
</comment>
                            <comment id="67486" author="bfaccini" created="Tue, 24 Sep 2013 23:05:23 +0000"  >&lt;p&gt;Hummm seems that &quot;tar --sparse&quot;, instead of using FIEMAP as expected, uses an odd optimization (if st_blocks = 0) that cause a released file to be archived as a fully sparse file. I did not check all/latest versions of tar.&lt;/p&gt;

&lt;p&gt;Seems that for btrfs they encountered the problem with small files (ie, enough small to have the datas stored with the meta-datas and then report st_blocks = 0), as detailed in RedHat Bugzilla #757557 (at &lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=757557&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://bugzilla.redhat.com/show_bug.cgi?id=757557&lt;/a&gt;). And if I correctly understand, they fixed it by returning st_blocks = 1. Should we do the same ??&lt;/p&gt;</comment>
                            <comment id="67601" author="adilger" created="Wed, 25 Sep 2013 19:44:56 +0000"  >&lt;p&gt;We already do the same on the client if it only has writeback cache pages - if st_blocks == 0 but there is dirty data in the client cache we return st_blocks = 1.  See cl_glimpse_lock():&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cl_isize_read(inode) &amp;gt; 0 &amp;amp;&amp;amp;
                                    inode-&amp;gt;i_blocks == 0) {
                                        /*
                                         * LU-417: Add dirty pages block count
                                         * lest i_blocks reports 0, some &lt;span class=&quot;code-quote&quot;&gt;&quot;cp&quot;&lt;/span&gt; or
                                         * &lt;span class=&quot;code-quote&quot;&gt;&quot;tar&quot;&lt;/span&gt; may think it&apos;s a completely
                                         * sparse file and skip it.
                                         */
                                        inode-&amp;gt;i_blocks = dirty_cnt(inode);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="67648" author="adilger" created="Thu, 26 Sep 2013 05:47:37 +0000"  >&lt;p&gt;Note that returning st_blocks = 1 can still be justified as &quot;correct&quot; for HSM released files, since this is still consuming one sector on the MDT filesystem for the inode.&lt;/p&gt;</comment>
                            <comment id="67683" author="adegremont" created="Thu, 26 Sep 2013 13:43:15 +0000"  >&lt;p&gt;Most of filesystem does not count the space used by inode (unless there is extra block used by metadata, like for EA) when filling st_blocks, but POSIX does not say if it is only data or not. &lt;/p&gt;

&lt;p&gt;Anyway, I think we will have to go for the &quot;st_blocks == 1&quot; solution.&lt;/p&gt;

&lt;p&gt;I checked what XFS/DMF does for that. SGI says &quot;don&apos;t use tar&quot;.... :/&lt;/p&gt;</comment>
                            <comment id="67809" author="bfaccini" created="Fri, 27 Sep 2013 12:42:08 +0000"  >&lt;p&gt;Submitted patch to have st_blocks = 1 returned for released files, at &lt;a href=&quot;http://review.whamcloud.com/7776&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7776&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="68044" author="bfaccini" created="Tue, 1 Oct 2013 13:56:15 +0000"  >&lt;p&gt;&lt;a href=&quot;http://review.whamcloud.com/7776&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7776&lt;/a&gt; has land and &lt;a href=&quot;http://review.whamcloud.com/7584&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7584&lt;/a&gt; only misses reviews now.&lt;/p&gt;</comment>
                            <comment id="68198" author="pjones" created="Wed, 2 Oct 2013 20:39:43 +0000"  >&lt;p&gt;Landed for &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3864&quot; title=&quot;stat() on HSM released file returns st_blocks = 0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3864&quot;&gt;&lt;del&gt;LU-3864&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <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|hzvzpz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10028</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>