Skip to content

Commit

Permalink
f2fs: should unset atomic flag after successful commit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaegeuk Kim committed Jan 11, 2016
1 parent 1663cae commit 447135a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 447135a

Please sign in to comment.