You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
/* do checkpoint to issue discard commands safely */
|
||||
mutex_lock(&sbi->gc_mutex);
|
||||
write_checkpoint(sbi, &cpc);
|
||||
mutex_unlock(&sbi->gc_mutex);
|
||||
out:
|
||||
range->len = cpc.trimmed << sbi->log_blocksize;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user