summaryrefslogtreecommitdiffstats
path: root/.gitattributes
diff options
context:
space:
mode:
authorChao Yu2019-02-02 10:33:01 +0100
committerJaegeuk Kim2019-03-06 04:58:06 +0100
commitc42d28ce3e16dbd88e575c0acfda96d221dae2c9 (patch)
treef96e5e3a8f42d59e2764d1e1e3ec25c3552a4e29 /.gitattributes
parentf2fs: jump to label 'free_node_inode' when failing from d_make_root() (diff)
downloadkernel-qcow2-linux-c42d28ce3e16dbd88e575c0acfda96d221dae2c9.tar.gz
kernel-qcow2-linux-c42d28ce3e16dbd88e575c0acfda96d221dae2c9.tar.xz
kernel-qcow2-linux-c42d28ce3e16dbd88e575c0acfda96d221dae2c9.zip
f2fs: fix potential data inconsistence of checkpoint
Previously, we changed lock from cp_rwsem to node_change, it solved the deadlock issue which was caused by below race condition: Thread A Thread B - f2fs_setattr - f2fs_lock_op -- read_lock - dquot_transfer - __dquot_transfer - dquot_acquire - commit_dqblk - f2fs_quota_write - f2fs_write_begin - f2fs_write_failed - write_checkpoint - block_operations - f2fs_lock_all -- write_lock - f2fs_truncate_blocks - f2fs_lock_op -- read_lock But it breaks the sematics of cp_rwsem, in other callers like: - f2fs_file_write_iter -> f2fs_write_begin -> f2fs_write_failed - f2fs_direct_IO -> f2fs_write_failed We allow to truncate dnode w/o cp_rwsem held, result in incorrect sit bitmap update, which can cause further data corruption. So this patch reverts previous fix implementation, and try to fix deadlock by skipping calling f2fs_truncate_blocks() in f2fs_write_failed() only for quota file, and keep the preallocated data/node in the tail of quota file, we can expecte that the preallocated space can be used to store quota info latter soon. Fixes: af033b2aa8a8 ("f2fs: guarantee journalled quota data by checkpoint") Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions