Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412774

[PATCH 3/8] f2fs: avoid wrong count on dirty inodes

From Jaegeuk Kim <jaegeuk@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 3/8] f2fs: avoid wrong count on dirty inodes
Date 2016-06-03 06:00 +0200
Message-ID <rFOr7-6ts-17@gated-at.bofh.it> (permalink)
References <rFOr7-6ts-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 fs/f2fs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 27f76819e..9e75433 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -645,8 +645,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)
@@ -662,8 +662,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)
-- 
2.6.3

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/8] f2fs: reuse nid if it was cached only Jaegeuk Kim <jaegeuk@kernel.org> - 2016-06-03 06:00 +0200
  [PATCH 2/8] f2fs: remove deprecated parameter Jaegeuk Kim <jaegeuk@kernel.org> - 2016-06-03 06:00 +0200
  [PATCH 6/8] f2fs: avoid data race between FI_DIRTY_INODE flag and update_inode Jaegeuk Kim <jaegeuk@kernel.org> - 2016-06-03 06:00 +0200
  [PATCH 3/8] f2fs: avoid wrong count on dirty inodes Jaegeuk Kim <jaegeuk@kernel.org> - 2016-06-03 06:00 +0200

csiph-web