Skip to content

Commit b853527

Browse files
biger410jfvogel
authored andcommitted
ocfs2: don't clear bh uptodate for block read
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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Junxiao Bi <[email protected]> Reviewed-by: Changwei Ge <[email protected]> Reviewed-by: Yiwen Jiang <[email protected]> Cc: Joel Becker <[email protected]> Cc: Joseph Qi <[email protected]> Cc: Jun Piao <[email protected]> Cc: Mark Fasheh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> (cherry picked from commit 70306d9) Orabug: 29159655 Signed-off-by: Junxiao Bi <[email protected]> Reviewed-by: Ashish Samant <[email protected]>
1 parent 8efca48 commit b853527

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fs/ocfs2/buffer_head_io.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
152152
#endif
153153
}
154154

155-
clear_buffer_uptodate(bh);
156155
get_bh(bh); /* for end_buffer_read_sync() */
157156
bh->b_end_io = end_buffer_read_sync;
158157
submit_bh(REQ_OP_READ, 0, bh);
@@ -306,7 +305,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
306305
continue;
307306
}
308307

309-
clear_buffer_uptodate(bh);
310308
get_bh(bh); /* for end_buffer_read_sync() */
311309
if (validate)
312310
set_buffer_needs_validate(bh);

0 commit comments

Comments
 (0)