From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH v3 1/1] dcache: Translating dentry into pathname without taking rename_lock Date: Sat, 7 Sep 2013 18:32:43 +0100 Message-ID: <20130907173243.GD13318@ZenIV.linux.org.uk> References: <1378483738-10129-1-git-send-email-Waiman.Long@hp.com> <1378483738-10129-2-git-send-email-Waiman.Long@hp.com> <20130906210546.GW13318@ZenIV.linux.org.uk> <20130907000044.GX13318@ZenIV.linux.org.uk> <20130907030110.GY13318@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Waiman Long , linux-fsdevel , Linux Kernel Mailing List , "Chandramouleeswaran, Aswin" , "Norton, Scott J" , George Spelvin , John Stoffel , Sage Weil , Ian Kent To: Linus Torvalds Return-path: Content-Disposition: inline In-Reply-To: <20130907030110.GY13318@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, Sep 07, 2013 at 04:01:10AM +0100, Al Viro wrote: > * plain seqretry loop (d_lookup(), is_subdir(), autofs4_getpath(), > ceph_misc_build_path(), [cifs] build_path_from_dentry(), nfs_path(), _mds_, actually - sorry. > [audit] handle_path()) > * try seqretry once, then switch to write_seqlock() (the things > that got unified into d_walk()) > * try seqretry three times, then switch to write_seqlock() (d_path() > and friends) > * several pure write_seqlock() users (d_move(), d_set_mounted(), > d_materialize_unique()) BTW, autofs4_getpath() looks really odd: static int autofs4_getpath(struct autofs_sb_info *sbi, struct dentry *dentry, char **name) and *name is never modified in it. Why not simply pass it by value? Moreover, I'm not sure I understand what do we need sbi->fs_lock in there. Other than that, it's very close to dentry_path() (well, that and different calling conventions). Ian? ceph_mds_build_path() is similar, but it does kmalloc to store the result and grabs ->d_lock for ->d_name protection. This one, BTW, is much more likely to get stalls - it ends up doing kmalloc on each attempt (after having calculated the current length). Bugger if I understand what's wrong with simply grabbing a page and doing that once - before everything else... build_path_from_dentry() - same story, might very well have been the source of ceph_mds_build_path(). nfs_path() - not far from open-coded dentry_path() with some postprocessing, uses ->d_lock for ->d_name protection.