summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-03-10 10:54:26 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2017-03-22 03:34:28 +0100
commit3cecfa5f6700c07ef943ab3d457f82f9868c4bfa (patch)
tree9624a885e9adccc979dfc0a186e0598f305b69cf /fs/f2fs/file.c
parentf2fs: drop duplicate new_size assign in f2fs_zero_range (diff)
downloadlinux-3cecfa5f6700c07ef943ab3d457f82f9868c4bfa.tar.xz
linux-3cecfa5f6700c07ef943ab3d457f82f9868c4bfa.zip
f2fs: avoid copy date to user-space if move file range fail
If move file range return error, the data copied to user-space is duplicate. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index c3c475675d77..cbde4d23e817 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2208,6 +2208,8 @@ static int f2fs_ioc_move_range(struct file *filp, unsigned long arg)
range.pos_out, range.len);
mnt_drop_write_file(filp);
+ if (err)
+ goto err_out;
if (copy_to_user((struct f2fs_move_range __user *)arg,
&range, sizeof(range)))