diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-02 11:08:56 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:33:42 +0200 |
| commit | adac9ec0af4e2078198eeb5ed15641ae8b593646 (patch) | |
| tree | f6f1039b7f611c8209ad078bc4f79e1dcf863d59 | |
| parent | b726448951fbb5b3fa4be7eaddbc8f716baa102f (diff) | |
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: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 36e6919df..986537b96 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -631,8 +631,8 @@ static void f2fs_dirty_inode(struct inode *inode, int flags) list_add_tail(&F2FS_I(inode)->gdirty_list, &sbi->inode_list[DIRTY_META]); inc_page_count(sbi, F2FS_DIRTY_IMETA); - spin_unlock(&sbi->inode_lock[DIRTY_META]); stat_inc_dirty_inode(sbi, DIRTY_META); + spin_unlock(&sbi->inode_lock[DIRTY_META]); } void f2fs_inode_synced(struct inode *inode) @@ -648,8 +648,8 @@ void f2fs_inode_synced(struct inode *inode) clear_inode_flag(inode, FI_DIRTY_INODE); clear_inode_flag(inode, FI_AUTO_RECOVER); dec_page_count(sbi, F2FS_DIRTY_IMETA); - spin_unlock(&sbi->inode_lock[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) |
