Commit ca4b02ee authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: call write_checkpoint under disabled gc

During the write_checkpoint, we should avoid f2fs_gc trigger to avoid any
filesystem consistency.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 9234f319
...@@ -1046,7 +1046,9 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) ...@@ -1046,7 +1046,9 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
cpc.trim_minlen = range->minlen >> sbi->log_blocksize; cpc.trim_minlen = range->minlen >> sbi->log_blocksize;
/* do checkpoint to issue discard commands safely */ /* do checkpoint to issue discard commands safely */
mutex_lock(&sbi->gc_mutex);
write_checkpoint(sbi, &cpc); write_checkpoint(sbi, &cpc);
mutex_unlock(&sbi->gc_mutex);
out: out:
range->len = cpc.trimmed << sbi->log_blocksize; range->len = cpc.trimmed << sbi->log_blocksize;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment