]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix to detect truncation prior rather than EIO during read
authorChao Yu <yuchao0@huawei.com>
Sun, 3 Jul 2016 14:05:12 +0000 (22:05 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 8 Jul 2016 17:33:25 +0000 (10:33 -0700)
commitc6f33cbf892f5ebac4880b9691524e44a2aab239
tree7b3f921f969550d54ebd4d97e3e922468d2b18c9
parent7ca76be28fa83c32a6357dc41343075838a90079
f2fs: fix to detect truncation prior rather than EIO during read

In procedure of synchonized read, after sending out the read request, reader
will try to lock the page for waiting device to finish the read jobs and
unlock the page, but meanwhile, truncater will race with reader, so after
reader get lock of the page, it should check page's mapping to detect
whether someone has truncated the page in advance, then reader has the
chance to do the retry if truncation was done, otherwise read can be failed
due to previous condition check.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/gc.c
fs/f2fs/node.c