From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Hudec Subject: Re: a problem with dget Date: Wed, 26 Mar 2003 10:57:20 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030326095720.GF24147@vagabond> References: <20030326092320.GB24147@vagabond> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Hudec , linux-fsdevel@vger.kernel.org Return-path: To: Nir Tzachar Content-Disposition: inline In-Reply-To: List-Id: linux-fsdevel.vger.kernel.org On Wed, Mar 26, 2003 at 11:45:22AM +0200, Nir Tzachar wrote: > > Isn't that the little confusing semanticsof lookup that's biting you? > > When ->lookup returns non-NULL, real_lookup (the caller) puts the dentry > > passed to ->lookup. So if you fill it in, you must return NULL and *NOT* > > the dentry you recieved! > > > > > the problem happens every time i try to do a dget an any dentry. > > > > Yes, because you need to hold a reference to do dget. > > > > thanks, this was my problem exactly. > > anyway, who uses these semantics? which f/s needs to reallocate a dentry > and discards the one supplied to it? and why? I think NFS may cause any filesystem to need this. The problem is, that when a partition is exported, disconnected entries may appear (created by fh_to_dentry). When/if these entries are then looked up, they should be connected. This semantics migh be used to do the connecting (it's not necessary, but it's a useful optimization). ------------------------------------------------------------------------------- Jan 'Bulb' Hudec