Skip to contentSkip to conversation

f2fs: avoid copy date to user-space if move file range fail

PATCH New Kinglong Mee 1 participant 1 message Mar 10, 2017 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 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.

---
 fs/f2fs/file.c | 2 ++
 1 file changed, 2 insertions(+)
fs/f2fs/file.c +2 -0
index 5f8d600..88afe0f 100644
@@ -2194,6 +2194,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)))
Signature · 9 lines
2.9.3


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford