diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-07-31 20:19:09 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-08-03 19:09:26 -0700 |
commit | 704956ecf5bcdc14d14650f39f2b545b34c96265 (patch) | |
tree | 7d1671f472ed05961a350510d09c4b2273e6a789 /fs/f2fs/node.c | |
parent | 4f31d26b0c17f2aae6a6afeb823a87e20671ab4b (diff) | |
download | linux-704956ecf5bcdc14d14650f39f2b545b34c96265.tar.gz linux-704956ecf5bcdc14d14650f39f2b545b34c96265.tar.bz2 linux-704956ecf5bcdc14d14650f39f2b545b34c96265.zip |
f2fs: support inode checksum
This patch adds to support inode checksum in f2fs.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: fix verification flow]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 14b79a396a3f..0176035d8ced 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1171,6 +1171,11 @@ repeat: err = -EIO; goto out_err; } + + if (!f2fs_inode_chksum_verify(sbi, page)) { + err = -EBADMSG; + goto out_err; + } page_hit: if(unlikely(nid != nid_of_node(page))) { f2fs_msg(sbi->sb, KERN_WARNING, "inconsistent node block, " @@ -2275,6 +2280,8 @@ retry: F2FS_FITS_IN_INODE(src, le16_to_cpu(src->i_extra_isize), i_projid)) dst->i_projid = src->i_projid; + + f2fs_inode_chksum_set(sbi, ipage); } new_ni = old_ni; |