From: Jeff Moyer <jmoyer@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] direct-io: propagate -ENOSPC errors
Date: Mon, 21 Mar 2016 16:22:16 -0400 [thread overview]
Message-ID: <x491t7360p3.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: 20160321160208.GA15481@infradead.org
Hi, Christoph,
Christoph Hellwig <hch@infradead.org> writes:
> On Mon, Mar 14, 2016 at 05:10:00PM -0400, Jeff Moyer wrote:
>> dio_bio_complete turns all errors into -EIO. This is historical,
>> since you used to only get 1 bit precision for errors (BIO_UPTODATE).
>> Now that we get actual error codes, we can return the appropriate
>> code to userspace. File systems seem to only propagate either EIO
>> or ENOSPC, so I've followed suit in this patch.
>
> Do we?
Sometimes! :) I was referring to this:
static inline void mapping_set_error(struct address_space *mapping, int error)
{
if (unlikely(error)) {
if (error == -ENOSPC)
set_bit(AS_ENOSPC, &mapping->flags);
else
set_bit(AS_EIO, &mapping->flags);
}
}
> Just propagating some errors defintively seems odd.
Not really. read, write, etc only expect a subset of errnos to be
returned. The goal was not to leak kernel-internal or unexpected error
numbers to userspace, and I didn't think I would be able to successfully
audit all code paths that lead here. So, I opted for a more
conservative patch that just allows one more errno through.
> Even if we do we should have a central helper doing that mapping
> instead of opencoding it in various places.
OK. I would argue that the right place to filter out errno's would be
up in the vfs. I do wonder if I'm just being overly paranoid, though.
Al, do you have any opinions, here?
Cheers,
Jeff
next prev parent reply other threads:[~2016-03-21 20:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 21:10 [patch] direct-io: propagate -ENOSPC errors Jeff Moyer
2016-03-16 13:25 ` Carlos Maiolino
2016-03-21 16:02 ` Christoph Hellwig
2016-03-21 20:22 ` Jeff Moyer [this message]
2016-04-21 14:17 ` Todd Vierling
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=x491t7360p3.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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).