From: Chao Yu Date: Tue, 24 Aug 2021 00:12:08 +0000 (+0800) Subject: f2fs: fix to account missing .skipped_gc_rwsem X-Git-Tag: v5.13.19~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff03c75e80ca5fb56ff699e52aab527db7ff000;p=thirdparty%2Fkernel%2Fstable.git f2fs: fix to account missing .skipped_gc_rwsem [ 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 Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 83b0a7872b3c8..1c05e156d9d50 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1497,8 +1497,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++;