summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-04-18 11:45:02 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2018-05-31 20:31:46 +0200
commitb169c3c560e2b133860f0496d0872699c9b48d54 (patch)
tree193dcbb3704ec990ada9d26b789eb6e776e06c5c
parentf2fs: allocate hot_data for atomic write more strictly (diff)
downloadlinux-b169c3c560e2b133860f0496d0872699c9b48d54.tar.xz
linux-b169c3c560e2b133860f0496d0872699c9b48d54.zip
f2fs: fix return value in f2fs_ioc_commit_atomic_write
In f2fs_ioc_commit_atomic_write, if file is volatile, return -EINVAL to indicate that commit failure. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 58f692b568b2..d2b4145cb34e 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1726,8 +1726,10 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp)
down_write(&F2FS_I(inode)->dio_rwsem[WRITE]);
- if (f2fs_is_volatile_file(inode))
+ if (f2fs_is_volatile_file(inode)) {
+ ret = -EINVAL;
goto err_out;
+ }
if (f2fs_is_atomic_file(inode)) {
ret = commit_inmem_pages(inode);