summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-04-18 17:45:02 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-05-31 11:31:46 -0700
commitb169c3c560e2b133860f0496d0872699c9b48d54 (patch)
tree193dcbb3704ec990ada9d26b789eb6e776e06c5c /fs/f2fs/file.c
parent054afda9991786ead2c2b57cdf3b28d4dd3709f2 (diff)
downloadlinux-stable-b169c3c560e2b133860f0496d0872699c9b48d54.tar.gz
linux-stable-b169c3c560e2b133860f0496d0872699c9b48d54.tar.bz2
linux-stable-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>
Diffstat (limited to 'fs/f2fs/file.c')
-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);