From f024ede06f19b8d0db0cd641b1609b76d91bef22 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 16 Mar 2011 02:45:02 -0400 Subject: [PATCH] --- yaml --- r: 234937 b: refs/heads/master c: 0e794589e588a88d34e339feee50c72606fb21a7 h: refs/heads/master i: 234935: 02b02187b946c9d6a0461b7afc2a265f77398db0 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index ea442546dc51..eeb021ec5a99 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d10902812c9cd5583130a4ebb9ad19c60b68149d +refs/heads/master: 0e794589e588a88d34e339feee50c72606fb21a7 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 0a601cae23de..b912b7abe747 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -753,9 +753,11 @@ follow_link(struct path *link, struct nameidata *nd, void **p) BUG_ON(nd->flags & LOOKUP_RCU); + if (link->mnt == nd->path.mnt) + mntget(link->mnt); + if (unlikely(current->total_link_count >= 40)) { *p = ERR_PTR(-ELOOP); /* no ->put_link(), please */ - path_put_conditional(link, nd); path_put(&nd->path); return -ELOOP; } @@ -765,9 +767,6 @@ follow_link(struct path *link, struct nameidata *nd, void **p) touch_atime(link->mnt, dentry); nd_set_link(nd, NULL); - if (link->mnt == nd->path.mnt) - mntget(link->mnt); - error = security_inode_follow_link(link->dentry, nd); if (error) { *p = ERR_PTR(error); /* no ->put_link(), please */