diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-09-20 05:04:18 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-10-01 02:34:20 +0200 |
commit | aaec2b1d18792a5f27b69ff37f34f43f89f5aa3b (patch) | |
tree | d21e6ad4e210ad826580c03a55cb97230543c280 /fs/f2fs/recovery.c | |
parent | f2fs: fix to avoid race condition when updating sbi flag (diff) | |
download | linux-aaec2b1d18792a5f27b69ff37f34f43f89f5aa3b.tar.xz linux-aaec2b1d18792a5f27b69ff37f34f43f89f5aa3b.zip |
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>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r-- | fs/f2fs/recovery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 509273a65157..2fc84a991325 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -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 */ |