From: Al Viro <viro@www.linux.org.uk>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [CFR][PATCH] namei fixes (12/19)
Date: Thu, 19 May 2005 23:57:01 +0100 [thread overview]
Message-ID: <E1DYtwr-0007sU-Ec@parcelfarce.linux.theplanet.co.uk> (raw)
(12/19)
In open_namei() we take mntput(nd->mnt);nd->mnt=path.mnt; out of the
if (__follow_mount(...)), making it conditional on nd->mnt != path.mnt
instead.
Then we shift the result downstream.
Equivalent transformations.
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
----
diff -urN RC12-rc4-11/fs/namei.c RC12-rc4-12/fs/namei.c
--- RC12-rc4-11/fs/namei.c 2005-05-19 16:39:40.320469292 -0400
+++ RC12-rc4-12/fs/namei.c 2005-05-19 16:39:41.456242973 -0400
@@ -1506,8 +1506,6 @@
mntput(path.mnt);
goto exit;
}
- mntput(nd->mnt);
- nd->mnt = path.mnt;
}
error = -ENOENT;
if (!path.dentry->d_inode)
@@ -1517,6 +1515,9 @@
dput(nd->dentry);
nd->dentry = path.dentry;
+ if (nd->mnt != path.mnt)
+ mntput(nd->mnt);
+ nd->mnt = path.mnt;
error = -EISDIR;
if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode))
goto exit;
@@ -1528,6 +1529,9 @@
exit_dput:
dput(path.dentry);
+ if (nd->mnt != path.mnt)
+ mntput(nd->mnt);
+ nd->mnt = path.mnt;
exit:
path_release(nd);
return error;
@@ -1550,6 +1554,9 @@
error = security_inode_follow_link(path.dentry, nd);
if (error)
goto exit_dput;
+ if (nd->mnt != path.mnt)
+ mntput(nd->mnt);
+ nd->mnt = path.mnt;
error = __do_follow_link(&path, nd);
if (error)
return error;
reply other threads:[~2005-05-19 23:22 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=E1DYtwr-0007sU-Ec@parcelfarce.linux.theplanet.co.uk \
--to=viro@www.linux.org.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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®