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>
This commit is contained in:
Chao Yu 2018-04-18 17:45:02 +08:00 committed by Jaegeuk Kim
parent 054afda999
commit b169c3c560

View File

@ -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);