<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:09:07 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-14366] &quot;lfs mkdir&quot; on existing directory returns &quot;Operation not supported/already in progress&quot;</title>
                <link>https://jira.whamcloud.com/browse/LU-14366</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Running &quot;[{lfs mkdir /path/to/existing/directory}}&quot; prints an error message &quot;&lt;tt&gt;Operation not permitted&lt;/tt&gt;&quot; (&lt;tt&gt;-EPERM&lt;/tt&gt;) for a directory that already exists, rather than the more expected &quot;&lt;tt&gt;File already exists&lt;/tt&gt;&quot; (&lt;tt&gt;-EEXIST&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;It turns out that this is because &quot;&lt;tt&gt;lfs mkdir&lt;/tt&gt;&quot; will now restriping a directory in the background, if it already exists, to match the new layout given by &quot;&lt;tt&gt;lfs mkdir&lt;/tt&gt;&quot;.  This fails with &quot;&lt;tt&gt;Operation not permitted&lt;/tt&gt;&quot; if &lt;tt&gt;mdt.&amp;#42;.enable_dir_restripe=0&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;If &quot;&lt;tt&gt;mdt.&amp;#42;.enable_dir_restripe=1&lt;/tt&gt;&quot; then the background restripe fails with &quot;&lt;tt&gt;Operation already in progress&lt;/tt&gt;&quot; (&lt;tt&gt;-EALREADY&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;I think it is confusing from a user perspective if &quot;&lt;tt&gt;lfs mkdir&lt;/tt&gt;&quot; is trying to migrate the directory when it already exists.  This is happening because &quot;&lt;tt&gt;lfs mkdir&lt;/tt&gt;&quot; is internally just an alias for &quot;&lt;tt&gt;lfs setdirstripe&lt;/tt&gt;&quot;, but I still think it is confusing, and wonder if we need to treat these commands slightly differently in this case (e.g. add a flag to &quot;&lt;tt&gt;lfs mkdir&lt;/tt&gt;&quot; to prevent it from doing the silent migration?  It should return &lt;tt&gt;-EEXIST&lt;/tt&gt; in that case.&lt;/p&gt;

&lt;p&gt;My understanding is that the difference between &quot;&lt;tt&gt;lfs setdirstripe&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;lfs migrate -m&lt;/tt&gt;&quot; is that &lt;tt&gt;setdirstripe&lt;/tt&gt; will only move the &lt;b&gt;entries&lt;/b&gt; to the new MDT(s), while &quot;&lt;tt&gt;migrate -m&lt;/tt&gt;&quot; will also move the &lt;b&gt;inodes&lt;/b&gt; to the new MDT(s)?  I definitely like the idea of being able to restripe a directory and only move the entries, but I wonder if the entry-only restripe would be more clear if it was an option for &quot;&lt;tt&gt;lfs migrate -m&lt;/tt&gt;&quot;?&lt;/p&gt;</description>
                <environment></environment>
        <key id="62484">LU-14366</key>
            <summary>&quot;lfs mkdir&quot; on existing directory returns &quot;Operation not supported/already in progress&quot;</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="laisiyao">Lai Siyao</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>dne3</label>
                    </labels>
                <created>Tue, 26 Jan 2021 08:28:42 +0000</created>
                <updated>Wed, 23 Feb 2022 19:30:52 +0000</updated>
                            <resolved>Thu, 15 Apr 2021 17:30:36 +0000</resolved>
                                    <version>Lustre 2.14.0</version>
                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="290362" author="laisiyao" created="Tue, 26 Jan 2021 11:21:46 +0000"  >&lt;p&gt;I&apos;ll add a flag for this later.&lt;/p&gt;

&lt;p&gt;The main difference between &apos;lfs setdirstripe&apos; and &apos;lfs migrate -m&apos; is: for directory restripe, the existing master object and shards will be kept(If it&apos;s a plain directory, the original directory object will become the first shard), while &apos;lfs migrate -m&apos; will always create new master object and shards.&lt;/p&gt;

&lt;p&gt;Once &quot;mdt.*.dir_restripe_nsonly&quot; is set to &quot;0&quot;, directory restripe will move inodes too.&lt;/p&gt;</comment>
                            <comment id="298837" author="gerrit" created="Thu, 15 Apr 2021 06:30:30 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/41329/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41329/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14366&quot; title=&quot;&amp;quot;lfs mkdir&amp;quot; on existing directory returns &amp;quot;Operation not supported/already in progress&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14366&quot;&gt;&lt;del&gt;LU-14366&lt;/del&gt;&lt;/a&gt; mdt: lfs mkdir should return -EEXIST if exists&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 65e3e4050ec5bb371c1c343fca49a605286a086e&lt;/p&gt;</comment>
                            <comment id="298911" author="pjones" created="Thu, 15 Apr 2021 17:30:36 +0000"  >&lt;p&gt;Landed for 2.15&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="61979">LU-14210</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="68830">LU-15589</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="65865">LU-14975</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|i01k6v:</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>