From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:42594 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018AbeEMWuM (ORCPT ); Sun, 13 May 2018 18:50:12 -0400 Date: Sun, 13 May 2018 23:50:10 +0100 From: Al Viro To: Amir Goldstein Cc: linux-fsdevel , Miklos Szeredi Subject: Re: [RFC][PATCH] ovl_create_index(): vfs_mkdir() might succeed leaving dentry negative unhashed Message-ID: <20180513225010.GZ30522@ZenIV.linux.org.uk> References: <20180512012557.GJ30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, May 12, 2018 at 07:49:21AM +0300, Amir Goldstein wrote: > :-/ this pattern is too nasty to be open codes twice in ovl and > once in knfsd. > For ovl, we can hoist this into the ovl_do_mkdir() helper, but > what filesystems really need is vfs_mkdir_hashed(), then knfsd > can use it as well. Not really - handling of that case is really different for different callers, especially if you look into the "it's managed to disappear in between ->mkdir and ->lookup" case. Passing by reference seriously limits what the callers can do; if it works for overlayfs, more power to you, but it's not a good general-purpose helper.