f2fs: introduce cp_lock to protect updating of ckpt_flags
This patch introduces spinlock to protect updating process of ckpt_flags field in struct f2fs_checkpoint, it avoids incorrectly updating in race condition. Signed-off-by: Chao Yu <yuchao0@huawei.com> [Jaegeuk Kim: add __is_set_ckpt_flags likewise __set_ckpt_flags] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -627,7 +627,7 @@ out:
|
||||
|
||||
clear_sbi_flag(sbi, SBI_POR_DOING);
|
||||
if (err)
|
||||
set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
|
||||
set_ckpt_flags(sbi, CP_ERROR_FLAG);
|
||||
mutex_unlock(&sbi->cp_mutex);
|
||||
|
||||
/* let's drop all the directory inodes for clean checkpoint */
|
||||
|
Reference in New Issue
Block a user