<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:48:56 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-12017] Truncate vs setxattr deadlock with DoM</title>
                <link>https://jira.whamcloud.com/browse/LU-12017</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;setxattr takes inode lock and sends reint to MDS.&lt;br/&gt;
truncate takes MDS_INODELOCK_DOM lock and&#160; wants to acquire inode lock.&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;PID: 14942 TASK: ffff88007659cf10 CPU: 3 COMMAND: &quot;truncate&quot;
 #0 [ffff88011f397af8] __schedule at ffffffff816b3de4
 #1 [ffff88011f397b88] schedule_preempt_disabled at ffffffff816b5329
 #2 [ffff88011f397b98] __mutex_lock_slowpath at ffffffff816b30d7
 #3 [ffff88011f397bf0] mutex_lock at ffffffff816b24bf
 #4 [ffff88011f397c08] vvp_io_setattr_start at ffffffffc118993d [lustre]
 #5 [ffff88011f397c40] cl_io_start at ffffffffc06e7a25 [obdclass]
 #6 [ffff88011f397c68] cl_io_loop at ffffffffc06e9e01 [obdclass]
 #7 [ffff88011f397cd8] cl_setattr_ost at ffffffffc11847ef [lustre]
 #8 [ffff88011f397d28] ll_setattr_raw at ffffffffc11614d8 [lustre]
 #9 [ffff88011f397df0] ll_setattr at ffffffffc11617d3 [lustre]
#10 [ffff88011f397e00] notify_change at ffffffff81223bc4
#11 [ffff88011f397e48] do_truncate at ffffffff81203445
#12 [ffff88011f397ec0] vfs_truncate at ffffffff8120361c
#13 [ffff88011f397ef8] do_sys_truncate at ffffffff8120370c
#14 [ffff88011f397f40] sys_truncate at ffffffff812038de
&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;PID: 15194 TASK: ffff880077f18000 CPU: 1 COMMAND: &quot;setfattr&quot;
 #0 [ffff88011d33b8b8] __schedule at ffffffff816b3de4
 #1 [ffff88011d33b948] schedule at ffffffff816b4409
 #2 [ffff88011d33b958] schedule_timeout at ffffffff816b1ca4
 #3 [ffff88011d33ba00] ptlrpc_set_wait at ffffffffc09070a0 [ptlrpc]
 #4 [ffff88011d33baf0] ptlrpc_queue_wait at ffffffffc09074e3 [ptlrpc]
 #5 [ffff88011d33bb10] mdc_xattr_common at ffffffffc0b52186 [mdc]
 #6 [ffff88011d33bb90] mdc_setxattr at ffffffffc0b522de [mdc]
 #7 [ffff88011d33bbd0] lmv_setxattr at ffffffffc0872524 [lmv]
 #8 [ffff88011d33bc48] ll_xattr_set_common at ffffffffc1175b54 [lustre]
 #9 [ffff88011d33bcc8] ll_xattr_set_common_3_11 at ffffffffc11769ab [lustre]
#10 [ffff88011d33bcd8] generic_setxattr at ffffffff8122c2d8
#11 [ffff88011d33bd10] __vfs_setxattr_noperm at ffffffff8122cb45
#12 [ffff88011d33bd58] vfs_setxattr at ffffffff8122cd45
#13 [ffff88011d33bd98] setxattr at ffffffff8122ce7e
#14 [ffff88011d33bef0] sys_setxattr at ffffffff8122d177
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;MDS locks are for different bits&#160;MDS_INODELOCK_UPDATE|MDS_INODELOCK_XATTR vs&lt;br/&gt;
MDS_INODELOCK_DOM but they blocks each other if some blocking lock was present earlier because Lustre tries to grant only first lock in the waiting list.&lt;/p&gt;</description>
                <environment></environment>
        <key id="54989">LU-12017</key>
            <summary>Truncate vs setxattr deadlock with DoM</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="tappro">Mikhail Pershin</assignee>
                                    <reporter username="askulysh">Andriy Skulysh</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Mon, 25 Feb 2019 20:33:45 +0000</created>
                <updated>Wed, 29 Apr 2020 05:38:12 +0000</updated>
                            <resolved>Tue, 27 Aug 2019 02:55:57 +0000</resolved>
                                                    <fixVersion>Lustre 2.13.0</fixVersion>
                    <fixVersion>Lustre 2.12.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="242739" author="askulysh" created="Mon, 25 Feb 2019 20:35:47 +0000"  >&lt;p&gt;I suppose the easiest way to resolve the deadlock is to add a separate lock type for DoM lock.&lt;/p&gt;</comment>
                            <comment id="243136" author="tappro" created="Fri, 1 Mar 2019 06:51:40 +0000"  >&lt;p&gt;are you able to reproduce this behavior? There is &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11285&quot; title=&quot;don&amp;#39;t stop on the first blocked lock in ldlm_reprocess_queue()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11285&quot;&gt;&lt;del&gt;LU-11285&lt;/del&gt;&lt;/a&gt; which should help&lt;/p&gt;</comment>
                            <comment id="246975" author="askulysh" created="Fri, 10 May 2019 14:59:28 +0000"  >&lt;p&gt;I can confirm that &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11285&quot; title=&quot;don&amp;#39;t stop on the first blocked lock in ldlm_reprocess_queue()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11285&quot;&gt;&lt;del&gt;LU-11285&lt;/del&gt;&lt;/a&gt; helps with my reproducer&lt;/p&gt;</comment>
                            <comment id="246978" author="pfarrell" created="Fri, 10 May 2019 15:18:49 +0000"  >&lt;p&gt;Are you able to share your reproducer, maybe as a testcase?&lt;/p&gt;</comment>
                            <comment id="247025" author="tappro" created="Sat, 11 May 2019 10:37:55 +0000"  >&lt;p&gt;I don&apos;t see how deadlock happens there, if truncate and setxattr are not dependent than other third lock can&apos;t cause deadlock because it will be granted at some moment and let waiting queue go further. The only case when it cause deadlock is when truncate and setxattr are dependent somehow so one is needed other to be granted. So I also wonder about reproduces to investigate this case more closely.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11285&quot; title=&quot;don&amp;#39;t stop on the first blocked lock in ldlm_reprocess_queue()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11285&quot;&gt;&lt;del&gt;LU-11285&lt;/del&gt;&lt;/a&gt; was made for other reasons, DOM lock as IO lock can be held for significant time and any other DOM lock in waiting queue might block all MD locks in that queue with no reasons. So this is sort of optimization when locks with non-crossing bits are not blocking each other. Strictly speaking that is not deadlock but lock timeout case, increasing lock timeout resolves that which is not possible with real deadlock. So &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11285&quot; title=&quot;don&amp;#39;t stop on the first blocked lock in ldlm_reprocess_queue()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11285&quot;&gt;&lt;del&gt;LU-11285&lt;/del&gt;&lt;/a&gt; is not deadlock resolver, thought may help with some deadlocks, but right way it to fix the source of deadlock.&lt;/p&gt;</comment>
                            <comment id="247051" author="shadow" created="Mon, 13 May 2019 08:39:12 +0000"  >&lt;p&gt;This deadlock caused because CLIO code takes a i_mutex lock after DoM lock is obtained.&lt;br/&gt;
Fixing client side - solve this issue completely without ldlm code changes.&lt;/p&gt;</comment>
                            <comment id="247052" author="tappro" created="Mon, 13 May 2019 08:59:25 +0000"  >&lt;p&gt;Exactly, that is what I&apos;ve meant, solving that at client side is the right thing. Alexey, could you give particular function name where that is happening?&lt;/p&gt;</comment>
                            <comment id="247054" author="shadow" created="Mon, 13 May 2019 09:04:06 +0000"  >&lt;p&gt;ll_setattr_raw - release a i_mutex to take it later.&lt;/p&gt;

&lt;p&gt;test patch (passed sanity / sanity-dom), including Andriy test for this paticual deadlock.&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;
diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
index 1839163936..d33d02519e 100644
--- a/lustre/llite/llite_lib.c
+++ b/lustre/llite/llite_lib.c
@@ -1566,11 +1566,11 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data)
        /* inode size will be in ll_setattr_ost, can&apos;t &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; it now since dirty
         * cache is not cleared yet. */
        op_data-&amp;gt;op_attr.ia_valid &amp;amp;= ~(TIMES_SET_FLAGS | ATTR_SIZE);
-       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode))
-               inode_lock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//     &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode))
&lt;/span&gt;+&lt;span class=&quot;code-comment&quot;&gt;//             inode_lock(inode);
&lt;/span&gt;        rc = simple_setattr(dentry, &amp;amp;op_data-&amp;gt;op_attr);
-       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode))
-               inode_unlock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//     &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode))
&lt;/span&gt;+&lt;span class=&quot;code-comment&quot;&gt;//             inode_unlock(inode);
&lt;/span&gt;        op_data-&amp;gt;op_attr.ia_valid = ia_valid;

        rc = ll_update_inode(inode, &amp;amp;md);
@@ -1657,11 +1657,11 @@ &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; ll_setattr_raw(struct dentry *dentry, struct iattr *attr,
                        LTIME_S(attr-&amp;gt;ia_mtime), LTIME_S(attr-&amp;gt;ia_ctime),
                       (s64)ktime_get_real_seconds());

-       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode)) {
-               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (attr-&amp;gt;ia_valid &amp;amp; ATTR_SIZE)
-                       inode_dio_write_done(inode);
-               inode_unlock(inode);
-       }
+&lt;span class=&quot;code-comment&quot;&gt;//     &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode)) {
&lt;/span&gt;+&lt;span class=&quot;code-comment&quot;&gt;//             &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (attr-&amp;gt;ia_valid &amp;amp; ATTR_SIZE)
&lt;/span&gt;+&lt;span class=&quot;code-comment&quot;&gt;//                     inode_dio_write_done(inode);
&lt;/span&gt;+&lt;span class=&quot;code-comment&quot;&gt;//             inode_unlock(inode);
&lt;/span&gt;+&lt;span class=&quot;code-comment&quot;&gt;//     }
&lt;/span&gt;
        /* We always &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; an MDS RPC, even &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we&apos;re only changing the size;
         * only the MDS knows whether truncate() should fail with -ETXTBUSY */
@@ -1746,7 +1746,7 @@ out:
                ll_finish_md_op_data(op_data);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISREG(inode-&amp;gt;i_mode)) {
-               inode_lock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//             inode_lock(inode);
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ((attr-&amp;gt;ia_valid &amp;amp; ATTR_SIZE) &amp;amp;&amp;amp; !hsm_import)
                        inode_dio_wait(inode);
                /* Once we&lt;span class=&quot;code-quote&quot;&gt;&apos;ve got the i_mutex, it&apos;&lt;/span&gt;s safe to set the S_NOSEC
diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c
index ac2cd0ea20..f9cbf6a9cc 100644
--- a/lustre/llite/vvp_io.c
+++ b/lustre/llite/vvp_io.c
@@ -712,10 +712,10 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; vvp_io_setattr_start(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env,

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cl_io_is_trunc(io)) {
                down_write(&amp;amp;lli-&amp;gt;lli_trunc_sem);
-               inode_lock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//             inode_lock(inode);
&lt;/span&gt;                inode_dio_wait(inode);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
-               inode_lock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//             inode_lock(inode);
&lt;/span&gt;        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (io-&amp;gt;u.ci_setattr.sa_avalid &amp;amp; TIMES_SET_FLAGS)
@@ -736,10 +736,10 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; void vvp_io_setattr_end(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env,
                 * because osc has already notified to destroy osc_extents. */
                vvp_do_vmtruncate(inode, io-&amp;gt;u.ci_setattr.sa_attr.lvb_size);
                inode_dio_write_done(inode);
-               inode_unlock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//             inode_unlock(inode);
&lt;/span&gt;                up_write(&amp;amp;lli-&amp;gt;lli_trunc_sem);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
-               inode_unlock(inode);
+&lt;span class=&quot;code-comment&quot;&gt;//             inode_unlock(inode);
&lt;/span&gt;        }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="247055" author="shadow" created="Mon, 13 May 2019 09:11:34 +0000"  >&lt;p&gt;as about deadlock scenario it&apos;s deadlock via client side.&lt;br/&gt;
truncate releases an i_mutex in ll_setattr_raw and start to take DoM lock, setxattr remove a parent lookup lock, so open start from lookup step but MDT have DOM always open option set, so open have conflict with DoM lock but i_mutex was held. Setattr have a DoM lock and start to take i_mutex..&lt;br/&gt;
It looks setxattr have posibility to have deadlock with truncate itself, but he should don&apos;t conflict with DoM lock (I don&apos;t check it really).&lt;/p&gt;

&lt;p&gt;OOPS. Deadlock.&lt;/p&gt;</comment>
                            <comment id="247076" author="tappro" created="Mon, 13 May 2019 18:27:29 +0000"  >&lt;p&gt;I wonder why inode lock was released and taken back later in vvp_io_setattr_start(). Probably that was also intended to resolve other lock conflicts. Anyway, thanks for analysis, if it is possible, please attach test for that particular deadlock, so I will be able to use it for testing too&lt;/p&gt;</comment>
                            <comment id="247081" author="tappro" created="Mon, 13 May 2019 19:19:07 +0000"  >&lt;p&gt;Ah, that is because of lli_trunc_sem/i_mutex lock ordering, &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7927&quot; title=&quot;Deadlock between ll_setattr() and ll_file_write()-&amp;gt;ll_fsync()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7927&quot;&gt;&lt;del&gt;LU-7927&lt;/del&gt;&lt;/a&gt;, commit 5d60fd75152d10&lt;br/&gt;
Well there are things to think about&lt;/p&gt;</comment>
                            <comment id="247082" author="shadow" created="Mon, 13 May 2019 19:46:19 +0000"  >&lt;p&gt;No. it&apos;s not &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7927&quot; title=&quot;Deadlock between ll_setattr() and ll_file_write()-&amp;gt;ll_fsync()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7927&quot;&gt;&lt;del&gt;LU-7927&lt;/del&gt;&lt;/a&gt;. inode_lock was exist before it. This ticket was changed a place, but not add locking where.&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;
-       inode_lock(inode);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cl_io_is_trunc(io)) {
                down_write(&amp;amp;lli-&amp;gt;lli_trunc_sem);
+               inode_lock(inode);
                inode_dio_wait(inode);
+       } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
+               inode_lock(inode);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                            <comment id="248355" author="gerrit" created="Tue, 4 Jun 2019 11:46:28 +0000"  >&lt;p&gt;Andriy Skulysh (c17819@cray.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35057&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35057&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12017&quot; title=&quot;Truncate vs setxattr deadlock with DoM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12017&quot;&gt;&lt;del&gt;LU-12017&lt;/del&gt;&lt;/a&gt; test: DoM truncate deadlock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 2f0a4e2a2073fa4c0fced7f1e155ff7b4372298a&lt;/p&gt;</comment>
                            <comment id="248487" author="askulysh" created="Wed, 5 Jun 2019 21:21:11 +0000"  >&lt;p&gt;Similar deadlock (getattr vs rename) is triggered :&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;granted lock:
     &amp;lt;struct ldlm_lock 0xffff88007905eb40&amp;gt;
     0x73f93784e720791e  [0x200000402:0x14c8:0x0] pid 20988
     MDS_INODELOCK_LOOKUP|MDS_INODELOCK_UPDATE
waiting locks:
     &amp;lt;struct ldlm_lock 0xffff8801243d8000&amp;gt;
     0x73f93784e72079b1 [0x200000402:0x14c8:0x0] pid 10035
     MDS_INODELOCK_LOOKUP|MDS_INODELOCK_UPDATE|MDS_INODELOCK_PERM
 
     &amp;lt;struct ldlm_lock 0xffff880090f23440&amp;gt;
     0x73f93784e72079f0 [0x200000402:0x14c8:0x0] pid 20988
     MDS_INODELOCK_DOM
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="249112" author="askulysh" created="Wed, 12 Jun 2019 11:11:06 +0000"  >&lt;p&gt;lock 0xffff88007905eb40 is for&#160;mnew in&#160;mdt_reint_rename()&lt;br/&gt;
 lock 0xffff880090f23440 is requested by same thread mdt_reint_rename()-&amp;gt;mdt_dom_discard_data()&lt;br/&gt;
so DOM lock can&apos;t be&#160; granted and&#160;mnew lock can&apos;t be unlocked as we need to send the reply&lt;/p&gt;</comment>
                            <comment id="249113" author="tappro" created="Wed, 12 Jun 2019 11:57:07 +0000"  >&lt;p&gt;Andriy, currently the mdt_dom_discard_data() doesn&apos;t wait for lock to be granted, that sort of deadlock should be fixed already by &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11359&quot; title=&quot;racer test 1 times out with client hung in dir_create.sh, ls, &#8230; and MDS in ldlm_completion_ast()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11359&quot;&gt;&lt;del&gt;LU-11359&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="252200" author="spitzcor" created="Mon, 29 Jul 2019 19:46:33 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=pjones&quot; class=&quot;user-hover&quot; rel=&quot;pjones&quot;&gt;pjones&lt;/a&gt;, can we target this for 2.13.0?&lt;/p&gt;</comment>
                            <comment id="252787" author="spitzcor" created="Thu, 8 Aug 2019 21:07:49 +0000"  >&lt;p&gt;I&apos;ve added L2.13 to the Fix Version.&lt;/p&gt;</comment>
                            <comment id="253648" author="gerrit" created="Tue, 27 Aug 2019 02:21:18 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35057/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35057/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12017&quot; title=&quot;Truncate vs setxattr deadlock with DoM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12017&quot;&gt;&lt;del&gt;LU-12017&lt;/del&gt;&lt;/a&gt; ldlm: DoM truncate deadlock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 2250e072c37855d611aa64027945981fe2c8f4d7&lt;/p&gt;</comment>
                            <comment id="253659" author="pjones" created="Tue, 27 Aug 2019 02:55:57 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="253699" author="gerrit" created="Tue, 27 Aug 2019 17:09:32 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/35937&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35937&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12017&quot; title=&quot;Truncate vs setxattr deadlock with DoM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12017&quot;&gt;&lt;del&gt;LU-12017&lt;/del&gt;&lt;/a&gt; ldlm: DoM truncate deadlock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 3f8d06297971efbf773df70c97edb1a7f96a34ad&lt;/p&gt;</comment>
                            <comment id="253969" author="tappro" created="Sat, 31 Aug 2019 04:43:36 +0000"  >&lt;p&gt;The problem is not fixed fully, patch helps to avoid some situations with deadlock when IBITS of conflicting locks don&apos;t intersect but deadlock still exists and may happen in future when other IBITS combination will occur. The reason of deadlock on client side is not yet fixed.&lt;/p&gt;

&lt;p&gt;I&apos;d like to keep this ticket opened with lowered severity and priority or create new ticket with link to this one to fix the reason of deadlock on client side&lt;/p&gt;</comment>
                            <comment id="253976" author="pjones" created="Sat, 31 Aug 2019 14:57:33 +0000"  >&lt;p&gt;As long as there is &lt;em&gt;some&lt;/em&gt; value to landing the original patch I would suggest moving remaining work to a distinct ticket.&lt;/p&gt;</comment>
                            <comment id="254589" author="gerrit" created="Thu, 12 Sep 2019 03:51:38 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/35937/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/35937/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12017&quot; title=&quot;Truncate vs setxattr deadlock with DoM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12017&quot;&gt;&lt;del&gt;LU-12017&lt;/del&gt;&lt;/a&gt; ldlm: DoM truncate deadlock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 671ece3104edd3342838e2c0eda350e72219dc97&lt;/p&gt;</comment>
                            <comment id="266947" author="tappro" created="Mon, 6 Apr 2020 18:44:52 +0000"  >&lt;p&gt;Short update for everyone interested. After discussion with Vitaly Fertman there is conclusion about possibility of new deadlocks due to reverse locking for &lt;tt&gt;i_mutex&lt;/tt&gt; and &lt;tt&gt;DOM&lt;/tt&gt; LDLM lock in truncate path. That still can cause deadlocks in generic case like the following:&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;
th1: setattr took DOM lock, going to take inode lock
th2: wants some lock with DOM|XXX and stuck waiting the th1&apos;s DOM lock
th3: already have inode lock, enqueue some XXX bits and waits these bits on th2 waiting lock.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Due to reverse order of taking inode lock and ldlm lock in th1 and th3, any th2 with DOM and XXX bits which are common with th3 bits can cause deadlock. Ideally that should be resolved by changing truncate for proper lock order, though that can be non-trivial. Until that we can just avoid combining DOM bit with other if they cannot be granted immediately. In most cases it is already so, the only exception is OPEN path, &lt;tt&gt;mdt_object_open_lock()&lt;/tt&gt; particularly. In case of similar deadlocks it can be switched to &apos;trybits&apos; mode, by setting &lt;tt&gt;mdt.*.dom_lock=trylock&lt;/tt&gt; parameter&lt;/p&gt;</comment>
                            <comment id="266997" author="shadow" created="Tue, 7 Apr 2020 05:34:48 +0000"  >&lt;p&gt;Mike,&lt;/p&gt;

&lt;p&gt;i_mutex is useless for truncate case now. IO path uses an unlocked version with range lock for long time, truncate vs IO protected by separate mutex.&lt;/p&gt;
</comment>
                            <comment id="268548" author="spitzcor" created="Sat, 25 Apr 2020 12:28:48 +0000"  >&lt;p&gt;This &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12017?focusedCommentId=266947&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-266947&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;comment&lt;/a&gt; relates to &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13467&quot; title=&quot; truncate deadlock with DoM files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13467&quot;&gt;&lt;del&gt;LU-13467&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="58834">LU-13467</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="53122">LU-11285</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="58784">LU-13456</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|i00ca7:</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>