From: Luis Henriques <lhenriques@suse.de>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Nicolas Boichat <drinkcat@chromium.org>,
Amir Goldstein <amir73il@gmail.com>,
Olga Kornievskaia <aglo@umich.edu>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
0day robot <lkp@intel.com>,
kernel test robot <oliver.sang@intel.com>,
Luis Henriques <lhenriques@suse.de>
Subject: [PATCH] vfs: fix early copy_file_range return when len is zero
Date: Tue, 18 May 2021 12:10:55 +0100 [thread overview]
Message-ID: <20210518111055.16079-1-lhenriques@suse.de> (raw)
In-Reply-To: <877dk1zibo.fsf@suse.de>
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@intel.com>
Signed-off-by: Luis Henriques <lhenriques@suse.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);
next prev parent reply other threads:[~2021-05-18 11:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 9:08 [PATCH v9] vfs: fix copy_file_range regression in cross-fs copies Luis Henriques
2021-05-13 13:56 ` [vfs] 94a4dd06a6: xfstests.generic.263.fail kernel test robot
2021-05-14 11:05 ` Luis Henriques
2021-05-18 11:10 ` Luis Henriques [this message]
2021-06-30 15:46 ` Amir Goldstein
2021-06-30 16:06 ` Luis Henriques
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210518111055.16079-1-lhenriques@suse.de \
--to=lhenriques@suse.de \
--cc=aglo@umich.edu \
--cc=amir73il@gmail.com \
--cc=drinkcat@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oliver.sang@intel.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®