From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [git pull] VFS - the first pile Date: Wed, 16 Mar 2011 06:51:03 +0000 Message-ID: <20110316065103.GP22723@ZenIV.linux.org.uk> References: <20110315213248.GL22723@ZenIV.linux.org.uk> <20110316061917.GA30195@dastard> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Dave Chinner Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:38371 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686Ab1CPGvK (ORCPT ); Wed, 16 Mar 2011 02:51:10 -0400 Content-Disposition: inline In-Reply-To: <20110316061917.GA30195@dastard> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Mar 16, 2011 at 05:19:17PM +1100, Dave Chinner wrote: > I think there's something not quite right in this tree. xfstests 005 > (nested symlink test) fails on both ext4 and XFS with the following: Yeah... Brown paperbag time - it's actually a missing piece that got glued with a commit a bit later in queue ;-/ I've dropped it into for-linus for the morning push; in the meanwhile, the patch is below. diff --git a/fs/namei.c b/fs/namei.c index 0a601ca..b912b7a 100644 --- a/fs/namei.c +++ b/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 */