]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
f2fs: fix to account missing .skipped_gc_rwsem
authorChao Yu <chao@kernel.org>
Tue, 24 Aug 2021 00:12:08 +0000 (08:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 09:48:02 +0000 (11:48 +0200)
[ Upstream commit ad126ebddecbf696e0cf214ff56c7b170fa9f0f7 ]

There is a missing place we forgot to account .skipped_gc_rwsem, fix it.

Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/gc.c

index 700c39ec99f5a71ae56d05621d8ffa5f1f714d11..38299ccfdf6ef99031dc1abade6ce8dc453face4 100644 (file)
@@ -998,8 +998,10 @@ next_step:
                        bool locked = false;
 
                        if (S_ISREG(inode->i_mode)) {
-                               if (!down_write_trylock(&fi->i_gc_rwsem[READ]))
+                               if (!down_write_trylock(&fi->i_gc_rwsem[READ])) {
+                                       sbi->skipped_gc_rwsem++;
                                        continue;
+                               }
                                if (!down_write_trylock(
                                                &fi->i_gc_rwsem[WRITE])) {
                                        sbi->skipped_gc_rwsem++;