diff options
author | Sheng Yong <shengyong1@huawei.com> | 2018-11-14 19:34:28 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-11-26 15:53:57 -0800 |
commit | 2866fb16d67992195b0526d19e65acb6640fb87f (patch) | |
tree | bb74db858f11e02f127463e35fb26a639c4a7448 /fs/f2fs/f2fs.h | |
parent | 4e240d1bab1ead280ddf5eb05058dba6bbd57d10 (diff) | |
download | linux-2866fb16d67992195b0526d19e65acb6640fb87f.tar.gz linux-2866fb16d67992195b0526d19e65acb6640fb87f.tar.bz2 linux-2866fb16d67992195b0526d19e65acb6640fb87f.zip |
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 'fs/f2fs/f2fs.h')
0 files changed, 0 insertions, 0 deletions