<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:34:47 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-10405] FIEMAP on object with no stripe should not return ENODATA</title>
                <link>https://jira.whamcloud.com/browse/LU-10405</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The FIEMAP ioctl is used by many tools like cp(1) to optimize sparse files, but any error is treated as failure and such tools usually fall back by reading the whole file (so, zeroes if there is no stripe)&lt;br/&gt;
 lov_object_fiemap returns -ENODATA if it could not get the object&apos;s lov_stripe_md. We should just fill the structure with no extent and return success instead.&lt;/p&gt;

&lt;p&gt;We have many files with no stripe here because our copytool destripes released files, so they get assigned new OSTs on restore (instead of being restored where they originally were created, which might be bad balance) ; this mostly only impact admins copying released data around very carefully so this is somewhat minor for us, but still a bug imo.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;FWIW we also have actual sparse files with data (e.g. VM images) on lustre with non-trivial striping so fiemap returning ENOTSUPP on call without FIEMAP_FLAG_DEVICE_ORDER, and cp would just read everything. I think we could support this better as well... But that&apos;s another issue &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;&#160;&lt;/p&gt;

&lt;p&gt;It&apos;s actually not so easy to create a file without stripe for testing, so I attached a simple program that does.&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;$ gcc -o create-nostripe create-nostripe.c
$ ./create-nostripe /mnt/lustre/testfile
$ strace -e ioctl,read cp -a /mnt/lustre/testfile /tmp |&amp;amp; head -n 20
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\300j\0\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\200\37\0\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\320\23\0\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0@\34\2\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\360\25\0\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0`\16\0\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\240l\0\0\0\0\0\0&quot;&lt;/span&gt;..., 832) = 832
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;nodev\tsysfs\nnodev\trootfs\nnodev\tr&quot;&lt;/span&gt;..., 1024) = 360
read(3, &quot;&quot;, 1024)                       = 0
ioctl(3, FS_IOC_FIEMAP, 0x7ffd374e88e0) = -1 ENODATA (No data available)
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
read(3, &lt;span class=&quot;code-quote&quot;&gt;&quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;&lt;/span&gt;..., 65536) = 65536
....


&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I will submit a patch for this right away.&lt;/p&gt;</description>
                <environment></environment>
        <key id="49909">LU-10405</key>
            <summary>FIEMAP on object with no stripe should not return ENODATA</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</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="martinetd">Dominique Martinet</assignee>
                                    <reporter username="cealustre">CEA</reporter>
                        <labels>
                            <label>cea</label>
                            <label>patch</label>
                    </labels>
                <created>Tue, 19 Dec 2017 08:59:05 +0000</created>
                <updated>Wed, 5 Aug 2020 13:27:55 +0000</updated>
                            <resolved>Thu, 25 Jan 2018 05:08:55 +0000</resolved>
                                    <version>Lustre 2.7.0</version>
                    <version>Upstream</version>
                                    <fixVersion>Lustre 2.11.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="216704" author="gerrit" created="Tue, 19 Dec 2017 09:03:02 +0000"  >&lt;p&gt;Dominique Martinet (dominique.martinet@cea.fr) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/30591&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/30591&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10405&quot; title=&quot;FIEMAP on object with no stripe should not return ENODATA&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10405&quot;&gt;&lt;del&gt;LU-10405&lt;/del&gt;&lt;/a&gt; lov: fill no-extent fiemap on object with no stripe.&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: bbf2fcfe575de341f31074f8190d1a310c18f5cf&lt;/p&gt;</comment>
                            <comment id="216708" author="adilger" created="Tue, 19 Dec 2017 10:46:33 +0000"  >&lt;p&gt;FYI, the &quot;mcreate&quot; program in the lustre-tests RPM is typically used in test scripts to create a file without any striping.&#160; It uses &lt;tt&gt;mknod(2)&lt;/tt&gt; syscall to create a regular file without opening it, since the &lt;tt&gt;mknod(1)&lt;/tt&gt; utility does not allow the creation of regular files.&lt;/p&gt;</comment>
                            <comment id="216709" author="martinetd" created="Tue, 19 Dec 2017 11:50:14 +0000"  >&lt;p&gt;This doesn&apos;t work for my specific example here, as cp only uses fiemap on files given a certain size &#8211; my create-nostripe is misnamed and also ftruncate()s the file after creating it to reflect a bigger size like we have on our filesystems.&lt;/p&gt;

&lt;p&gt;Thanks for the info though, I wasn&apos;t aware of it.&lt;/p&gt;</comment>
                            <comment id="216761" author="adilger" created="Tue, 19 Dec 2017 18:56:28 +0000"  >&lt;p&gt;Two comments here:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the &#8220;truncate -s&#8221; command can change the file size without opening it, so that should work together with &#8220;mcreate&#8221; without adding another tool. There is also &#8220;mulitop&#8221; that should allow similar kinds of operations already.&lt;/li&gt;
	&lt;li&gt;you mention &#8220;copying (HSM) released files&#8221;, but in that case this could result in data loss to return an empty extent map to cp for a released file, since cp would think there is no data in the file, when in fact it is on the archive.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="216823" author="martinetd" created="Wed, 20 Dec 2017 08:14:00 +0000"  >&lt;p&gt;I had tried truncate -s, it seems to open + ftruncate so that assigns a striping. multiop would work, I&apos;ll have a look &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;&#160;&lt;/p&gt;

&lt;p&gt;And yes, admin copying (HSM) released files is tricky... But we&apos;re trying to be careful. Migrating from one filesystem to another without reading all the tapes is an interesting operation... Might only work for us with our hybrid lustre/HSM and old CEA hsm monster still crawling around and helping around the edges.&lt;/p&gt;

&lt;p&gt;I actually hadn&apos;t thought of the impact of this for &lt;em&gt;user&lt;/em&gt; cp, since lustre/hsm restores on first read it will wrongly think there is nothing to read, and this will cause real problems. We &lt;del&gt;will&lt;/del&gt; apparently already have the same problem with tar that just looks at stat.st_blocks and skips anything with 0 with a lstat() without ever even opening the file. That&apos;s going to be a tricky problem, makes me think we will want to drop this patch and open a new issue about faking st_blocks for tar...&lt;/p&gt;</comment>
                            <comment id="216825" author="adilger" created="Wed, 20 Dec 2017 09:39:54 +0000"  >&lt;p&gt;Yes, we have a special check in the client code to return a non-zero blocks count for stat() of the inode if there are dirty pages on the client (&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-417&quot; title=&quot;block usage is reported as zero by stat call for tens of seconds after creating a file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-417&quot;&gt;&lt;del&gt;LU-417&lt;/del&gt;&lt;/a&gt;, see comment in cl_glimpse_lock() and vvp_object_glimpse()), even if no pages have been written to disk yet, to avoid problems with cp and tar. &lt;/p&gt;

&lt;p&gt;It makes sense to do the same for HSM released files if that isn&apos;t done already. &lt;/p&gt;</comment>
                            <comment id="216938" author="martinetd" created="Thu, 21 Dec 2017 12:39:54 +0000"  >&lt;p&gt;Ok, this does make sense, I see what&apos;s done here. The two functions here look insufficient for an HSM released file as far as I can see, because dirty_cnt will also be 0; will likely need to add a second check &quot;if blocks is still 0 after dirty_cnt check for hsm state and set an arbitrary value (size/blocksize?)&quot;&lt;/p&gt;

&lt;p&gt;I&apos;ll see if I can reproduce the problem with tar (cp no longer bases itself on i_blocks) and open a new ticket likely early next year.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I&apos;m thinking something similar is needed here, if there is no stripe then also check hsm state and either return NODATA as currently if released or return an empty map. I won&apos;t have time to add and test that this year so giving my own patch a -1 to hold it off.&lt;/p&gt;</comment>
                            <comment id="216953" author="jhammond" created="Thu, 21 Dec 2017 15:03:12 +0000"  >&lt;p&gt;In both 2.7 and master, we do return a &quot;minimal FIEMAP&quot; for released files. See &lt;tt&gt;lov_fiemap()&lt;/tt&gt; and &lt;tt&gt;lov_object_fiemap()&lt;/tt&gt;. And this works (at least on master) but we do not seem to have a test for it.&lt;/p&gt;

&lt;p&gt;We also return a non zero block count for release files.&lt;/p&gt;

&lt;p&gt;When you update your patch, please include a test that fails before the code change and passes after.&lt;/p&gt;</comment>
                            <comment id="216960" author="martinetd" created="Thu, 21 Dec 2017 16:45:22 +0000"  >&lt;p&gt;Hi John.&lt;/p&gt;

&lt;p&gt;As I said in a previous comment, the truncate command does an open followed by ftruncate so it allocates stripes for the file, unlike my test example. I did reproduce it on master (80515fa &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10232&quot; title=&quot;kernel BUG at cl_object.c:206!&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10232&quot;&gt;&lt;del&gt;LU-10232&lt;/del&gt;&lt;/a&gt; lov: call cl_object_attr_get under cl_attr lock) so I&apos;m fairly sure of myself.&lt;/p&gt;

&lt;p&gt;I&apos;ve also checked multiop and I don&apos;t see how to open a file with O_LOV_DELAY_CREATE. I can do mknod but then the file isn&apos;t opened so ftruncate doesn&apos;t help. I also double-checked the truncate(1) command but can&apos;t make it call truncate() with a path instead of ftruncate()... I&apos;ll do more checking we can do with normal lustre test programs, but please use my create-nostripe.c for now.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I see the code part about lhsm released file now, I hadn&apos;t really looked at code past the FIEMAP_FLAG_DEVICE_ORDER check though because cp does not handle that. Your example shows a working fiemap because you likely have a stripecount of 1, which is not the case for our LHSM filesystem... I can&apos;t use lsm-&amp;gt;lsm_is_released in my patch though, since lsm is returned as NULL, I&apos;ll need another way to check for released state? Will do some more digging, I&apos;m not very familiar with this code.&lt;/p&gt;

&lt;p&gt;I&apos;ll also add new tests on refresh, it&apos;ll have to wait for new year though...&lt;/p&gt;</comment>
                            <comment id="216976" author="jhammond" created="Thu, 21 Dec 2017 18:13:31 +0000"  >&lt;p&gt;Dominique,&lt;/p&gt;

&lt;p&gt;You are correct about the truncate.&lt;/p&gt;</comment>
                            <comment id="216978" author="jhammond" created="Thu, 21 Dec 2017 18:15:00 +0000"  >&lt;p&gt;BTW, the multiop command line to use would be:&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;multiop f0  oO_RDWR:O_CREAT:O_LOV_DELAY_CREATE:T10737418240c
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Unfortunately multiop does not support 64 bit file sizes. (This would be easy to fix however.)&lt;/p&gt;</comment>
                            <comment id="217799" author="martinetd" created="Tue, 9 Jan 2018 15:22:17 +0000"  >&lt;p&gt;Hi and happy new year,&lt;/p&gt;

&lt;p&gt;I have update the patch with a new test, that checks fiemap on unstripped files with filefrag -e like the other fiemap tests (and your multiop line, thanks! Hadn&apos;t noticed &apos;o&apos; could take a list of flags as arguments, this help output made it sound like &apos;o&apos; is always just O_CREAT)&lt;/p&gt;

&lt;p&gt;Regarding hsm-files, I&apos;ve double-checked this should be fine. I wasn&apos;t clear that a released file would always have a `lsm` so now this is cleared up my patch doesn&apos;t need to change, this won&apos;t cause any new false-positive of not copying data when we should.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;As a side-note, I do notice that released files have st_blocks set to 1 (presumably to tell tar and friends to look at the content), but I could not find in the code where that is set. cl_glimpse_lock() and vvp_object_glimpse() have a comment about that for dirty_cnt() but this function doesn&apos;t do any HSM-related check... Well, I guess this works so I don&apos;t really need to look further.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;</comment>
                            <comment id="219087" author="gerrit" created="Thu, 25 Jan 2018 04:47:47 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/30591/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/30591/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10405&quot; title=&quot;FIEMAP on object with no stripe should not return ENODATA&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10405&quot;&gt;&lt;del&gt;LU-10405&lt;/del&gt;&lt;/a&gt; lov: fill no-extent fiemap on object with no stripe.&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 113fa79b7dc9b598c615d4cbfa6e3513d2c6d35b&lt;/p&gt;</comment>
                            <comment id="219112" author="pjones" created="Thu, 25 Jan 2018 05:08:55 +0000"  >&lt;p&gt;Landed for 2.11&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="29017" name="create-nostripe.c" size="551" author="martinetd" created="Tue, 19 Dec 2017 08:40:07 +0000"/>
                    </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|hzzptz:</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>