From feda4af2a32963835582ea4e9490286ce6aafda2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 6 Jun 2005 13:36:12 -0700 Subject: [PATCH] --- yaml --- r: 1855 b: refs/heads/master c: 39ca6d49759346d4710c759d443eec8048b27213 h: refs/heads/master i: 1853: 3153cbe11719f39c92c4dfd2ab0ea4bc1c1fe758 1851: c64e6c3278a2127901d551c412bfd404433b77e8 1847: 1ec104bdd9ed78dd809194097836dfdf541a082b 1839: 4655176f3af5f8a4a5db49d384940a86605912d4 1823: a6d42113900b2ac1f53cb6c1780bd5d210a3f6dd 1791: 2d308cfa23ba972d80b5f43fd314fa8c2da39603 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 936a09d56661..8dbee4493e7e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d9d29a29669f96903d9950bb881c2a393fd33849 +refs/heads/master: 39ca6d49759346d4710c759d443eec8048b27213 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 6a884682b0a7..444086d441e1 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -506,7 +506,8 @@ static inline int __do_follow_link(struct path *path, struct nameidata *nd) touch_atime(nd->mnt, dentry); nd_set_link(nd, NULL); - mntget(path->mnt); + if (path->mnt == nd->mnt) + mntget(path->mnt); error = dentry->d_inode->i_op->follow_link(dentry, nd); if (!error) { char *s = nd_get_link(nd); @@ -543,8 +544,6 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd) current->link_count++; current->total_link_count++; nd->depth++; - if (path->mnt != nd->mnt) - mntput(path->mnt); err = __do_follow_link(path, nd); current->link_count--; nd->depth--; @@ -1550,8 +1549,6 @@ 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(path.mnt); error = __do_follow_link(&path, nd); if (error) return error;