From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77D32C04AAF for ; Thu, 16 May 2019 10:35:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40BD220881 for ; Thu, 16 May 2019 10:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558002951; bh=0eo8sI9rv03UK2hDy0Jhg7s2bx/YLgxcOaSorx1Pj+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=YvuYDxdEH6VQIDfrZHsJaB020zfwULYf0uIH8C9Y5e+WMkAOmE4DnJymPtCNQvgTh vOSK0tg6imB+Uk/PbsaPdiJIeeCqb68vVcaMReSHva0MeL/aF4tMAiIUAuRqaulR2b 7OPyvYnHn1j6WPyt2jVyqTyS7+/9GNmW57xBSMLE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbfEPKfu (ORCPT ); Thu, 16 May 2019 06:35:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:48626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbfEPKfu (ORCPT ); Thu, 16 May 2019 06:35:50 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7FE49206BF; Thu, 16 May 2019 10:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558002950; bh=0eo8sI9rv03UK2hDy0Jhg7s2bx/YLgxcOaSorx1Pj+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fpses0/ZDSEdkVfTBYXMyQB0KH6vmk0PamqzVcv5M67FYlvoi3oFnmNQmxvX0jxuO ZsJNd81gTXTtMDw1gVzr5UAdDwBqcyRTCTOHpzd27gqcrmxB+F5lUzbbv5tsmBqnnj ljGb9lELkbNyzCzygyotfNRiEMOj3Xjjg2Gd3YeM= Date: Thu, 16 May 2019 12:35:47 +0200 From: Greg Kroah-Hartman To: Amir Goldstein Cc: Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 06/14] fs: convert debugfs to use simple_remove() helper Message-ID: <20190516103547.GA2125@kroah.com> References: <20190516102641.6574-1-amir73il@gmail.com> <20190516102641.6574-7-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190516102641.6574-7-amir73il@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, May 16, 2019 at 01:26:33PM +0300, Amir Goldstein wrote: > This will allow generating fsnotify delete events after the > fsnotify_nameremove() hook is removed from d_delete(). > > Cc: Greg Kroah-Hartman > Signed-off-by: Amir Goldstein > --- > fs/debugfs/inode.c | 20 ++++---------------- > 1 file changed, 4 insertions(+), 16 deletions(-) > > diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c > index acef14ad53db..bc96198df1d4 100644 > --- a/fs/debugfs/inode.c > +++ b/fs/debugfs/inode.c > @@ -617,13 +617,10 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, > } > EXPORT_SYMBOL_GPL(debugfs_create_symlink); > > -static void __debugfs_remove_file(struct dentry *dentry, struct dentry *parent) > +static void __debugfs_file_removed(struct dentry *dentry) > { > struct debugfs_fsdata *fsd; > > - simple_unlink(d_inode(parent), dentry); > - d_delete(dentry); What happened to this call? Why no unlinking anymore? > - > /* > * Paired with the closing smp_mb() implied by a successful > * cmpxchg() in debugfs_file_get(): either > @@ -643,18 +640,9 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent) > int ret = 0; > > if (simple_positive(dentry)) { > - dget(dentry); > - if (!d_is_reg(dentry)) { > - if (d_is_dir(dentry)) > - ret = simple_rmdir(d_inode(parent), dentry); > - else > - simple_unlink(d_inode(parent), dentry); > - if (!ret) > - d_delete(dentry); > - } else { > - __debugfs_remove_file(dentry, parent); > - } > - dput(dentry); > + ret = simple_remove(d_inode(parent), dentry); > + if (d_is_reg(dentry)) Can't dentry be gone here? This doesn't seem to match the same pattern as before. What am I missing? confused, greg k-h