From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: return -EOPNOTSUPP if clone is not supported
Date: Fri, 26 Feb 2016 13:51:58 -0800 [thread overview]
Message-ID: <20160226215158.GA32602@birch.djwong.org> (raw)
In-Reply-To: <1456509192-5608-2-git-send-email-hch@lst.de>
On Fri, Feb 26, 2016 at 06:53:12PM +0100, Christoph Hellwig wrote:
> -EBADF is a rather confusing error if an operations is not supported,
> and nfsd gets rather upset about it.
I was wondering why I kept getting EBADF trying to run xfstests over NFS
before I figured out to pass -o nfsvers=4.2 to mount.
Anyhow,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/read_write.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 324ec27..1cdfdfe 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -1532,10 +1532,12 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
>
> if (!(file_in->f_mode & FMODE_READ) ||
> !(file_out->f_mode & FMODE_WRITE) ||
> - (file_out->f_flags & O_APPEND) ||
> - !file_in->f_op->clone_file_range)
> + (file_out->f_flags & O_APPEND))
> return -EBADF;
>
> + if (!file_in->f_op->clone_file_range)
> + return -EOPNOTSUPP;
> +
> ret = clone_verify_area(file_in, pos_in, len, false);
> if (ret)
> return ret;
> --
> 2.1.4
>
prev parent reply other threads:[~2016-02-26 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 17:53 a late clone fix Christoph Hellwig
2016-02-26 17:53 ` [PATCH] fs: return -EOPNOTSUPP if clone is not supported Christoph Hellwig
2016-02-26 21:51 ` Darrick J. Wong [this message]
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=20160226215158.GA32602@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).