mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Montague <monty@gg.caltech.edu>
To: linux-kernel@vger.kernel.org
Subject: 2.4.6 mount behavior changed (graft_tree in fs/super.c)
Date: Thu, 12 Jul 2001 20:50:38 -0700	[thread overview]
Message-ID: <200107130350.UAA28646@muggy.gg.caltech.edu> (raw)

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


                 reply	other threads:[~2001-07-13  3:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200107130350.UAA28646@muggy.gg.caltech.edu \
    --to=monty@gg.caltech.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monty@druggist.gg.caltech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®