提交 447135a8 编写于 作者: J Jaegeuk Kim

f2fs: should unset atomic flag after successful commit

If there is an error during commit, we should keep the flag in order to
abort it.
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 1663cae4
...@@ -1378,8 +1378,10 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp) ...@@ -1378,8 +1378,10 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp)
if (f2fs_is_atomic_file(inode)) { if (f2fs_is_atomic_file(inode)) {
clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
ret = commit_inmem_pages(inode, false); ret = commit_inmem_pages(inode, false);
if (ret) if (ret) {
set_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
goto err_out; goto err_out;
}
} }
ret = f2fs_sync_file(filp, 0, LLONG_MAX, 0); ret = f2fs_sync_file(filp, 0, LLONG_MAX, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册