<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:16:28 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-8314] user interface of lfs getdirstripe needs reworking</title>
                <link>https://jira.whamcloud.com/browse/LU-8314</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;lfs&apos;s subcommand &quot;getdirstripe&quot; has a very strange, and user unfriendly interface.  For whatever reason, getdirstripe always recurses one level down.&lt;/p&gt;

&lt;p&gt;Here is an example directory tree on Lustre 2.8.0:&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;$ find level1
level1
level1/level2_c
level1/level2_b
level1/level2_a
level1/level2_a/level3_c
level1/level2_a/level3_b
level1/level2_a/level3_a
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If I just want to get the directory striping information for the directory named &quot;level1&quot;, I might assume that the command is &quot;lfs getdirstripe level1&quot;.  But this is what I get instead:&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 getdirstripe level1
level1
lmv_stripe_count: 0 lmv_stripe_offset: 0
level1/level2_c
lmv_stripe_count: 0 lmv_stripe_offset: 0
level1/level2_b
lmv_stripe_count: 0 lmv_stripe_offset: 0
level1/level2_a
lmv_stripe_count: 0 lmv_stripe_offset: 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Not only did it give me the information for the directory that I actually asked for, it also decided to recurse on level down the tree and give me the directory information for all subdirectories.&lt;/p&gt;

&lt;p&gt;The man page more-or-less acknowledges this behaviour, but it buries the detail in the &amp;#45;r/&amp;#45;&amp;#45;recursive option.  So I can only assume that this was intentional rather than an accidental off-by-one default recursion count in the code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;       -r, --recursive&lt;br/&gt;
              The default behavior when a directory is specified is to list  the  striping  information&lt;br/&gt;
              for  all  sub-directories  within  the  specified  directory.  This  can be expanded with&lt;br/&gt;
              --recursive, which will recurse into all subdirectories.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The information there isn&apos;t exactly accurate either, because it actually lists the information for the specified directory and all of its sub-directories, not just the sub-directories of the specified directory.&lt;/p&gt;

&lt;p&gt;But the documentation is not really the problem.  The problem is that this is a bad user interface.&lt;/p&gt;

&lt;p&gt;When a user types &quot;lfs getdirstripe somedirectory&quot;, by default it should print the information for directory &quot;somedirectory&quot; and &lt;em&gt;nothing else&lt;/em&gt;.  Preferably it will not print &quot;somedirectory&quot; again in response before showing somedirectory&apos;s directory striping information.  Just print the dir striping information and nothing else.&lt;/p&gt;

&lt;p&gt;Just to make it super clear, here is an example of something more like I would expect to see from this command:&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 getdirstripe level1
lmv_stripe_count: 0 lmv_stripe_offset: 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is it.  Nothing else.&lt;/p&gt;

&lt;p&gt;This would make the command consistent with the -c and -i options as well.  This is how those currently work:&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 getdirstripe -c level1
0
$ lfs getdirstripe -i level1
0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For those commands it didn&apos;t decide to also show the requested information for all of the subdirectories as well.&lt;/p&gt;

&lt;p&gt;And while we are on the topic of weird interfaces, what the heck is this supposed to mean:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;       -q, --quiet&lt;br/&gt;
              Only show the details of the sub-striped directory FID information.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I have absolutely no idea.  Apparently it turns of all output:&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 getdirstripe -q level1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That seems overly quiet. &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;  But then, I don&apos;t understand what &quot;details of the sub-striped directory FID information&quot;, so I can&apos;t tell if printing nothing makes any sense.&lt;/p&gt;

&lt;p&gt;And next we have the verbose option with  which supposedly &quot;Additional information will be shown&quot;.  But no additional information is shown:&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 getdirstripe -v level1
level1
lmv_stripe_count: 0 lmv_stripe_offset: 0
level1/level2_c
lmv_stripe_count: 0 lmv_stripe_offset: 0
level1/level2_b
lmv_stripe_count: 0 lmv_stripe_offset: 0
level1/level2_a
lmv_stripe_count: 0 lmv_stripe_offset: 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Maybe there is some other situation under which it would print more information?&lt;/p&gt;

&lt;p&gt;Overall, the lfs getdirstripe command needs work before we can turn it over to our users.&lt;/p&gt;</description>
                <environment></environment>
        <key id="37721">LU-8314</key>
            <summary>user interface of lfs getdirstripe needs reworking</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="laisiyao">Lai Siyao</assignee>
                                    <reporter username="morrone">Christopher Morrone</reporter>
                        <labels>
                            <label>llnl</label>
                    </labels>
                <created>Tue, 21 Jun 2016 23:27:51 +0000</created>
                <updated>Thu, 10 Aug 2017 23:42:00 +0000</updated>
                            <resolved>Tue, 3 Jan 2017 19:05:15 +0000</resolved>
                                    <version>Lustre 2.8.0</version>
                                    <fixVersion>Lustre 2.10.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                            <comments>
                            <comment id="156415" author="lixi" created="Tue, 21 Jun 2016 23:58:03 +0000"  >&lt;p&gt;I agreed.&lt;/p&gt;

&lt;p&gt;Most of the Lustre tools are unfriendly to users especially to people who are just starting to learn Lustre.&lt;br/&gt;
And the outdated and insufficient document/manual is a problem too.&lt;/p&gt;</comment>
                            <comment id="156417" author="morrone" created="Wed, 22 Jun 2016 00:47:02 +0000"  >&lt;p&gt;While we are at it, &quot;lmv_stripe_count&quot; and &quot;lmv_stripe_offset&quot; are really silly names for these.  Why the &quot;lmv_&quot; prefix?  It doesn&apos;t even match the variable names in the header file (those start with lum_).  But even if they did match, it does not make much sense to expose C programming details in the command line interface.&lt;/p&gt;</comment>
                            <comment id="156555" author="adilger" created="Wed, 22 Jun 2016 20:06:31 +0000"  >&lt;p&gt;Comparing the behaviour of &quot;lfs getdirstripe&quot; on 2.5.3 vs. 2.8.0 I see that the output has changed from printing only the layout of the requested directory (including the FID of the directory object) to printing only the stripe count and offset of all first-level subdirectories. &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;client-2.5.3$ lfs getdirstripe /myth/tmp
/myth/tmp
lmv_stripe_count: 1
lmv_stripe_offset: 0
        mdtidx          FID[seq:oid:ver]
                0          [0x2489f5:0x451cf6bf:0x0]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;client-2.8.0$ lfs getstripe /myth/tmp
/myth/tmp
lmv_stripe_count: 0 lmv_stripe_offset: 0
/myth/tmp/test2
lmv_stripe_count: 0 lmv_stripe_offset: 0
/myth/tmp/ost2
lmv_stripe_count: 0 lmv_stripe_offset: 0
:
:
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I agree that this isn&apos;t as useful as one would expect.  It is possible to disable this behavior by using &quot;lfs getdirstripe -d /path/to/dir&quot; to print only the layout of the requested directory (like &quot;ls -d &amp;lt;directory&amp;gt;&quot;), which is the same way that &quot;lfs getstripe /path/to/dir&quot; works.  That said, I think the default recursion isn&apos;t the most obvious behavior and I&apos;d be OK to change it.&lt;/p&gt;

&lt;p&gt;The reason the filename is printed first is to separate the output from multiple directories, given the current behaviour.&lt;/p&gt;

&lt;p&gt;The &quot;lmv_&quot; prefix is because this is the directory layout, and not the file layout which is shown with an &quot;lmm_&quot; prefix.&lt;/p&gt;</comment>
                            <comment id="158448" author="morrone" created="Tue, 12 Jul 2016 01:13:18 +0000"  >&lt;blockquote&gt;&lt;p&gt;The &quot;lmv_&quot; prefix is because this is the directory layout, and not the file layout which is shown with an &quot;lmm_&quot; prefix.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I understand that directory and file stripes are named differently.  But &quot;lmv_&quot; is not the correct name for these variables.  Look here:&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;struct lmv_user_md_v1 {
        __u32   lum_magic;       &lt;span class=&quot;code-comment&quot;&gt;/* must be the first field */&lt;/span&gt;
        __u32   lum_stripe_count;  &lt;span class=&quot;code-comment&quot;&gt;/* dirstripe count */&lt;/span&gt;
        __u32   lum_stripe_offset; &lt;span class=&quot;code-comment&quot;&gt;/* MDT idx &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; dirstripe */&lt;/span&gt;
        __u32   lum_hash_type;     &lt;span class=&quot;code-comment&quot;&gt;/* Dir stripe policy */&lt;/span&gt;
        __u32   lum_type;         &lt;span class=&quot;code-comment&quot;&gt;/* LMV type: &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; or normal */&lt;/span&gt;
        __u32   lum_padding1;
        __u32   lum_padding2;
        __u32   lum_padding3;
        &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt;    lum_pool_name[LOV_MAXPOOLNAME + 1];
        struct  lmv_user_mds_data  lum_objects[0];
} __attribute__((packed));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sure, the structure starts with &quot;lmv_&quot;, but the variables inside the structure all start with &quot;lum_&quot;.  getdirstripe gets this wrong.  getstripe does not.  For lov stripes, the struct name starts with &quot;lov_&quot; and the variables in side the struct start with &quot;lmm_&quot;.&lt;/p&gt;

</comment>
                            <comment id="159264" author="adilger" created="Tue, 19 Jul 2016 21:40:01 +0000"  >&lt;p&gt;I would argue in this case that &quot;lum_&quot; is not the best prefix for this data structure&apos;s fields, and &quot;lmv_&quot; would be better, since &quot;lum_&quot; is easily confused with &quot;lov_user_md&quot;, while &quot;lmv_&quot; is reflecting &quot;Lustre Metadata Volume&quot;, LMV_USER_MAGIC, etc.  Renaming the fields internally also avoids problems with changing the user-visible interface that has existed since 2.4.&lt;/p&gt;

&lt;p&gt;I do agree that we should revert the &quot;lfs getdirstripe &amp;lt;dir&amp;gt;&quot; to the non-recursive mode that existed since 2.5.  I&apos;m not 100% sure whether that was new in 2.8, or if it existed since 2.7, but it is confusing enough that I don&apos;t think anyone depends on that behaviour.&lt;/p&gt;</comment>
                            <comment id="159268" author="morrone" created="Tue, 19 Jul 2016 22:08:37 +0000"  >&lt;blockquote&gt;&lt;p&gt;I would argue in this case that &quot;lum_&quot; is not the best prefix for this data structure&apos;s fields, and &quot;lmv_&quot; would be better, since &quot;lum_&quot; is easily confused with &quot;lov_user_md&quot;, while &quot;lmv_&quot; is reflecting &quot;Lustre Metadata Volume&quot;, LMV_USER_MAGIC, etc. Renaming the fields internally also avoids problems with changing the user-visible interface that has existed since 2.4.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Which is an API change, with all that implies.  I&apos;m not objecting, just pointing it out.&lt;/p&gt;

&lt;p&gt;That would get the command and the C API to match, but I still think it would be better still to not embed C variable names in the output of commands designed for human consumption.  They should use independent, descriptive terms rather than specific code implementation details.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;I do agree that we should revert the &quot;lfs getdirstripe &amp;lt;dir&amp;gt;&quot; to the non-recursive mode that existed since 2.5. I&apos;m not 100% sure whether that was new in 2.8, or if it existed since 2.7, but it is confusing enough that I don&apos;t think anyone depends on that behaviour.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Great!&lt;/p&gt;</comment>
                            <comment id="160123" author="morrone" created="Wed, 27 Jul 2016 18:43:32 +0000"  >&lt;p&gt;First patch under way is &lt;a href=&quot;http://review.whamcloud.com//21516&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;21516&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="161948" author="gerrit" created="Mon, 15 Aug 2016 21:12:37 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/21516/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/21516/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8314&quot; title=&quot;user interface of lfs getdirstripe needs reworking&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8314&quot;&gt;&lt;del&gt;LU-8314&lt;/del&gt;&lt;/a&gt; utils: revert lfs_getdirstripe to non-recursive mode&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 957df6f030e8c89b02b168776d237dbb6879073b&lt;/p&gt;</comment>
                            <comment id="161966" author="pjones" created="Mon, 15 Aug 2016 22:34:45 +0000"  >&lt;p&gt;Landed for 2.9. Other work in this area is best tracked under a follow on ticket&lt;/p&gt;</comment>
                            <comment id="161969" author="morrone" created="Mon, 15 Aug 2016 22:54:05 +0000"  >&lt;p&gt;Did you open that ticket?  95% of what was listed in the Description is unaddressed, so I&apos;m not clear why another one is needed, but go ahead and open a new one if that is your process.&lt;/p&gt;</comment>
                            <comment id="161972" author="pjones" created="Mon, 15 Aug 2016 23:10:52 +0000"  >&lt;p&gt;In that case I guess I will reopen and remove the fixversion&lt;/p&gt;</comment>
                            <comment id="168594" author="morrone" created="Thu, 6 Oct 2016 23:41:32 +0000"  >&lt;p&gt;When can we expect to see progress on this?&lt;/p&gt;</comment>
                            <comment id="177589" author="gerrit" created="Tue, 13 Dec 2016 16:04:30 +0000"  >&lt;p&gt;Lai Siyao (lai.siyao@intel.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/24319&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/24319&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8314&quot; title=&quot;user interface of lfs getdirstripe needs reworking&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8314&quot;&gt;&lt;del&gt;LU-8314&lt;/del&gt;&lt;/a&gt; lfs: improve getdirstripe interface&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: c7a0cb437281c4a1fadaba910b2df4477f3fa04d&lt;/p&gt;</comment>
                            <comment id="179282" author="gerrit" created="Sun, 1 Jan 2017 01:58:06 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/24319/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/24319/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8314&quot; title=&quot;user interface of lfs getdirstripe needs reworking&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8314&quot;&gt;&lt;del&gt;LU-8314&lt;/del&gt;&lt;/a&gt; lfs: improve getdirstripe interface&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 64c1297230288fda8d8f38d9e41b8e55c1373619&lt;/p&gt;</comment>
                            <comment id="179388" author="pjones" created="Tue, 3 Jan 2017 16:33:29 +0000"  >&lt;p&gt;Is there still more work to come being tracked under this ticket or can it now be marked as resolved?&lt;/p&gt;</comment>
                            <comment id="179420" author="adilger" created="Tue, 3 Jan 2017 19:01:04 +0000"  >&lt;p&gt;The recursion issue was fixed in 21516, and issues with &lt;tt&gt;-q&lt;/tt&gt; and &lt;tt&gt;-v&lt;/tt&gt; options were addressed in the 24319 patch.&lt;/p&gt;</comment>
                            <comment id="179421" author="pjones" created="Tue, 3 Jan 2017 19:05:15 +0000"  >&lt;p&gt;Landed for 2.10&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                        </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|hzyfan:</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>