From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754103AbaI2TE1 (ORCPT ); Mon, 29 Sep 2014 15:04:27 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:53347 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbaI2TE0 (ORCPT ); Mon, 29 Sep 2014 15:04:26 -0400 Date: Mon, 29 Sep 2014 20:04:21 +0100 From: Al Viro To: Linus Torvalds Cc: Linux Kernel Mailing List , linux-fsdevel , "Paul E. McKenney" , Mikhail Efremov Subject: Re: [PATCH v2] vfs: Don't exchange "short" filenames unconditionally. Message-ID: <20140929190421.GK7996@ZenIV.linux.org.uk> References: <20140927183139.GT7996@ZenIV.linux.org.uk> <20140927191657.GU7996@ZenIV.linux.org.uk> <20140928074747.GZ7996@ZenIV.linux.org.uk> <20140928180556.GA7996@ZenIV.linux.org.uk> <20140929155918.GG7996@ZenIV.linux.org.uk> <20140929162714.GH7996@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Sep 29, 2014 at 10:54:59AM -0700, Linus Torvalds wrote: > On Mon, Sep 29, 2014 at 9:27 AM, Al Viro wrote: > > > > What we get in free_dentry() is: > > * external name not shared: refcount driven to 0, RCU-delayed > > call of "free dentry, free ext name" > > * external name still shared: refcount positive after decrement, > > no freeing ext name > > * no external name: no ext name to free > > In the last two cases we do what dentry_free() used to do, except that now > > __d_free() doesn't even look for ext name. Just frees the dentry. If > > it never had been hashed - directly called, otherwise - via call_rcu(). > > > > Does that look OK for you? > > Yes. That looks fairly straightforward. > > Although please rename that "ext" in ext_name/__d_free_ext() to > something else. "ext" to me says not "external", but "extended". I > think we can just write out "external", like we already do in > "dname_external()". That we do... Why is it in dcache.h, BTW? No users outside of fs/dcache.c and I can't imagine a valid use for it in a module, let alone out-of-tree one... ObAnnoyance: gcc not figuring out that this container_of() isn't going to be NULL... Sure, somebody might put (char *)16 into dentry->d_name.name, but... As it is, it makes for messier code generation; I can work around that, of course, but it's uglier than it ought to be ;-/ OK, see vfs.git#copy_name. Warning: it does need testing. Two commits in there, one adding data dependency barrier in prepend_name(), another - this thing. Comments would be welcome...