<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:45: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-11656] &quot;lfs getstripe&quot; on directory does not show default root layout</title>
                <link>https://jira.whamcloud.com/browse/LU-11656</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Running &quot;lfs getstripe&quot; on a directory only shows the simple filesystem default layout and not the root default layout that will actually be inherited by new files.&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;# lfs setstripe -p ssd /mnt/testfs
# lfs getstripe -d /mnt/testfs
stripe_count: 1 stripe_size: 1048576 stripe_offset: -1 pool: ssd
# mkdir /mnt/testfs/tmp/should_be_old
# lfs getstripe -d /mnt/testfs/tmp/should_be_old
stripe_count: 1 stripe_size: 1048576 stripe_offset: -1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="53999">LU-11656</key>
            <summary>&quot;lfs getstripe&quot; on directory does not show default root layout</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</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="yujian">Jian Yu</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Sun, 11 Nov 2018 17:03:05 +0000</created>
                <updated>Sat, 27 Jun 2020 08:37:07 +0000</updated>
                            <resolved>Fri, 20 Dec 2019 03:52:06 +0000</resolved>
                                    <version>Lustre 2.12.0</version>
                    <version>Lustre 2.10.8</version>
                                    <fixVersion>Lustre 2.14.0</fixVersion>
                    <fixVersion>Lustre 2.12.4</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="239405" author="yujian" created="Fri, 4 Jan 2019 10:00:07 +0000"  >&lt;p&gt;Here is the test result on Lustre 2.10.5_ddn6 and master branch:&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;# lfs getstripe -d /mnt/lustre
stripe_count:  1 stripe_size:   1048576 pattern:       0 stripe_offset: -1

# mkdir /mnt/lustre/olddir
# lfs getstripe -d /mnt/lustre/olddir
stripe_count:  1 stripe_size:   1048576 pattern:       0 stripe_offset: -1

# lfs setstripe -p OLD /mnt/lustre
# lfs getstripe -d /mnt/lustre
stripe_count:  1 stripe_size:   1048576 pattern:       raid0 stripe_offset: -1 pool:          OLD

# lfs getstripe -d /mnt/lustre/olddir
stripe_count:  1 stripe_size:   1048576 pattern:       0 stripe_offset: -1

# mkdir /mnt/lustre/newdir
# lfs getstripe -d /mnt/lustre/newdir
stripe_count:  1 stripe_size:   1048576 pattern:       raid0 stripe_offset: -1 pool:          OLD
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The result is different from the description part of this ticket. Actually, running &quot;lfs getstripe&quot; on newly created directory after setting pool name on its parent directory can still show the pool name. Only the directory created before setting pool name on its parent directory has pool name printing issue.  &lt;/p&gt;

&lt;p&gt;While running &quot;lfs getstripe&quot;, the following codes produced the different outputs for &quot;/mnt/lustre&quot; and &quot;/mnt/lustre/olddir&quot;:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;lov_dump_plain_user_lmm()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        __u32 magic = *(__u32 *)&amp;amp;param-&amp;gt;fp_lmd-&amp;gt;lmd_lmm;
        &lt;span class=&quot;code-comment&quot;&gt;//......
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (magic == LOV_USER_MAGIC_V1) {                    &amp;lt;------ &lt;span class=&quot;code-quote&quot;&gt;&quot;/mnt/lustre/olddir&quot;&lt;/span&gt; had LOV_USER_MAGIC_V1
                lov_dump_user_lmm_v1v3(...);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {                                                                    &amp;lt;------ &lt;span class=&quot;code-quote&quot;&gt;&quot;/mnt/lustre&quot;&lt;/span&gt; had LOV_USER_MAGIC_V3
                &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; pool_name[LOV_MAXPOOLNAME + 1];
                struct lov_user_ost_data_v1 *objects;
                struct lov_user_md_v3 *lmmv3 = (void *)&amp;amp;param-&amp;gt;fp_lmd-&amp;gt;lmd_lmm;

                snprintf(pool_name, sizeof(pool_name), &lt;span class=&quot;code-quote&quot;&gt;&quot;%s&quot;&lt;/span&gt;,
                         lmmv3-&amp;gt;lmm_pool_name);
                objects = lmmv3-&amp;gt;lmm_objects;
                lov_dump_user_lmm_v1v3(...);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After running &quot;lfs setstripe -p OLD&quot; on &quot;/mnt/lustre&quot;, its magic was changed from LOV_USER_MAGIC_V1 to LOV_USER_MAGIC_V3 in lod_xattr_set(). However, the previously created &quot;/mnt/lustre/olddir&quot; still had magic of LOV_USER_MAGIC_V1 and was not changed.&lt;/p&gt;</comment>
                            <comment id="239415" author="adilger" created="Fri, 4 Jan 2019 19:05:15 +0000"  >&lt;p&gt;After &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11739&quot; title=&quot;Don&amp;#39;t inherit default layout from root for new subdirectories&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11739&quot;&gt;&lt;del&gt;LU-11739&lt;/del&gt;&lt;/a&gt;, we shouldn&apos;t be explicitly inheriting the layout from the root directory anymore.&lt;/p&gt;

&lt;p&gt;However, I think the &quot;lfs getstripe&quot; on directories that do not have an actual LOV EA will only print the stripe_count, stripe_size, and stripe_index that is fetched from the /sys/fs/lustre/lov values.&lt;/p&gt;

&lt;p&gt;We need some way to fetch the actual default layout that will be used when new files will be created in that directory.  We can&apos;t use the layout from the directory of the mountpoint, since that might be a subdirectory mount.  One option would be to fetch the layout from the ROOT FID?&lt;/p&gt;</comment>
                            <comment id="240684" author="dauchy" created="Fri, 25 Jan 2019 01:01:08 +0000"  >&lt;p&gt;Jian, I wanted to make sure the &quot;explicitly inheriting&quot; issue was clear, as it explains why your test showed different results than the original bug report.&#160; You did everything in the top-level.&#160; So, to reproduce and see that &quot;lfs getstripe&quot; does not actually report the filesystem default, try something like this:&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;# lfs getstripe -d /lfstmp
stripe_count: 1 stripe_size: 1048576 stripe_offset: -1 pool: OLD
# mkdir /lfstmp/toplevel
# lfs getstripe -d /lfstmp/toplevel
stripe_count: 1 stripe_size: 1048576 stripe_offset: -1 pool: OLD
   (that is the root level Explicit inheritance)

# lfs setstripe -d /lfstmp/toplevel
# lfs getstripe -d /lfstmp/toplevel
stripe_count: 1 stripe_size: 1048576 stripe_offset: -1
# mkdir /lfstmp/toplevel/should_be_old
# lfs getstripe -d /lfstmp/toplevel/should_be_old/
stripe_count: 1 stripe_size: 1048576 stripe_offset: -1
  (neither the top level or new dirs display &quot;OLD&quot;, but they should)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Hope this helps!&lt;br/&gt;
-Nathan&lt;/p&gt;</comment>
                            <comment id="240723" author="yujian" created="Fri, 25 Jan 2019 17:39:47 +0000"  >&lt;p&gt;Thank you, Nathan.&lt;/p&gt;

&lt;p&gt;However, &quot;lfs setstripe -d /lfstmp/toplevel&quot; will delete both the striping pattern and OST pool (fixed in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10629&quot; title=&quot;Cannot clear a default OST pool from root&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10629&quot;&gt;&lt;del&gt;LU-10629&lt;/del&gt;&lt;/a&gt;) on the directory. So, the above test results are correct.&lt;/p&gt;</comment>
                            <comment id="250022" author="dauchy" created="Tue, 25 Jun 2019 20:14:14 +0000"  >&lt;p&gt;Jian.&lt;/p&gt;

&lt;p&gt;I just wanted to make sure you were aware that this is still a problem, even with &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10629&quot; title=&quot;Cannot clear a default OST pool from root&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10629&quot;&gt;&lt;del&gt;LU-10629&lt;/del&gt;&lt;/a&gt; fixed or deleting the stripe info on a directory so that it should implicitly inherit the filesystem default.&#160; I agree with the statement that Andreas made &quot;&lt;em&gt;We need some way to fetch the actual default layout that will be used when new files will be created in that directory.&lt;/em&gt;&quot;&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Nathan&lt;/p&gt;</comment>
                            <comment id="250085" author="yujian" created="Wed, 26 Jun 2019 16:42:39 +0000"  >&lt;p&gt;Hi Nathan,&lt;br/&gt;
Let me look into this and work on it.&lt;/p&gt;</comment>
                            <comment id="250775" author="yujian" created="Fri, 5 Jul 2019 18:53:01 +0000"  >&lt;p&gt;According to Andreas&apos; comments, I&apos;m working on the patch to fetch the layout from the ROOT FID &lt;span class=&quot;error&quot;&gt;&amp;#91;FID_SEQ_ROOT, FID_OID_ROOT, 0&amp;#93;&lt;/span&gt;.&lt;/p&gt;</comment>
                            <comment id="252821" author="adilger" created="Fri, 9 Aug 2019 04:07:28 +0000"  >&lt;p&gt;Jian, is the default layout for the directory going to be fetched from the ROOT FID inside the kernel or from the &quot;&lt;tt&gt;lfs getstripe&lt;/tt&gt;&quot; command?  Fetching it from the kernel simplifies some issues for userspace applications, but has the drawback that tools like &quot;tar&quot; will make a copy of the default &lt;tt&gt;trusted.lov&lt;/tt&gt; xattr for every directory in the filesystem which doesn&apos;t have its own xattr.  &lt;/p&gt;

&lt;p&gt;Doing it in &quot;&lt;tt&gt;lfs getstripe&lt;/tt&gt;&quot; avoids this issue, but may have other issues (e.g. opening &lt;tt&gt;$MOUNT/.lustre/fid&lt;/tt&gt; is only accessible to root, and is not available in subdirectory mounts.&lt;/p&gt;</comment>
                            <comment id="254035" author="yujian" created="Tue, 3 Sep 2019 06:39:21 +0000"  >&lt;p&gt;Hi Andreas,&lt;/p&gt;

&lt;p&gt;As per your suggestions, fetching default layout for a directory will be done in lfs_getstripe()&amp;#45;&amp;gt;...&amp;#45;&amp;gt;cb_getstripe(). If get_lmd_info() returns -ENODATA for a directory that does not have trusted.lov xattr, cb_getstripe() should get the lov_user_md data from ROOT FID, and then print the layout information in llapi_lov_dump_user_lmm().&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One solution would be to special-case the &lt;span class=&quot;error&quot;&gt;&amp;#91;FID_SEQ_ROOT, FID_OID_ROOT, 0&amp;#93;&lt;/span&gt; lookup in the directory in ioctl(IOC_MDC_GETFILESTRIPE) to convert this ioctl onto the actual ROOT FID, since this is out of the critical code path, and is unlikely to cause any problems for existing files. It should treat -ENOENT as -ENODATA, in case it is running on an old client that does not have this feature, and it will just keep the same behaviour as today.&lt;/p&gt;

&lt;p&gt;That will probably involve taking the core of ll_lov_getstripe_ea_info() into a separate helper function that allows passing the ROOT FID, while the original ll_lov_getstripe_ea_info() gets the FID from inode.&lt;/p&gt;

&lt;p&gt;One upcoming issue with explicitly using the ROOT FID is that this will complicate things is the patch &lt;a href=&quot;https://review.whamcloud.com/28972&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/28972&lt;/a&gt; &quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-9982&quot; title=&quot;Clients striping from mapped FID in nodemap&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-9982&quot;&gt;LU-9982&lt;/a&gt; lustre: Clients striping from mapped FID in nodemap&quot;, since that feature will allow clients to inherit layouts from a non-ROOT directory based on their nodemap. In that case, it might make sense to handle the ROOT FID getstripe to be mapped to the nodemap root layout (if set) so that the &quot;lfs getstripe&quot; output is consistent.&lt;/p&gt;&lt;/blockquote&gt;
</comment>
                            <comment id="257315" author="gerrit" created="Wed, 30 Oct 2019 08:00:16 +0000"  >&lt;p&gt;Jian Yu (yujian@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36609&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36609&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11656&quot; title=&quot;&amp;quot;lfs getstripe&amp;quot; on directory does not show default root layout&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11656&quot;&gt;&lt;del&gt;LU-11656&lt;/del&gt;&lt;/a&gt; utils: fix &quot;lfs getstripe&quot; to fetch default layout for a directory&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 497c3bd1bd884f4f2c60870a096b19c1a8ceb9fd&lt;/p&gt;</comment>
                            <comment id="260195" author="gerrit" created="Fri, 20 Dec 2019 03:27:13 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36609/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36609/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11656&quot; title=&quot;&amp;quot;lfs getstripe&amp;quot; on directory does not show default root layout&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11656&quot;&gt;&lt;del&gt;LU-11656&lt;/del&gt;&lt;/a&gt; llite: fetch default layout for a directory&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 3e8fa8a7396cd029cb0d7714a324343eed7f535e&lt;/p&gt;</comment>
                            <comment id="260205" author="pjones" created="Fri, 20 Dec 2019 03:52:06 +0000"  >&lt;p&gt;Landed for 2.14&lt;/p&gt;</comment>
                            <comment id="260209" author="gerrit" created="Fri, 20 Dec 2019 04:12:18 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/37072&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37072&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11656&quot; title=&quot;&amp;quot;lfs getstripe&amp;quot; on directory does not show default root layout&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11656&quot;&gt;&lt;del&gt;LU-11656&lt;/del&gt;&lt;/a&gt; llite: fetch default layout for a directory&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: b4a8724c893ab66d4343dc68fbd00ebd1d561a32&lt;/p&gt;</comment>
                            <comment id="260600" author="gerrit" created="Fri, 3 Jan 2020 23:44:19 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/37072/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37072/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11656&quot; title=&quot;&amp;quot;lfs getstripe&amp;quot; on directory does not show default root layout&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11656&quot;&gt;&lt;del&gt;LU-11656&lt;/del&gt;&lt;/a&gt; llite: fetch default layout for a directory&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: ca373442fc15a6dc77dcce36e91847c58ac45c03&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10120">
                    <name>Blocker</name>
                                            <outwardlinks description="is blocking">
                                        <issuelink>
            <issuekey id="54758">LU-11918</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="48297">LU-9982</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="54212">LU-11739</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="56608">LU-12643</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="59604">LU-13687</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|i0067z:</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>