Hmm.
I like the thought, but I don't like much of the implementation.
I'd prefer:
- your MNT_DETACH thing is a "umount" flag, and I think that is
fundamentally flawed. It's a separate operation entirely. If we want to
root-hop, what we should do is rather simple:
- detach the trees and haev two trees. This is not the same as
"umount" at all, this is really just
struct dentry *mnt = dentry_lookup("new_root_path");
struct dentry *covered = mnt->d_covers;
mnt->d_covers = mnt; /* New root, no longer covering anything */
covered->d_mounts = covered; /* Old mount-point, no longer attached */
dput(covered);
dput(mnt);
and you're done. You now have two trees, neither of which has
really been unmounted.
- Now that the old root has been detached, NOW you can just try to
unmount it: it's a perfectly regular unmount() at this point, and it
will fail if it is busy.
I don't think your "complicate the normal umount with new flags" approach
is needed at all.
Also, /proc/mounts should just use the dentry and the path lookup function
(d_path()) to create the /proc/mounts output on-the-fly, and that will get
the name right whatever happens (_including_ a rename of the whole
mount-point path, which neither the current approach nor your approach
gets right at all.
Linus
-
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/