This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] fs: reject unknown open flags
- From: Linus Torvalds <torvalds at linux-foundation dot org>
- To: Christoph Hellwig <hch at lst dot de>
- Cc: Alexander Viro <viro at zeniv dot linux dot org dot uk>, Linux API <linux-api at vger dot kernel dot org>, linux-fsdevel <linux-fsdevel at vger dot kernel dot org>, Linux Kernel Mailing List <linux-kernel at vger dot kernel dot org>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 30 Mar 2017 10:03:24 -0700
- Subject: Re: [PATCH 2/2] fs: reject unknown open flags
- Authentication-results: sourceware.org; auth=none
- References: <20170330163327.23920-1-hch@lst.de> <20170330163327.23920-3-hch@lst.de>
On Thu, Mar 30, 2017 at 9:33 AM, Christoph Hellwig <hch@lst.de> wrote:
> This way userspace can probe for actually supported flags.
No. Not this way.
First off, since we've never checked the flags, it really is likely
that somebody just by mistake passes in garbage.
So it might cause a regression, which means we might need to revert
it, which in turn means that we sure as hell do *not* want to
encourage _other_ people to then use this to "probe" the accepted
flags.
Secondly, since we know old kernels don't test the flags, it is
*doubly* stupid to then talk about "probing accepted flags".
So the whole concept of probing is pure and utter f*cking garbage.
So get that idiotic idea out of your head.
What might be acceptable is to say "we should have not accepted random
flags to begin with", and add this error case, but realize that
probing for those flags is completely idiotic and moronic.
Once you do that, you can then say "to make it easier to see if
somebody might have passed in garbage that just happened to work, we
can add a WARN_ON_ONCE()" for this case. That has the added advantage
that it hopefully makes people understand just how stipid that idiotic
"probe flags" idea was.
Anyway, big NAK on this idiotic patch series, since as is the whole
concept and reasoning for it is crazy crap.
People, you need to really understand and INTERNALIZE that backwards
compatibility is important.
You need to understand it so well that you go "wow, this whole idea
about probing was obviously shit".
Really.
Linus