f2fs: avoid race for summary information
In order to do GC more reliably, I'd like to lock the vicitm summary page until its GC is completed, and also prevent any checkpoint process. Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
@@ -137,10 +137,13 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
|
||||
if (!sbi->s_dirty && !get_pages(sbi, F2FS_DIRTY_NODES))
|
||||
return 0;
|
||||
|
||||
if (sync)
|
||||
if (sync) {
|
||||
mutex_lock(&sbi->gc_mutex);
|
||||
write_checkpoint(sbi, false);
|
||||
else
|
||||
mutex_unlock(&sbi->gc_mutex);
|
||||
} else {
|
||||
f2fs_balance_fs(sbi);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user