From: "Drokin, Oleg" Subject: Re: [RFC] lustre treatment of dentry->d_name Date: Wed, 22 Oct 2014 01:48:48 +0000 Message-ID: References: <20141021011346.GP7996@ZenIV.linux.org.uk> <20141021040210.GR7996@ZenIV.linux.org.uk> <01AC4DD5-3DA1-4C98-BED3-B009AAF8C951@intel.com> <20141021211710.GV7996@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Cc: "Hammond, John" , "linux-fsdevel@vger.kernel.org" , "Dilger, Andreas" To: Al Viro Return-path: Received: from mga02.intel.com ([134.134.136.20]:3004 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752986AbaJVBsv convert rfc822-to-8bit (ORCPT ); Tue, 21 Oct 2014 21:48:51 -0400 In-Reply-To: <20141021211710.GV7996@ZenIV.linux.org.uk> Content-Language: en-US Content-ID: <0E83178E22839A419229AF6D1EE7E4C1@intel.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Oct 21, 2014, at 5:17 PM, Al Viro wrote: >>> Another question: what's wrong with d_splice_alias() or d_materialise_unique()? >>> I.e. why do we need ll_splice_alias()? I have patches in local queue >> >> We used to need it to also find and reuse invalid aliases, so that the dentry >> cache does not get out of control with constant dentry invalidations we have. >> >> I checked the code and now that d_splice_alias is calling __d_find_any_alias >> that seems to just pick the first alias off the list, we should be fine > > ITYM "the one and only". That's pretty much what d_splice_alias() is about - > we do not allow more than one dentry (be it hashed or not) for a directory > inode, so d_add() variant that can run into directory inode already with a > dentry _must_ use that existing dentry instead of what it's been given. > That's why we need it to be able to move a preexisting dentry in place of > the one it's been given and return a new reference to that preexisting > dentry. For non-directories and for directories that have no aliases it's > just d_add() and return NULL. Ah! I see now. We do the "pick alias from a list" for everything, not just for the directories. So that difference is still missing and as such there is a fear if we convert to d_splice_alias in its current form, dcache would explode from all the gazillions of invalid and unhashed dentries we produce during operations. >> with just using generic d_splice_alias. > BTW, mind if we kill ll_umode_t? This kind of compat wrappers is the wrong > way - it should be "supply an equivalent of more recent kernel stuff when > builds on older kernels". Right. I have no problems with killing it since such a compat define is not needed in current kernel anyway.