lkml.org 
[lkml]   [2000]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectone-line umount patch needed for am-utils
Hi Alan,

The patch included below allows the kernel to unmount a filesystem whose
root entry is a symlink.

Let me give you a bit of background. In addition to more common 2-level
indirect mounts (also provided by autofs), amd allows for the so-called
"direct mounts". They are implemented by mounting an amd-provided NFS
filesystem with only one entry: the root "directory", which is in fact a
symlink. Upon readlink, amd mounts the real (remote) NFS filesystem
somewhere else and makes the symlink point to the real mountpoint.

It's kind of silly and an abuse of the VFS, I agree. Unfortunately, it's
been around for a while, it works on other systems and real people are
using it. And they get a nasty surprise when they try it on Linux: the
amd-provided NFS filesystems cannot be unmounted, because the VFS umount
code follows the root symlink.

The patch fixes this by replacing the namei() in sys_umount with a
lnamei() which doesn't follow symlinks at the end of the chain. It has
been tested, and it does solve the amd problem. It does not break
anything else, at least in my testing, and the change makes sense.

Al, I'm cc:-ing you because this is basically your turf. Please let us
know if you have any objections to the patch. The same change (different
code though) is also needed for 2.4, by the way.

Thanks,
Ion

--
It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.

-------------------
--- linux-2.2.17/fs/super.c.old Thu Sep 28 01:26:42 2000
+++ linux-2.2.17/fs/super.c Thu Sep 28 01:21:20 2000
@@ -782,7 +782,7 @@
return -EPERM;

lock_kernel();
- dentry = namei(name);
+ dentry = lnamei(name);
retval = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
struct inode * inode = dentry->d_inode;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.028 / U:4.520 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site