<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:26:44 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-16405] regression in create that may cause directory entries with the same name</title>
                <link>https://jira.whamcloud.com/browse/LU-16405</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10235&quot; title=&quot;mkdir should check for directory existence on client before taking write lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10235&quot;&gt;&lt;del&gt;LU-10235&lt;/del&gt;&lt;/a&gt;, name lookup is moved before parent locking to avoid unnecessary lock revoke, and it&apos;s believed that backend filesystem will check name before entry insert, but some test shows this is not always true.&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;# ls -lisad pan_*
162139365236040503 4 lrwxrwxrwx 1 rdx rd   65 Dec  8 01:51 pan_000 -&amp;gt; /ec/fws5/sb/work/rd/cxsj/hvxz/MMSF/2017050100/longrange/an_centre
162139357216535883 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_001
162139341278207222 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_002
162139365689006218 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_003
162139362014851225 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_004
162139364397192377 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_005
162139362031645470 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_006
162139361696099316 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_007
162139361343777112 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_008
162139353626266212 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_009
162139350539298147 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_010
162139350539298147 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_010   ## Here 
162139362769806682 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_011
162139353609530857 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_012
162139356226776195 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_013
162139346428878656 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_014
162139361343777140 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_015
162139366141987047 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_016
162139358508461812 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_017
162139353072661755 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_018
162139353072661755 4 drwxr-x--- 2 rdx rd 4096 Dec  8 01:51 pan_018 ## and there
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem is hit with single-block directories, so is not related to htree split or similar:&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;#&amp;gt; debugfs -c /dev/mapper/vg_mdt0003_f02-mdt0003
debugfs 1.46.2.wc3 (18-Jun-2021)
/dev/mapper/vg_mdt0003_f02-mdt0003: catastrophic mode - not reading inode or group bitmaps
debugfs:  cd REMOTE_PARENT_DIR/0x240007130:0x1:0x0/work/2017050100/longrange
debugfs: ls
[...snip]
 1032403872  (44) psuhvxz14.noSnow    1032403874  (1020) psuhvxz14
 1038197629  (36) pan_004    1032401372  (48) __ICMGG3.noSnow.tmp
 1039177323  (36) pan_010    1039222784  (36) pan_010
 1032971017  (48) targethvxz20170501002    1032401160  (36) pert_001
[...]
debugfs:  stat &amp;lt;1039177323&amp;gt;
Inode: 1039177323   Type: directory    Mode:  0750   Flags: 0x20000000
Generation: 3276743085    Version: 0x0000002f:d1139426
User:   388   Group:  1100   Project:    13   Size: 4096
File ACL: 0
Links: 2   Blockcount: 8
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x63914328:4490c0f0 -- Thu Dec  8 01:51:36 2022
 atime: 0x63988ad8:00000000 -- Tue Dec 13 14:23:20 2022
 mtime: 0x63914328:4490c0f0 -- Thu Dec  8 01:51:36 2022
crtime: 0x63914328:4490c0f0 -- Thu Dec  8 01:51:36 2022
Size of extra inode fields: 32
Extended attributes:
  lma: fid=[0x24008e159:0x1e563:0x0] compat=0 incompat=0
  linkea: idx=0 parent=[0x24008e347:0x14e34:0x0] name=&apos;pan_010&apos;
BLOCKS:
(0):649617594
TOTAL: 1

debugfs:  stat &amp;lt;1039222784&amp;gt;
Inode: 1039222784   Type: directory    Mode:  0750   Flags: 0x20000000
Generation: 3276743100    Version: 0x0000002f:d1139472
User:   388   Group:  1100   Project:    13   Size: 4096
File ACL: 0
Links: 2   Blockcount: 8
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x6391432b:00000000 -- Thu Dec  8 01:51:39 2022
 atime: 0x63914328:450ad5a4 -- Thu Dec  8 01:51:36 2022
 mtime: 0x6391432b:00000000 -- Thu Dec  8 01:51:39 2022
crtime: 0x63914328:450ad5a4 -- Thu Dec  8 01:51:36 2022
Size of extra inode fields: 32
Extended attributes:
  lma: fid=[0x24008e422:0x1fcab:0x0] compat=0 incompat=0
  linkea: idx=0 parent=[0x24008e347:0x14e34:0x0] name=&apos;pan_010&apos;
debugfs:  ls &amp;lt;1039177323&amp;gt;
 1039177323  (12) .    1032400653  (4084) ..
debugfs:  ls &amp;lt;1039222784&amp;gt;
 1039222784  (12) .    1032400653  (28) ..    1039271133  (40) ICMSHhvxzINIT
 1039279349  (40) ICMGGhvxzINIT    1039281023  (3976) ggml199

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="73647">LU-16405</key>
            <summary>regression in create that may cause directory entries with the same name</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="bzzz">Alex Zhuravlev</assignee>
                                    <reporter username="laisiyao">Lai Siyao</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Dec 2022 09:24:55 +0000</created>
                <updated>Mon, 28 Aug 2023 16:17:04 +0000</updated>
                            <resolved>Thu, 27 Jul 2023 12:29:35 +0000</resolved>
                                                    <fixVersion>Lustre 2.16.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                            <comments>
                            <comment id="356541" author="bzzz" created="Thu, 15 Dec 2022 12:35:35 +0000"  >&lt;p&gt;looks quite strange.. ext4_find_dest_de() checks full block for duplicates. a hole in pdirops locking? is it specific to some kernel?&lt;/p&gt;</comment>
                            <comment id="356575" author="adilger" created="Thu, 15 Dec 2022 17:56:31 +0000"  >&lt;p&gt;Alex, would be el7.9 kernel. &lt;/p&gt;</comment>
                            <comment id="363614" author="spiechurski" created="Tue, 21 Feb 2023 18:00:29 +0000"  >&lt;p&gt;Is there a smarter way to avoid this than reverting &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10235&quot; title=&quot;mkdir should check for directory existence on client before taking write lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10235&quot;&gt;&lt;del&gt;LU-10235&lt;/del&gt;&lt;/a&gt; ?&lt;/p&gt;</comment>
                            <comment id="363684" author="laisiyao" created="Wed, 22 Feb 2023 01:19:37 +0000"  >&lt;p&gt;It&apos;s not proved yet, we tried to reproduce and capture debug log, but couldn&apos;t reproduce.&lt;/p&gt;</comment>
                            <comment id="363909" author="spiechurski" created="Thu, 23 Feb 2023 17:05:25 +0000"  >&lt;p&gt;It is reverted on the client used on customer&apos;s production for last 1 month and a half.&lt;/p&gt;

&lt;p&gt;I am currently waiting for confirmation that the problem was not seen since then.&lt;/p&gt;

&lt;p&gt;I will report here when I get confirmation.&lt;/p&gt;

&lt;p&gt;If this was proved to be the reason, would there be a better way than reverting ?&lt;/p&gt;</comment>
                            <comment id="363975" author="adilger" created="Thu, 23 Feb 2023 22:45:19 +0000"  >&lt;p&gt;Looking at the original &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10235&quot; title=&quot;mkdir should check for directory existence on client before taking write lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10235&quot;&gt;&lt;del&gt;LU-10235&lt;/del&gt;&lt;/a&gt; patch, it seems possible to add some lightweight check &lt;b&gt;after&lt;/b&gt; the parent is locked (if no entry was found during the unlocked lookup) to determine if the directory was modified between the time the lookup was done and when it was locked.   We don&apos;t want to reintroduce the overhead of reverting the whole patch, or worse &lt;b&gt;always&lt;/b&gt; do two lookups and make the code slower than it was before. &lt;/p&gt;

&lt;p&gt;In the use case addressed by the &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10235&quot; title=&quot;mkdir should check for directory existence on client before taking write lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10235&quot;&gt;&lt;del&gt;LU-10235&lt;/del&gt;&lt;/a&gt; patch (many threads opening the same file) this should not add any overhead, but in the concurrent directory modification case it would decide if another lookup was needed with the lock held.  It &lt;em&gt;might&lt;/em&gt; be possible to take and drop the object lock before the parent lock, and then determine if the object lock was cancelled (i.e. conflicting operation) to force another lookup under the lock.&lt;/p&gt;</comment>
                            <comment id="365067" author="laisiyao" created="Tue, 7 Mar 2023 14:01:13 +0000"  >&lt;p&gt;But directory time is not accurate enough to know whether parent was changed, because create only modifies parent directory time to seconds.&lt;/p&gt;</comment>
                            <comment id="365069" author="adilger" created="Tue, 7 Mar 2023 14:51:37 +0000"  >&lt;p&gt;I wasn&apos;t thinking of using ctime (unless it changes to use nanoseconds?), but rather the directory version (either i_version or another in-memory version counter).&lt;/p&gt;</comment>
                            <comment id="365466" author="bzzz" created="Fri, 10 Mar 2023 07:20:46 +0000"  >&lt;p&gt;iirc, htree locks specific block to add a new direntry? I&apos;d try to reproduce this with a change to ldiskfs_find_dest_de() searching through a whole block for the given name.&lt;/p&gt;</comment>
                            <comment id="368167" author="gerrit" created="Mon, 3 Apr 2023 10:40:43 +0000"  >&lt;p&gt;&quot;Alex Zhuravlev &amp;lt;bzzz@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/50505&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/50505&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16405&quot; title=&quot;regression in create that may cause directory entries with the same name&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16405&quot;&gt;&lt;del&gt;LU-16405&lt;/del&gt;&lt;/a&gt; tests: a reproducer&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: db199a9398cb6b773ccd58505eb7ca7d43053f8b&lt;/p&gt;</comment>
                            <comment id="368330" author="gerrit" created="Tue, 4 Apr 2023 08:02:44 +0000"  >&lt;p&gt;&quot;Alex Zhuravlev &amp;lt;bzzz@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/50521&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/50521&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16405&quot; title=&quot;regression in create that may cause directory entries with the same name&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16405&quot;&gt;&lt;del&gt;LU-16405&lt;/del&gt;&lt;/a&gt; osd: lookup cache&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a3d94d8abfb8c0d9320687be578073d3e3387fa6&lt;/p&gt;</comment>
                            <comment id="380300" author="gerrit" created="Thu, 27 Jul 2023 07:17:58 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/50521/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/50521/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16405&quot; title=&quot;regression in create that may cause directory entries with the same name&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16405&quot;&gt;&lt;del&gt;LU-16405&lt;/del&gt;&lt;/a&gt; osd: lookup cache&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 29f8eb2a67ba2806d91d93de1e82e05a63f76382&lt;/p&gt;</comment>
                            <comment id="380347" author="pjones" created="Thu, 27 Jul 2023 12:29:35 +0000"  >&lt;p&gt;Fix landed for 2.16&lt;/p&gt;</comment>
                            <comment id="380671" author="bzzz" created="Mon, 31 Jul 2023 09:27:30 +0000"  >&lt;blockquote&gt;&lt;p&gt;the patch(#50521) uses function obj_name2lu_name which was added in patch(&lt;a href=&quot;https://review.whamcloud.com/#/c/fs/lustre-release/+/43390/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/fs/lustre-release/+/43390/&lt;/a&gt;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;yes, that&apos;s to support filesystem encryption. if we don&apos;t need to support encryption in this version, then we don&apos;t need to call obd_name2lu_name() and can use the passed key directly. feel free to ask if you have more questions.&lt;/p&gt;</comment>
                            <comment id="380679" author="bzzz" created="Mon, 31 Jul 2023 11:04:03 +0000"  >&lt;blockquote&gt;&lt;p&gt; can you please port the patch to b_es5_2 please?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;sure, will do&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="49291">LU-10235</issuekey>
        </issuelink>
                            </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|i0382v:</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>