From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Chris Mason <clm@fb.com>, xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
Subject: Re: clone ioctl return values
Date: Tue, 17 Nov 2015 19:01:17 -0800 [thread overview]
Message-ID: <20151118030117.GA26143@birch.djwong.org> (raw)
In-Reply-To: <20151117152251.GA5392@infradead.org>
On Tue, Nov 17, 2015 at 07:22:52AM -0800, Christoph Hellwig wrote:
> On Tue, Nov 17, 2015 at 08:57:45AM -0500, Chris Mason wrote:
> > > > Errrgh, the golden output of this test reflects the changes to the input
> > > > checking in Anna/Peng's copy_file_range/clone_file_range patches.
> > > >
> > > > So, I guess the question is, should I reset the golden output to whatever
> > > > btrfs spits out before that patchset, and we'll consider the alterations
> > > > to be bugs/regressions/whatever that ought to be fixed in their patches?
> > >
> > > Some bits in btrfs don't seem kosher. But it would be good to
> > > explicitly send patches for btrfs to adopt to what might make more
> > > sense, and then follow it in the other implementations.
> >
> > Btrfs does check for directories, but we should really be checking for
> > regular files too. In the end, we only copy extents that would
> > correspond with regular files, so we're sneaking by.
>
> Yes, I saw that. So so far I'd suggest something like the following
> for btrfs:
>
> - return EBADFD for missing read/wite permissions
Current btrfs returns EINVAL if the file isn't open for writing or is
append-only. I think EBADF captures the situation here better and
it's what Anna is pushing for copy_file_range. We can make the
change, but generic/157 will fail on old kernels if we do this.
I don't have a problem with 157 failing on old kernels; we can
backport the change to them, or note that ioctls are murky anyway.
> - return EINVAL for wrong non-directory file types as the
> source fd
> And then make the test case and other implementations match this.
>
> Does this sound like a plan?
Yes.
One other thing I noticed -- prior to Anna's patchset, trying to
invoke the reflink ioctl with a device, pipe, or socket as the
destination could return a variety of error codes (-ENOTTY, -EINVAL,
-ENOIOCTLCMD, etc.) which has all been replaced with -EOPNOTSUPP.
That seems like a reasonable direction to take the test case.
Does this seem like a reasonable addition to the plan?
Should invalid inputs to the dedupe ioctl return the same error codes
as the same invalid inputs to the reflink ioctl? I've been working on
patches to hoist EXTENT_SAME to the VFS.
--D
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-11-18 3:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 12:04 clone ioctl return values Christoph Hellwig
2015-11-17 0:28 ` Darrick J. Wong
2015-11-17 10:54 ` Christoph Hellwig
2015-11-17 13:57 ` Chris Mason
2015-11-17 15:22 ` Christoph Hellwig
2015-11-17 15:33 ` Al Viro
2015-11-17 15:36 ` Christoph Hellwig
2015-11-17 18:42 ` Chris Mason
2015-11-18 3:01 ` Darrick J. Wong [this message]
2015-11-18 15:11 ` Christoph Hellwig
2015-11-17 15:12 ` 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=20151118030117.GA26143@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=clm@fb.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/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).