summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inode.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-09-01 01:54:51 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2017-09-05 19:50:11 +0200
commitee605234996627c4fe874ea580e36211fb2bf6d5 (patch)
treeb017014fe96396be4ed4a0d8aed4359238a429f4 /fs/f2fs/inode.c
parentf2fs: don't need to update inode checksum for recovery (diff)
downloadlinux-ee605234996627c4fe874ea580e36211fb2bf6d5.tar.xz
linux-ee605234996627c4fe874ea580e36211fb2bf6d5.zip
f2fs: don't check inode's checksum if it was dirtied or writebacked
If another thread already made the page dirtied or writebacked, we must avoid to verify checksum. If we got an error, we need to remove its uptodate as well. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r--fs/f2fs/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index b4c401d456e7..c33b05aec1a1 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -153,7 +153,8 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)
struct f2fs_inode *ri;
__u32 provided, calculated;
- if (!f2fs_enable_inode_chksum(sbi, page))
+ if (!f2fs_enable_inode_chksum(sbi, page) ||
+ PageDirty(page) || PageWriteback(page))
return true;
ri = &F2FS_NODE(page)->i;