From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755567AbbCPWdt (ORCPT ); Mon, 16 Mar 2015 18:33:49 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:34610 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755331AbbCPWdr (ORCPT ); Mon, 16 Mar 2015 18:33:47 -0400 Date: Mon, 16 Mar 2015 22:33:45 +0000 From: Al Viro To: NeilBrown Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/13] VFS/namei: new flag to support RCU symlinks: LOOKUP_LINK_RCU. Message-ID: <20150316223345.GD29656@ZenIV.linux.org.uk> References: <20150316043602.23648.52734.stgit@notabene.brown> <20150316044320.23648.45500.stgit@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150316044320.23648.45500.stgit@notabene.brown> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 16, 2015 at 03:43:20PM +1100, NeilBrown wrote: > When we support ->follow_link in RCU-walk we will not want to > take a reference to the 'struct path *link' passed to follow_link, > and correspondingly will not want to drop that reference. > > As link_path_walk will complete_walk() in the case of an error, > and as complete_walk() will clear LOOKUP_RCU, we cannot test > LOOKUP_RCU to determine if the path should be 'put'. > > So introduce a new flag: LOOKUP_LINK_RCU. This is set on > entry to follow_link() if appropriate and put_link() will > only call path_put() if it is clear. Umm... How is it different from nd->depth > 0 && nd->flags & LOOKUP_RCU? IOW, could we bump nd->depth before that (conditional) mntget()?