diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-09-20 03:04:18 (GMT) |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-10-01 00:34:20 (GMT) |
commit | aaec2b1d18792a5f27b69ff37f34f43f89f5aa3b (patch) | |
tree | d21e6ad4e210ad826580c03a55cb97230543c280 /fs/f2fs/segment.c | |
parent | fadb2fb8af5348c1bc59cab17c6f8bf515e50d55 (diff) | |
download | linux-aaec2b1d18792a5f27b69ff37f34f43f89f5aa3b.tar.xz |
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/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 2d23d7b..e78501c 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1801,7 +1801,7 @@ static int restore_curseg_summaries(struct f2fs_sb_info *sbi) int type = CURSEG_HOT_DATA; int err; - if (is_set_ckpt_flags(F2FS_CKPT(sbi), CP_COMPACT_SUM_FLAG)) { + if (is_set_ckpt_flags(sbi, CP_COMPACT_SUM_FLAG)) { int npages = npages_for_summary_flush(sbi, true); if (npages >= 2) @@ -1898,7 +1898,7 @@ static void write_normal_summaries(struct f2fs_sb_info *sbi, void write_data_summaries(struct f2fs_sb_info *sbi, block_t start_blk) { - if (is_set_ckpt_flags(F2FS_CKPT(sbi), CP_COMPACT_SUM_FLAG)) + if (is_set_ckpt_flags(sbi, CP_COMPACT_SUM_FLAG)) write_compacted_summaries(sbi, start_blk); else write_normal_summaries(sbi, start_blk, CURSEG_HOT_DATA); |