diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-10 02:08:38 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-12 00:56:44 +0100 |
commit | 447135a86659c646017b8e707c1243c186bf2dff (patch) | |
tree | 267c8875be3ca887fb1510fa8f1e9d427046daa5 /fs/f2fs | |
parent | f2fs: fix wrong memory condition check (diff) | |
download | linux-447135a86659c646017b8e707c1243c186bf2dff.tar.xz linux-447135a86659c646017b8e707c1243c186bf2dff.zip |
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: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 3d43857e9892..18ddb1e5182a 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1378,8 +1378,10 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp) if (f2fs_is_atomic_file(inode)) { clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); ret = commit_inmem_pages(inode, false); - if (ret) + if (ret) { + set_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); goto err_out; + } } ret = f2fs_sync_file(filp, 0, LLONG_MAX, 0); |