public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Waychison <michael.waychison@sun.com>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.5.72: follow_mount / follow_link
Date: Tue, 24 Jun 2003 10:41:59 -0400	[thread overview]
Message-ID: <3EF86337.1020103@sun.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

Hi Al,

When a follow_link dentry call is made, the implementation expects the 
dentry to be followed as well as a nameidata struct to be filled in. 
The received nd->mnt is expected to contain the vfsmount of the dentry 
being followed, so that a subsequent call to vfs_follow_link may 
properly pivot off that mount and onto another vfsmount as the path of 
the link is walked, thus keeping reference counts proper.

The changes made in fs/namei.c@1.42 break this behaviour iff the dentry 
being follow_link'ed is a root dentry.  This is because follow_mount 
follows down next.mnt and not nd->mnt like it used to.  So, if a root 
dentry has a follow_link op, the nd->mnt it receives is in fact the 
vfsmount of the mount it is mounted upon (which breaks reference counts).

Please apply the attached patch which was made against 2.5.72.

Thanks,

Mike Waychison

[-- Attachment #2: ndmnt.patch --]
[-- Type: text/plain, Size: 1178 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1348  -> 1.1349 
#	          fs/namei.c	1.76    -> 1.77   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/23	mikew@nisserv.test.com	1.1349
# namei.c:
#   nameidata should have the mnt we are looking at when doing a follow_link after a follow_mount
# --------------------------------------------
#
diff -Nru a/fs/namei.c b/fs/namei.c
--- a/fs/namei.c	Tue Jun 24 13:29:37 2003
+++ b/fs/namei.c	Tue Jun 24 13:29:37 2003
@@ -655,6 +655,7 @@
 
 		if (inode->i_op->follow_link) {
 			mntget(next.mnt);
+		        nd->mnt = next.mnt;
 			err = do_follow_link(next.dentry, nd);
 			dput(next.dentry);
 			mntput(next.mnt);
@@ -708,6 +709,7 @@
 		if ((lookup_flags & LOOKUP_FOLLOW)
 		    && inode && inode->i_op && inode->i_op->follow_link) {
 			mntget(next.mnt);
+		        nd->mnt = next.mnt;
 			err = do_follow_link(next.dentry, nd);
 			dput(next.dentry);
 			mntput(next.mnt);

             reply	other threads:[~2003-06-24 14:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-24 14:41 Mike Waychison [this message]
2003-06-24 14:54 ` [PATCH] 2.5.72: follow_mount / follow_link viro
2003-06-24 15:42   ` H. Peter Anvin
2003-06-24 23:50     ` jlnance
2003-06-25  0:00       ` H. Peter Anvin
2003-06-25  0:07       ` H. Peter Anvin

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=3EF86337.1020103@sun.com \
    --to=michael.waychison@sun.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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