From c64e6c3278a2127901d551c412bfd404433b77e8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 6 Jun 2005 13:36:08 -0700 Subject: [PATCH] --- yaml --- r: 1851 b: refs/heads/master c: a15a3f6fc67d910f43098acec6e19d25a37d7cb9 h: refs/heads/master i: 1849: 3261495ec166993af62462d0bab629c745c42faf 1847: 1ec104bdd9ed78dd809194097836dfdf541a082b v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9719fed10197..dad69b4eba26 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2f12dbfbb6286c725c283a169f8f05e89a86848b +refs/heads/master: a15a3f6fc67d910f43098acec6e19d25a37d7cb9 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 907a3f2b4c9c..37fcf941fa3f 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1506,8 +1506,6 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) mntput(path.mnt); goto exit; } - mntput(nd->mnt); - nd->mnt = path.mnt; } error = -ENOENT; if (!path.dentry->d_inode) @@ -1517,6 +1515,9 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) 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 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) 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 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) 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;