Skip to content

Commit

Permalink
f2fs: fix to account missing .skipped_gc_rwsem
Browse files Browse the repository at this point in the history
[ Upstream commit ad126eb ]

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

Fixes: 6f8d445 ("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>
  • Loading branch information
chaseyu authored and gregkh committed Sep 18, 2021
1 parent d5b8e49 commit cff03c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/f2fs/gc.c
Expand Up @@ -1497,8 +1497,10 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
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++;
Expand Down

0 comments on commit cff03c7

Please sign in to comment.