From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 47/79] namei: move link/cookie pairs into nameidata Date: Wed, 6 May 2015 08:22:15 +0100 Message-ID: <20150506072215.GW889@ZenIV.linux.org.uk> References: <20150505052205.GS889@ZenIV.linux.org.uk> <1430803373-4948-47-git-send-email-viro@ZenIV.linux.org.uk> <20150506124254.5c28e4c6@notabene.brown> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: NeilBrown Return-path: Content-Disposition: inline In-Reply-To: <20150506124254.5c28e4c6@notabene.brown> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, May 06, 2015 at 12:42:54PM +1000, NeilBrown wrote: > > static int link_path_walk(const char *name, struct nameidata *nd) > > { > > - struct saved { > > - struct path link; > > - void *cookie; > > - const char *name; > > - } stack[MAX_NESTED_LINKS], *last = stack + nd->depth - 1; > > + struct saved *last = nd->stack; > > This looks wrong. 'last' used to be dependent on nd->depth, now it isn't. On the entry to link_path_walk() we have nd->depth == 0. And nd->depth and last are changed in sync.