[PATCH] f2fs: fix 32-bit linking

From: Arnd Bergmann
Date: Fri Jun 28 2019 - 06:40:35 EST


Not all architectures support get_user() with a 64-bit argument:

ERROR: "__get_user_bad" [fs/f2fs/f2fs.ko] undefined!

Use copy_from_user() here, this will always work.

Fixes: d2ae7494d043 ("f2fs: ioctl for removing a range from F2FS")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
fs/f2fs/file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 998affe31419..465853029b8e 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3066,7 +3066,8 @@ static int f2fs_ioc_resize_fs(struct file *filp, unsigned long arg)
if (f2fs_readonly(sbi->sb))
return -EROFS;

- if (get_user(block_count, (__u64 __user *)arg))
+ if (copy_from_user(&block_count, (void __user *)arg,
+ sizeof(block_count)))
return -EFAULT;

ret = f2fs_resize_fs(sbi, block_count);
--
2.20.0