f2fs: fix to account missing .skipped_gc_rwsem
authorChao Yu <chao@kernel.org>
Tue, 24 Aug 2021 00:12:08 +0000 (08:12 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 30 Aug 2021 17:12:47 +0000 (10:12 -0700)
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>
fs/f2fs/gc.c

index 2c18443972b6aee562ff5b628c6864359ed5673a..77391e3b7d68f86fc2be4ec0b4a191b4b48e0fc1 100644 (file)
@@ -1500,8 +1500,10 @@ next_step:
                        int err;
 
                        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++;