Commit 338bbfa0 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: avoid wrong count on dirty inodes

The number should be covered by spin_lock. Otherwise we can see wrong count
in f2fs_stat.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 9f7c45cc
...@@ -645,8 +645,8 @@ static void f2fs_dirty_inode(struct inode *inode, int flags) ...@@ -645,8 +645,8 @@ static void f2fs_dirty_inode(struct inode *inode, int flags)
list_add_tail(&F2FS_I(inode)->gdirty_list, list_add_tail(&F2FS_I(inode)->gdirty_list,
&sbi->inode_list[DIRTY_META]); &sbi->inode_list[DIRTY_META]);
inc_page_count(sbi, F2FS_DIRTY_IMETA); inc_page_count(sbi, F2FS_DIRTY_IMETA);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
stat_inc_dirty_inode(sbi, DIRTY_META); stat_inc_dirty_inode(sbi, DIRTY_META);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
} }
void f2fs_inode_synced(struct inode *inode) void f2fs_inode_synced(struct inode *inode)
...@@ -662,8 +662,8 @@ void f2fs_inode_synced(struct inode *inode) ...@@ -662,8 +662,8 @@ void f2fs_inode_synced(struct inode *inode)
clear_inode_flag(inode, FI_DIRTY_INODE); clear_inode_flag(inode, FI_DIRTY_INODE);
clear_inode_flag(inode, FI_AUTO_RECOVER); clear_inode_flag(inode, FI_AUTO_RECOVER);
dec_page_count(sbi, F2FS_DIRTY_IMETA); dec_page_count(sbi, F2FS_DIRTY_IMETA);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
stat_dec_dirty_inode(F2FS_I_SB(inode), DIRTY_META); stat_dec_dirty_inode(F2FS_I_SB(inode), DIRTY_META);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
} }
static void f2fs_i_callback(struct rcu_head *head) static void f2fs_i_callback(struct rcu_head *head)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment