summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-07-25 00:52:52 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-05 08:08:15 -0700
commitedb27deea7cabfff8feb8c62aae647b7673be734 (patch)
treecde2beefcad2e8b30cebbe3b2c568893f000513a /fs/f2fs/file.c
parenta6d494b6d84697f954aaade204e8a5843078a94f (diff)
downloadop-kernel-dev-edb27deea7cabfff8feb8c62aae647b7673be734.zip
op-kernel-dev-edb27deea7cabfff8feb8c62aae647b7673be734.tar.gz
f2fs: handle error cases in commit_inmem_pages
This patch adds to handle error cases in commit_inmem_pages. If an error occurs, it stops to write the pages and return the error right away. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 25d1a2f..be69a01 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1358,10 +1358,13 @@ 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);
- commit_inmem_pages(inode, false);
+ ret = commit_inmem_pages(inode, false);
+ if (ret)
+ goto err_out;
}
ret = f2fs_sync_file(filp, 0, LLONG_MAX, 0);
+err_out:
mnt_drop_write_file(filp);
return ret;
}
@@ -1418,7 +1421,7 @@ static int f2fs_ioc_abort_volatile_write(struct file *filp)
if (f2fs_is_atomic_file(inode)) {
clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
- commit_inmem_pages(inode, false);
+ commit_inmem_pages(inode, true);
}
if (f2fs_is_volatile_file(inode))
OpenPOWER on IntegriCloud