<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:58:37 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-13128] a race between glimpse and lock cancel is not handled correctly</title>
                <link>https://jira.whamcloud.com/browse/LU-13128</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;A customer reported their applications see zero files size for a file just written by another client.&lt;/p&gt;

&lt;p&gt;test details are : one client app (bash script) prepares temporary files for further stat &amp;amp; read and by other applications (bash scripts), each of the temp files is read by many computing threads and one or two fail to get correct file size.&lt;/p&gt;

&lt;p&gt;the issue was rootcaused as a race between glimpse and lock cancel, so glimpse fails to get file attrs from client, but the ost object is not wrtten yet to OST, so server can&apos;t fetch correct file (ost object) size from disk.&lt;/p&gt;

&lt;p&gt;The problems can be illustrated by the following reproducer:&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/include/obd_support.h b/lustre/include/obd_support.h
index a728bef..7d19efc 100644
--- a/lustre/include/obd_support.h
+++ b/lustre/include/obd_support.h
@@ -416,6 +416,7 @@ extern &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; obd_jobid_var[];
 #define OBD_FAIL_OSC_CONNECT_GRANT_PARAM 0x413
 #define OBD_FAIL_OSC_DELAY_IO            0x414
 #define OBD_FAIL_OSC_NO_SIZE_DATA        0x415
+#define OBD_FAIL_OSC_DELAY_CANCEL        0x416
 
 #define OBD_FAIL_PTLRPC                  0x500
 #define OBD_FAIL_PTLRPC_ACK              0x501
diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c
index 85ab132..e1c1f1a 100644
--- a/lustre/osc/osc_lock.c
+++ b/lustre/osc/osc_lock.c
@@ -430,6 +430,8 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; osc_dlm_blocking_ast0(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env,
 
        unlock_res_and_lock(dlmlock);
 
+       OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_CANCEL, 5);
+
        /* &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; l_ast_data is NULL, the dlmlock was enqueued by AGL or
         * the object has been destroyed. */
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (obj != NULL) {
diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh
index db37781..649e172 100755
--- a/lustre/tests/sanityn.sh
+++ b/lustre/tests/sanityn.sh
@@ -4875,6 +4875,17 @@ test_104() {
 }
 run_test 104 &lt;span class=&quot;code-quote&quot;&gt;&quot;Verify that MDS stores atime/mtime/ctime during close&quot;&lt;/span&gt;
 
+test_105() {
+       test_mkdir -p $DIR/$tdir
+       echo test &amp;gt; $DIR/$tdir/$tfile
+       $LCTL set_param fail_loc=0x416
+       cancel_lru_locks osc &amp;amp; sleep 1
+       stat $DIR2/$tdir/$tfile
+       wait
+       stat $DIR2/$tdir/$tfile
+}
+run_test 105 &lt;span class=&quot;code-quote&quot;&gt;&quot;Test size correctness&quot;&lt;/span&gt;
+
 log &lt;span class=&quot;code-quote&quot;&gt;&quot;cleanup: ======================================================&quot;&lt;/span&gt;
 
 # kill and wait in each test only guarentee script finish, but command in script
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;test 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;...
== sanityn test 105: Test size correctness =========================================================== 13:42:25 (1578912145)
striped dir -i1 -c2 /mnt/lustre/d105.sanityn
fail_loc=0x416
  File: &apos;/mnt/lustre2/d105.sanityn/f105.sanityn&apos;
  Size: 0         	Blocks: 0          IO Block: 4194304 regular empty file
Device: 2c54f966h/743766374d	Inode: 144115339490230275  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-13 13:42:26.000000000 +0300
Modify: 2020-01-13 13:42:26.000000000 +0300
Change: 2020-01-13 13:42:26.000000000 +0300
 Birth: -
  File: &apos;/mnt/lustre2/d105.sanityn/f105.sanityn&apos;
  Size: 5         	Blocks: 8          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115339490230275  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-13 13:42:26.000000000 +0300
Modify: 2020-01-13 13:42:26.000000000 +0300
Change: 2020-01-13 13:42:26.000000000 +0300
 Birth: -
Resetting fail_loc on all nodes...done.
PASS 105 (6s)
cleanup: ======================================================
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;please ignore PASS mark, the first stat command returns &quot;Size: 0  Blocks: 0 &quot;, that shouldn&apos;t happen since a client has written the file.&lt;/p&gt;</description>
                <environment></environment>
        <key id="57783">LU-13128</key>
            <summary>a race between glimpse and lock cancel is not handled correctly</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="zam">Alexander Zarochentsev</assignee>
                                    <reporter username="zamcray">Alexander Zarochentsev</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Jan 2020 10:59:52 +0000</created>
                <updated>Mon, 23 Nov 2020 11:30:16 +0000</updated>
                            <resolved>Sat, 8 Feb 2020 04:12:25 +0000</resolved>
                                                    <fixVersion>Lustre 2.14.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="261102" author="gerrit" created="Mon, 13 Jan 2020 11:02:41 +0000"  >&lt;p&gt;Alexander Zarochentsev (c17826@cray.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/37215&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37215&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13128&quot; title=&quot;a race between glimpse and lock cancel is not handled correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13128&quot;&gt;&lt;del&gt;LU-13128&lt;/del&gt;&lt;/a&gt; osc: glimpse and lock cancel race&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a01e5519b65a3cde9c00ecdea60bec164163573b&lt;/p&gt;</comment>
                            <comment id="261103" author="zamcray" created="Mon, 13 Jan 2020 11:17:33 +0000"  >&lt;p&gt;A run of the same reproducer with &lt;a href=&quot;https://review.whamcloud.com/37215&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37215&lt;/a&gt; applied:&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;== sanityn test 105: Test size correctness =========================================================== 14:14:20 (1578914060)
striped dir -i1 -c2 /mnt/lustre/d105.sanityn
fail_loc=0x416
  File: &apos;/mnt/lustre2/d105.sanityn/f105.sanityn&apos;
  Size: 5         	Blocks: 1          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115373044662275  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-13 14:14:20.000000000 +0300
Modify: 2020-01-13 14:14:20.000000000 +0300
Change: 2020-01-13 14:14:20.000000000 +0300
 Birth: -
  File: &apos;/mnt/lustre2/d105.sanityn/f105.sanityn&apos;
  Size: 5         	Blocks: 8          IO Block: 4194304 regular file
Device: 2c54f966h/743766374d	Inode: 144115373044662275  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-01-13 14:14:20.000000000 +0300
Modify: 2020-01-13 14:14:20.000000000 +0300
Change: 2020-01-13 14:14:20.000000000 +0300
 Birth: -
Resetting fail_loc on all nodes...done.
PASS 105 (5s)
cleanup: ======================================================
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="262881" author="gerrit" created="Sat, 8 Feb 2020 03:59:43 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/37215/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/37215/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13128&quot; title=&quot;a race between glimpse and lock cancel is not handled correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13128&quot;&gt;&lt;del&gt;LU-13128&lt;/del&gt;&lt;/a&gt; osc: glimpse and lock cancel race&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 7c99f67d9d39e8a037e830cf08a9df305e6d8da2&lt;/p&gt;</comment>
                            <comment id="262912" author="pjones" created="Sat, 8 Feb 2020 04:12:25 +0000"  >&lt;p&gt;Landed for 2.14&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="59478">LU-13645</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|i00rwv:</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>