* 2.4.6 mount behavior changed (graft_tree in fs/super.c)
@ 2001-07-13 3:50 Mark Montague
0 siblings, 0 replies; only message in thread
From: Mark Montague @ 2001-07-13 3:50 UTC (permalink / raw)
To: linux-kernel
For some reason, NFS has traditionally been happy mounting a plain
file on a directory, but hasn't liked mount points that aren't
directories. Although I have no idea why this is, I've been using it
to mount just one file from an NFS server.
The vfs changes in 2.4.6 now will *only* mount a file on a file, and a
directory on a directory, which, although it kinda makes more sense,
doesn't agree with mount(2):
ENOTDIR
The second argument, or a prefix of the first argu
ment, is not a directory.
For what it's worth, HPUX 10.20's, IRIX 6.5's, and SunOS 5.7's
mount(2)s agree with the man page. I don't know if the change breaks
POSIXly-correctness, but for consistency with other OSes, it seems
like the old behavior, while bizarre, is desirable.
I'm not supplying a real patch because I suspect that the fact that
graft_tree is called from two contexts makes fiddling there fraught
with peril, and I don't have time to test it right now, but I think
this patch will return mount to its old behavior (and will do
something random and possibly horrible to loopback mounts, and may not
be consistent with NFS, and probably causes cancer):
--- super.c.orig Thu Jul 12 20:42:08 2001
+++ super.c Thu Jul 12 20:47:51 2001
@@ -422,8 +422,7 @@
static int graft_tree(struct vfsmount *mnt, struct nameidata *nd)
{
- if (S_ISDIR(nd->dentry->d_inode->i_mode) !=
- S_ISDIR(mnt->mnt_root->d_inode->i_mode))
+ if ((!S_ISDIR(nd->dentry->d_inode->i_mode))
return -ENOTDIR;
down(&nd->dentry->d_inode->i_zombie);
shrug
- M
--
Mark "Monty" Montague | monty@gg.caltech.edu | I don't do Windows(tm)
main(){printf("I am self-aware\\n");}
<URL:http://www.gg.caltech.edu/~monty/monty.shtml>
X-PGP-Fingerprint: E4 EA 6D B1 82 46 DB A1 B0 FF 60 B9 F9 5D 5C F7
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-13 3:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-13 3:50 2.4.6 mount behavior changed (graft_tree in fs/super.c) Mark Montague
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®