lkml.org 
[lkml]   [2009]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 00/17] [RFC] AFS: Implement OpenAFS pioctls(version)s


On Wed, 17 Jun 2009, David Howells wrote:

> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > > What about opening the mountpoint (which HAS to be available) and then
> > > calling an ioctl() on that?
> >
> > It's very hard to "open the mountpoint" in user space. How would you even
> > do it? Remember: we're not living in the 1980's any more, and disco is
> > dead. ABBA may have made a comeback, but static mountpoints are long gone,
> > and won't be coming back.
>
> I think what Andreas means is open the directory at the root of the mounted
> tree, i.e. "/afs" for AFS, and then do an ioctl() on that that emulates
> pioctl().

I agree that that is what he means.

What _I_ mean is that THIS IS IMPOSSIBLE TO DO FROM USER SPACE!

Try it. Not doable. User space simply doesn't know enough, and has
fundamental races with mount/umount.

Sure, you can try to do it by trying to parse the pathname and looking in
/etc/mtab or /proc/mounts. And I guarantee that the end result will be a
buggy pile of sh*t.

End result: you do need a new system call.

I just don't think "pioctl()" is a good one. You'd be better off with some
modification of open and then use ioctl.

Linus


\
 
 \ /
  Last update: 2009-10-18 23:28    [W:1.999 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site