From 3153cbe11719f39c92c4dfd2ab0ea4bc1c1fe758 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 6 Jun 2005 13:36:10 -0700 Subject: [PATCH] --- yaml --- r: 1853 b: refs/heads/master c: 4b7b9772e4c3d87e649d4c419d2487aacf1235aa h: refs/heads/master i: 1851: c64e6c3278a2127901d551c412bfd404433b77e8 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 90894b6f71c1..c0a145d22524 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ba7a4c1a76f56c607560f1676680ff491747bdae +refs/heads/master: 4b7b9772e4c3d87e649d4c419d2487aacf1235aa diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 5153f57ee6b3..411bb3243c36 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -543,11 +543,15 @@ 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(nd->mnt); err = __do_follow_link(path, nd); current->link_count--; nd->depth--; return err; loop: + if (path->mnt != nd->mnt) + mntput(nd->mnt); dput(path->dentry); path_release(nd); return err; @@ -801,8 +805,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd) goto out_dput; if (inode->i_op->follow_link) { - if (nd->mnt != next.mnt) - mntput(nd->mnt); err = do_follow_link(&next, nd); if (err) goto return_err; @@ -856,8 +858,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd) inode = next.dentry->d_inode; if ((lookup_flags & LOOKUP_FOLLOW) && inode && inode->i_op && inode->i_op->follow_link) { - if (next.mnt != nd->mnt) - mntput(nd->mnt); err = do_follow_link(&next, nd); if (err) goto return_err;