summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2020-12-07 17:54:41 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-12-08 14:25:41 -0800
commit96dd02519580faa731066351f438a2f967d9a0ee (patch)
tree04c840d817dce93a7e12773daeda89cffdddb631 /fs/f2fs
parent84921561532f771bd338e7791bf275b2b605d642 (diff)
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>
Diffstat (limited to 'fs/f2fs')
-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)
ri = F2FS_INODE(page);
if (ri->i_inline & F2FS_INLINE_XATTR) {
- set_inode_flag(inode, FI_INLINE_XATTR);
+ if (!f2fs_has_inline_xattr(inode)) {
+ set_inode_flag(inode, FI_INLINE_XATTR);
+ stat_inc_inline_xattr(inode);
+ }
} else {
- clear_inode_flag(inode, FI_INLINE_XATTR);
+ if (f2fs_has_inline_xattr(inode)) {
+ stat_dec_inline_xattr(inode);
+ clear_inode_flag(inode, FI_INLINE_XATTR);
+ }
goto update_inode;
}