linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	viro@zeniv.linux.org.uk, tao.peng@primarydata.com,
	jeff.layton@primarydata.com, bfields@fieldses.org,
	linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org
Subject: [PATCH 5/4] vfs: return EINVAL for unsupported file types in clone
Date: Mon, 14 Dec 2015 17:34:58 +0100	[thread overview]
Message-ID: <20151214163458.GB12687@lst.de> (raw)
In-Reply-To: <20151207005331.GA10582@birch.djwong.org>

Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/fs/read_write.c b/fs/read_write.c
index 1f0d3f1..6268ebc 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1528,7 +1528,7 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
 	if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
 		return -EISDIR;
 	if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
-		return -EOPNOTSUPP;
+		return -EINVAL;
 
 	if (!(file_in->f_mode & FMODE_READ) ||
 	    !(file_out->f_mode & FMODE_WRITE) ||

  parent reply	other threads:[~2015-12-14 16:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 11:59 move btrfs clone ioctls to common code V2 Christoph Hellwig
2015-12-03 11:59 ` [PATCH 1/4] locks: new locks_mandatory_area calling convention Christoph Hellwig
2015-12-08  4:05   ` Al Viro
2015-12-08 14:54     ` Christoph Hellwig
2015-12-08 16:16       ` Al Viro
2015-12-03 11:59 ` [PATCH 2/4] vfs: pull btrfs clone API to vfs layer Christoph Hellwig
2015-12-07  0:53   ` Darrick J. Wong
2015-12-07 15:13     ` Christoph Hellwig
2015-12-07 21:09       ` Darrick J. Wong
2015-12-08  1:54       ` Darrick J. Wong
2015-12-14 16:34     ` Christoph Hellwig [this message]
2015-12-09 20:40   ` Darrick J. Wong
2015-12-14 16:34     ` Christoph Hellwig
2015-12-14 17:08     ` Darrick J. Wong
2015-12-03 11:59 ` [PATCH 3/4] nfsd: Pass filehandle to nfs4_preprocess_stateid_op() Christoph Hellwig
2015-12-03 11:59 ` [PATCH 4/4] nfsd: implement the NFSv4.2 CLONE operation Christoph Hellwig

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=20151214163458.GB12687@lst.de \
    --to=hch@lst.de \
    --cc=bfields@fieldses.org \
    --cc=darrick.wong@oracle.com \
    --cc=jeff.layton@primarydata.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tao.peng@primarydata.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;
as well as URLs for NNTP newsgroup(s).