[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210518111055.16079-1-lhenriques@suse.de>
Date: Tue, 18 May 2021 12:10:55 +0100
From: Luis Henriques <lhenriques@...e.de>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Nicolas Boichat <drinkcat@...omium.org>,
Amir Goldstein <amir73il@...il.com>,
Olga Kornievskaia <aglo@...ch.edu>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
0day robot <lkp@...el.com>,
kernel test robot <oliver.sang@...el.com>,
Luis Henriques <lhenriques@...e.de>
Subject: [PATCH] vfs: fix early copy_file_range return when len is zero
The early return from copy_file_range when len is zero should check if the
filesystem really implements this syscall, returning -EOPNOTSUPP if it doesn't,
and 0 otherwise.
Reported-by: kernel test robot <oliver.sang@...el.com>
Signed-off-by: Luis Henriques <lhenriques@...e.de>
---
Hi!
Since I got not feedback, I'm sending a patch that should fix this issue
reported by 0day. Probably this should simply be squashed into v9, I can
send v10 if you prefer that.
Cheers,
--
Luis
fs/read_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index 9db7adf160d2..24b4bf704765 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1498,7 +1498,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in,
return ret;
if (len == 0)
- return 0;
+ return file_out->f_op->copy_file_range ? 0 : -EOPNOTSUPP;
file_start_write(file_out);
Powered by blists - more mailing lists