linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Theodore Ts'o <tytso@mit.edu>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	Robert Edmonds <edmonds@debian.org>,
	Rob Browning <rlb@defaultvalue.org>
Subject: Re: Argument type for FS_IOC_GETFLAGS/FS_IOC_SETFLAGS ioctls
Date: Thu, 28 Nov 2013 00:14:30 +0100	[thread overview]
Message-ID: <20131127231430.GG29912@hall.aurel32.net> (raw)
In-Reply-To: <20131127133437.GB19941@thunk.org>

On Wed, Nov 27, 2013 at 08:34:37AM -0500, Theodore Ts'o wrote:
> On Wed, Nov 27, 2013 at 11:03:47AM +0100, Aurelien Jarno wrote:
> > In my case, I am *not* talking about FUSE code, but programs using this
> > ioctl from userland. Changing the kernel FUSE code won't fix the problem
> > I reported.
> 
> I wasn't aware of the fact that there were broken userspace programs
> up until now --- and things have like this for well over a decade,
> with no one complaining until now, which gives you a hint about how
> prevelant this problem actually is.
> 
> > People who do the things correctly lookup the argument type in
> > <linux/fs.h>, they see it's a long and then use a long in their code. And
> > they are right. The bare minimum would be to add a comment close to the
> > definition to explain to use an int and not a long.
> 
> The documentation is specifies the FS_IOC_GETFLAGS and FS_IOC_SETFLAGS
> takes an int * and int, respectively, in the ioctl_list man page.  As

The ioctl_list man page is outdated and only lists the EXT2 equivalent.
Thus people looking for FS_IOC_GETFLAGS or FS_IOC_SETFLAGS might not
find them that easily.

> far as the "self documenting" ioctl numbering is concerned, I've
> always considered it "mostly harmless", but never as authoratative

On the other hand it's the only real documentation available for these
ioctls (see above).

> documentation.  Hence, trying to use words such as "right" or "wrong"
> is not particularly interested as far as I'm concerned.  (I'm reminded
> of the story of the time when Richard Stallman blindly steped into the
> crosswalk, and was almost killed by a car running the red light.
> Someone held him back and said, "didn't you see that car?  He would
> have almost killed you!".  To which Richard said, "but he would have
> been in the wrong.")

I mean people are right to look at the documentation and trust it
instead of trying to guess by looking random pages on the web. The
problem is that the documentation doesn't match the implementation.

> In any case, sure, we can add a documentation to the header file in
> the kernel sources, and the glibc folks will need to be asked to fix
> up /usr/include/linux/fs.h (which is not the same as the
> include/linux/fs.h in the kernel).  But it doesn't change the fact

I have just sent a patch for the kernel sources. Note that <linux/fs.h>
is *not* provided by the glibc, so there is nothing to fix there, but
rather by the kernel as part of the uapi headers.

> that it is bup and libexplain that will need to be changed, regardless
> of whether they were in the "right" or in the "wrong".  If the sense
> of moral superiority makes them more willing to fix their code, fine.

There is no problem to change these as long as it is clear what choice
they should take. And until now the only real way to make the correct
choice was to look at the kernel sources to see how this argument is
read/written.

Regards,
Aurelien

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  parent reply	other threads:[~2013-11-27 23:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 20:05 Argument type for FS_IOC_GETFLAGS/FS_IOC_SETFLAGS ioctls Aurelien Jarno
2013-11-27  1:01 ` Darrick J. Wong
2013-11-27  4:00   ` Theodore Ts'o
2013-11-27 10:03     ` Aurelien Jarno
2013-11-27 13:34       ` Theodore Ts'o
2013-11-27 18:14         ` Robert Edmonds
2013-11-27 23:14         ` Aurelien Jarno [this message]
2013-11-29  0:53     ` Andreas Dilger
2013-11-29  4:54       ` Theodore Ts'o
2013-11-29  5:27         ` Dave Chinner
2013-11-29 14:22           ` Theodore Ts'o
2013-11-29 16:32             ` Rob Browning
2013-12-01 22:20             ` Dave Chinner
2013-12-02  4:52               ` Theodore Ts'o
2013-12-02 22:30                 ` Dave Chinner
2013-11-29 21:55           ` Andreas Dilger
2013-12-19 18:20   ` Rob Browning
2013-12-19 23:30     ` Darrick J. Wong
2013-11-27 10:15 ` Christoph Hellwig
2014-06-30 22:51   ` Rob Browning

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=20131127231430.GG29912@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=darrick.wong@oracle.com \
    --cc=edmonds@debian.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rlb@defaultvalue.org \
    --cc=tytso@mit.edu \
    --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).