diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-12-07 10:54:41 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-12-08 23:25:41 +0100 |
commit | 96dd02519580faa731066351f438a2f967d9a0ee (patch) | |
tree | 04c840d817dce93a7e12773daeda89cffdddb631 /fs/f2fs/node.c | |
parent | f2fs: inline: fix wrong inline inode stat (diff) | |
download | linux-96dd02519580faa731066351f438a2f967d9a0ee.tar.xz linux-96dd02519580faa731066351f438a2f967d9a0ee.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>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 10 |
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; } |