From: Bernd Schubert Subject: Re: [RFC] ->encode_fh() and related breakage Date: Mon, 09 Jan 2012 14:55:04 +0100 Message-ID: <4F0AF1B8.8030903@itwm.fraunhofer.de> References: <20111230062719.GU23916@ZenIV.linux.org.uk> <20111230075714.GV23916@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andreas Dilger , linux-fsdevel@vger.kernel.org, Linus Torvalds , Sage Weil , Dan Magenheimer To: Al Viro Return-path: Received: from mailgw1.uni-kl.de ([131.246.120.220]:37705 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249Ab2AINzL (ORCPT ); Mon, 9 Jan 2012 08:55:11 -0500 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q09Dt8J8027760 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Mon, 9 Jan 2012 14:55:09 +0100 In-Reply-To: <20111230075714.GV23916@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 12/30/2011 08:57 AM, Al Viro wrote: > On Fri, Dec 30, 2011 at 01:14:16AM -0600, Andreas Dilger wrote: >> On 2011-12-30, at 12:27 AM, Al Viro wrote: >>> One kinda-sorta solution (besides kicking cleancache out of tree) >>> would be to modify ->encode_fh() API - instead of dentry + connectable >>> pass it inode + NULL-or-parent-inode, with ->d_lock held by caller. And >>> demand it to be non-blocking, obviously... It would obviously break >>> ceph ->encode_fh(), since that sucker apparently wants the name of last >>> component anyway. OTOH, that's broken for reasons mentioned above. >>> OTTH, fhandle encoding is bloody close to user-visible ABI ;-/ >> >> Is it possible to always pass d_parent if this is available, rather than >> only if @connectable is passed? For network filesystems re-exporting NFS >> it is desirable to always be passed the parent directory. > > Even without check_subtree on the export? Whatever the hell for? > Note that using the parent means broken rename() - fhandles will be > changed when file gets moved from one directory to another. It's > exactly what is asked for in case of check_subtree, but otherwise it's > an obvious misfeature. _And_ it costs extra locking and extra work > on decode_fh side... > > I obviously looked only at the in-tree filesystems; out-of-tree code might > be doing very weird things, up to and including ROT13 of uuencoded UTF16 > representation of pathname stored in fhandle. And yes, fh representation > is too close to being a part of ABI for comfort, but then it's an ABI > exported by out-of-tree code, so I'm not going to worry too much about > its stability... > > "desirable for network filesystems" is too damn vague; could you give more > details? FhGFS has the distributed metadata feature, where the parent directory identifies the corresponding metadata server of a dentry. I guess other parallel filesystems might take the same approach. Cheers, Bernd -- Bernd Schubert Fraunhofer ITWM