Re: [patch 01/10] vfs: add path_create() and path_mknod()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Erez Zadok
Date: Thursday, April 3, 2008 - 4:24 pm

In message <20080403023239.GY9785@ZenIV.linux.org.uk>, Al Viro writes:

It doesn't prevent umount -l; but it prevents the lower superblock from
being kfree()d if there were no references left to it, so I don't try to
accessed freed memory (and get 6b6b6b6b oopses :-)


How much of nameidata will still need to be passed to f/s ops?  How many vfs
helpers will still require a nameidata?  Hopefully as few as possible.

Is this preallocated struct file a replacement to the nd->intent.open.file
that could have returned an allocated struct file?  (I could never really
tell what's the right thing to do with that field.)


I said above "intents are indeed very useful" only because they were:

1. required to be passed to vfs_* methods, which made it hard if the ->op I
   was in didn't have an intent (I have to create temp intents for those).

2. apparently heavily used in nfs4, to a point where if I stacked on nfs4
   and didn't pass a correctly formatted nameidata, I'd get an oops deep
   inside nfs4 code.  (I think some of those nfs4 requirements went away,
   not sure what's left.).


I'll have to take a closer look at vfsmount tree snapshotting and
collect_mounts() before I can say how useful they'd be.  But if you recall
my questions at LSF, I asked whether it was possible for me to create a
readonly directory tree (e.g., r-o bind mounts) or some form of an immutable
namespace that no one can modify underneath me.  You said that r-o bind
mounts were not intended for that.

Right now I'm allowing users to modify lower branches, with all the pros and
cons that it has.  But even if I wanted to prevent users from touching any
lower files below a certain directory, while allowing only unionfs to modify
those files, it doesn't appear that there's something available I could use.


I have two other questions/requests:

1. The less I have to use or know about vfsmounts and nameidata/intents, the
   better.  But whatever API changes you make, please consider the symmetry
   between the f/s ->op I'm called with, and the vfs helpers I might use in
   the ->op to pass through to the lower f/s.  Ideally the prototypes of the
   ->op and vfs helpers be identical, so I don't have to work too hard to
   locate the lower objects, or worse, having to make them up temporarily.

2. You mentioned that all this work is scheduled for 26.  25 is nearing
   release.  Do you have code already that I can experiment with?  A preview
   of things to come?  Maybe an example or two of how a filesystem
   (stackable, nfsd, or otherwise) should lookup and open arbitrary files?
   What you mentioned in this discussion thread sounds promising and
   exciting, but may take me a while to apply to my tree (longer than the
   usual merge window, which reportedly will shrink even further, now that
   we have linux-next :-).  So the more lead time, the better, please.

Thanks,
Erez.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 01/10] vfs: add path_create() and path_mknod(), Miklos Szeredi, (Wed Apr 2, 1:12 pm)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Miklos Szeredi, (Wed Apr 2, 2:11 pm)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Trond Myklebust, (Wed Apr 2, 3:21 pm)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Trond Myklebust, (Wed Apr 2, 4:19 pm)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Trond Myklebust, (Wed Apr 2, 5:42 pm)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Miklos Szeredi, (Thu Apr 3, 12:32 am)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Stephen Smalley, (Thu Apr 3, 5:33 am)
Re: [patch 01/10] vfs: add path_create() and path_mknod() , Erez Zadok, (Thu Apr 3, 4:24 pm)
Re: [patch 01/10] vfs: add path_create() and path_mknod(), Miklos Szeredi, (Fri Apr 4, 4:04 am)