<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>On 11/19/18 3:01 PM, jiangyiwen wrote:<br>
    </p>
    <blockquote type="cite" cite="mid:5BF25FD8.8090802@huawei.com">
      <pre class="moz-quote-pre" wrap="">On 2018/11/19 14:34, Junxiao Bi wrote:
</pre>
      <blockquote type="cite" style="color: #000000;">
        <pre class="moz-quote-pre" wrap="">On 11/19/18 2:14 PM, jiangyiwen wrote:

</pre>
        <blockquote type="cite" style="color: #000000;">
          <pre class="moz-quote-pre" wrap="">On 2018/11/19 13:46, Junxiao Bi wrote:
</pre>
          <blockquote type="cite" style="color: #000000;">
            <pre class="moz-quote-pre" wrap="">On 11/19/18 11:05 AM, jiangyiwen wrote:
</pre>
            <blockquote type="cite" style="color: #000000;">
              <pre class="moz-quote-pre" wrap="">On 2018/11/14 8:00, Junxiao Bi wrote:
</pre>
              <blockquote type="cite" style="color: #000000;">
                <pre class="moz-quote-pre" wrap="">For sync io read in ocfs2_read_blocks_sync(), first clear bh uptodate flag
and submit the io, second wait io done, last check whether bh uptodate,
if not return io error.

If two sync io for the same bh were issued, it could be the first io done
and set uptodate flag, but just before check that flag, the second io came
in and cleared uptodate, then ocfs2_read_blocks_sync() for the first io
will return IO error.

Indeed it's not necessary to clear uptodate flag, as the io end handler
end_buffer_read_sync() will set or clear it based on io succeed or failed.

The following message was found from a nfs server but the underlying
storage returned no error.

[4106438.567376] (nfsd,7146,3):ocfs2_get_suballoc_slot_bit:2780 ERROR: read block 1238823695 failed -5
[4106438.567569] (nfsd,7146,3):ocfs2_get_suballoc_slot_bit:2812 ERROR: status = -5
[4106438.567611] (nfsd,7146,3):ocfs2_test_inode_bit:2894 ERROR: get alloc slot and bit failed -5
[4106438.567643] (nfsd,7146,3):ocfs2_test_inode_bit:2932 ERROR: status = -5
[4106438.567675] (nfsd,7146,3):ocfs2_get_dentry:94 ERROR: test inode bit failed -5

Same issue in non sync read ocfs2_read_blocks(), fixed it as well.

Signed-off-by: Junxiao Bi <a class="moz-txt-link-rfc2396E" href="mailto:junxiao.bi@oracle.com" moz-do-not-send="true">&lt;junxiao.bi@oracle.com&gt;</a>
</pre>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">Reviewed-by: Yiwen Jiang <a class="moz-txt-link-rfc2396E" href="mailto:jiangyiwen@huawei.com" moz-do-not-send="true">&lt;jiangyiwen@huawei.com&gt;</a></pre>
    </blockquote>
    <p>Yiwen, many thanks for your review.</p>
    <p><br>
    </p>
    <blockquote type="cite" cite="mid:5BF25FD8.8090802@huawei.com">
      <pre class="moz-quote-pre" wrap="">

</pre>
    </blockquote>
  </body>
</html>