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=-2.4 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,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 2D70EC04A6B for ; Mon, 6 May 2019 14:26:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F344420675 for ; Mon, 6 May 2019 14:26:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726145AbfEFO0q (ORCPT ); Mon, 6 May 2019 10:26:46 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58790 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbfEFO0q (ORCPT ); Mon, 6 May 2019 10:26:46 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hNeZl-00053N-AN; Mon, 06 May 2019 14:26:41 +0000 Date: Mon, 6 May 2019 15:26:41 +0100 From: Al Viro To: Amir Goldstein Cc: Jan Kara , Linus Torvalds , linux-fsdevel , LKP Subject: Re: [PATCH] fsnotify: fix unlink performance regression Message-ID: <20190506142641.GD23075@ZenIV.linux.org.uk> References: <20190505091549.1934-1-amir73il@gmail.com> <20190505130528.GA23075@ZenIV.linux.org.uk> <20190505134706.GB23075@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, May 06, 2019 at 03:43:24PM +0300, Amir Goldstein wrote: > OK. What do you have to say about this statement? > > Because fsnotify_nameremove() is called from d_delete() with negative > or unhashed dentry, d_move() is not expected on this dentry, so it is > safe to use d_parent/d_name without take_dentry_name_snapshot(). > > I assume it is not correct, but cannot figure out why. > Under what circumstances is d_move() expected to move an unhashed > dentry and hash it? For starters, d_splice_alias() picking an exising alias for given directory inode. > My other thought is why is fsnotify_nameremove() in d_delete() and > not in vfs_unlink()/vfs_rmdir() under parent inode lock like the rest > of the fsnotify_create/fsnotify_move hooks? > > In what case would we need the fsnotify event that is not coming > from vfs_unlink()/vfs_rmdir()? *snort* You can thank those who whine about notifications on sysfs/devpts/whatnot. Go talk to them if you wish, but don't ask me to translate what you'll get into something coherent - I'd never been able to.