aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu2020-12-07 03:54:41 -0600
committerJaegeuk Kim2020-12-21 15:33:19 -0600
commitb91c6825c376eeebf1f4ecfa61e7cc0300addc9c (patch)
treef5e6b08ae81e554d1cc103b56ff4a0b507dd0e7c
parentb0858a20fe56b7a060b32695c1ae10b715986f94 (diff)
downloadkernel-b91c6825c376eeebf1f4ecfa61e7cc0300addc9c.tar.gz
kernel-b91c6825c376eeebf1f4ecfa61e7cc0300addc9c.tar.xz
kernel-b91c6825c376eeebf1f4ecfa61e7cc0300addc9c.zip
f2fs: fix to account inline xattr correctly during recovery
During recovery, we may missed to update inline xattr count correctly, fix it. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/node.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e65d73293a3f..3a24423ac65f 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2594,9 +2594,15 @@ int f2fs_recover_inline_xattr(struct inode *inode, struct page *page)
2594 2594
2595 ri = F2FS_INODE(page); 2595 ri = F2FS_INODE(page);
2596 if (ri->i_inline & F2FS_INLINE_XATTR) { 2596 if (ri->i_inline & F2FS_INLINE_XATTR) {
2597 set_inode_flag(inode, FI_INLINE_XATTR); 2597 if (!f2fs_has_inline_xattr(inode)) {
2598 set_inode_flag(inode, FI_INLINE_XATTR);
2599 stat_inc_inline_xattr(inode);
2600 }
2598 } else { 2601 } else {
2599 clear_inode_flag(inode, FI_INLINE_XATTR); 2602 if (f2fs_has_inline_xattr(inode)) {
2603 stat_dec_inline_xattr(inode);
2604 clear_inode_flag(inode, FI_INLINE_XATTR);
2605 }
2600 goto update_inode; 2606 goto update_inode;
2601 } 2607 }
2602 2608