Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1637196rwi; Thu, 13 Oct 2022 17:14:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79VQ6EJbZTrVt5fbMsGxMbkpcNtgSy96t+BzhOTlq/ssQePYLX5RGDubbPk6vIMwOlIAMh X-Received: by 2002:a05:6402:35cc:b0:45d:442:1765 with SMTP id z12-20020a05640235cc00b0045d04421765mr1927506edc.51.1665706439817; Thu, 13 Oct 2022 17:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665706439; cv=none; d=google.com; s=arc-20160816; b=bd+Vu639XK0RfiPd3cS8gPDj2omgh33xNt+z2k9kytwsesFikvFJtNS5Iyd99eIZPR 4FDH1em/djAgP/cwSDJqMZirznIeKVafGU4wkidoevzQsHgxsLNO4ZFIFMhcwMnG36Nb /puLxhaxmuyOI5ThI7fiuZFMAiqRR2AV868FrAB0Dk0zUif40qynVcQtGzm0zH/q30pL PqQ4UjkO4CpQVOpzXiPxRQspSMOI1meXsalgtou8sJ8uAaQWW0hStp7fcEAtWu8/iKoo 4476lEWI2aRAWxMzSHQBW+aJPlp9PkGpZUBGhwdrABwuacL5AMvhh8AvWA9f50c/x1Bx w/5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YCYs7tzRYuLz67p2Ln7qVb0EmBKHWMxYVDKxHFDO8Ao=; b=a9bacvgk9ANgJ6AI0dqocFtZKxU5aHoYrHMWbgjSMQZcU0Hum3DZ4kvyyYx4b8Let/ 8QjVTOEGx6wU2ZG9lUPeaJIb4YS8pf3Pp/5yordyBlCqieys8Eq5cjXhZ9i1OP6JJgsI heFdoSN4SyKd9IJ44xg5cRrlPVti6za/MtpTtCFMo2bYGFhrhhg0MOqAqqWfR2cnRfbO 2hb/B9uk+KwHgTGkvPuXQxcgRZ9AxkDHJGaOKAWTCjLaFfD1AyXQaEOjw87RJwOwX4w+ HEhmBpeX3eRzSXJ7EDw91VcXKkHjw6+kcs410TLDZ6o54dArHXiXTKFDUcYWTXZfAuMH MjdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=hijUEPoS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a056402248b00b0044e8fe826a0si894678eda.156.2022.10.13.17.13.24; Thu, 13 Oct 2022 17:13:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=hijUEPoS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbiJMXvf (ORCPT + 99 others); Thu, 13 Oct 2022 19:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJMXve (ORCPT ); Thu, 13 Oct 2022 19:51:34 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665B2133303; Thu, 13 Oct 2022 16:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YCYs7tzRYuLz67p2Ln7qVb0EmBKHWMxYVDKxHFDO8Ao=; b=hijUEPoS1GgvVx8YyL9nx0zVN1 bkFVy4Fm6MBUJWXZd17HDtn2rU0NEhONJPwlJc2Wjfx22xmjX5I3DELQjGLK8C99sS+nMUxPFihXV WKwF2TPT3apBJ9emqhSIOG77Rl/bz0CyrYgWzeCkFl//NT6a92H8RfTmML9AS6BwjpX0ijfSv39JR /Ld8EwhfIJQKh3cF4BCJ3dEW//2Lr/sLXyVauLH9PhHjhCf4Fv2K5x63MBJIhhUTvyBOkBKgvRoQA 7fJ+tVb7uEPH1cRq1mXXSeQ+Y4FWVu1Qa2fUhU9na2TrxdX9oTdAJioQHOvwAf0BKizpGxKV93L5R J8Z8uNBA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1oj7z3-00ACKS-2Z; Thu, 13 Oct 2022 23:51:25 +0000 Date: Fri, 14 Oct 2022 00:51:25 +0100 From: Al Viro To: Stephen Brennan Cc: Jan Kara , Amir Goldstein , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] fsnotify: allow sleepable child dentry flag update Message-ID: References: <20221013222719.277923-1-stephen.s.brennan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221013222719.277923-1-stephen.s.brennan@oracle.com> Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 13, 2022 at 03:27:19PM -0700, Stephen Brennan wrote: > So I have two more narrowly scoped strategies to improve the situation. Both are > included in the hacky, awful patch below. > > First, is to let __fsnotify_update_child_dentry_flags() sleep. This means nobody > is holding the spinlock for several seconds at a time. We can actually achieve > this via a cursor, the same way that simple_readdir() is implemented. I think > this might require moving the declaration of d_alloc_cursor() and maybe > exporting it. I had to #include fs/internal.h which is not ok. Er... Won't that expose every filesystem to having to deal with cursors? Currently it's entirely up to the filesystem in question and I wouldn't be a dime on everyone being ready to cope with such surprises...