diff options
| author | Sheng Yong <shengyong1@huawei.com> | 2018-11-14 19:34:28 +0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2019-01-02 16:17:13 -0800 |
| commit | e4f63bec5edb22cbb527b00a63ae3da4337b71f0 (patch) | |
| tree | 779a3af022905d3013f6b2cb59252a576e8b7f7e /scripts | |
| parent | bec98df4142c3d4e761a35bfeb53da0a9544955a (diff) | |
f2fs: fix race between write_checkpoint and write_begin
The following race could lead to inconsistent SIT bitmap:
Task A Task B
====== ======
f2fs_write_checkpoint
block_operations
f2fs_lock_all
down_write(node_change)
down_write(node_write)
... sync ...
up_write(node_change)
f2fs_file_write_iter
set_inode_flag(FI_NO_PREALLOC)
......
f2fs_write_begin(index=0, has inline data)
prepare_write_begin
__do_map_lock(AIO) => down_read(node_change)
f2fs_convert_inline_page => update SIT
__do_map_lock(AIO) => up_read(node_change)
f2fs_flush_sit_entries <= inconsistent SIT
finish write checkpoint
sudden-power-off
If SPO occurs after checkpoint is finished, SIT bitmap will be set
incorrectly.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
