Re: fcntl(2) and other file systems like XFS

From: Stephen C. Tweedie (sct@redhat.com)
Date: Tue Mar 21 2000 - 10:51:34 EST


Hi,

On Tue, Mar 21, 2000 at 04:36:10PM +0100, Jamie Lokier wrote:
> > I just too a quick look, and it looks like ioctl can accomplish both
> > just with a little care. In particular you install some kind of
> > wrapper for the inode operations after calling init_special_inode...
>
> I din't think that's a good idea.
>
> What happens when you have /dev on an XFS filesystem, you open a device
> and call a device-specific ioctl()... but it collides with an XFS ioctl
> number.
>
> Something will go wrong, won't it?

Yes. In fact, it's worse than that: to perform either an ioctl or a
fcntl, you need to have a file handle on the inode. But for device
inodes, you cannot open the inode unless the device is present. This
hits us already on ext2: you cannot, for example, do a "chattr +I
/dev/*" to make all /dev inodes immutable, because most of the inodes
present in that directory will not have valid devices (just how many
people do you know who use every possible partition number of every
possible scsi, ide, smart, mylex .... device?)

Linus rejected my last patch to allow fs-specific calls to go directly
to the fs by inode rather than by file handle on the grounds that it
was too generic --- he hated the ioctl-style of overloaded interface.
With decent APIs for specific functionality, we should be able to get
something in place, however.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:33 EST