Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1461268rdh; Fri, 24 Nov 2023 13:23:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5IdN02xkfqCM4SO4g44lOPXhG8FZlRlDSnLbU4Hir5lGrodfZMWrSYi/5B7L+EbpEdzfX X-Received: by 2002:a92:c98d:0:b0:35c:5eaa:7873 with SMTP id y13-20020a92c98d000000b0035c5eaa7873mr2967119iln.30.1700860983105; Fri, 24 Nov 2023 13:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700860983; cv=none; d=google.com; s=arc-20160816; b=Wtpvx/J3TT8bR6pkqQZ3HDcpLvzrR6qp//4FDUf2g1noUckGt8pv9R/MWpPP/ND32n QwE7vRllaMLOidqEpUI35fdlBXkl0/0S3SmTeoyGJh0ynQE/DPP2VNJyGSOuDeE3681j o1iYlWd7b5adLBzOhVjpCBDcwZlVVgEkrzbARtLs9O7Ko2TJ5YdYjSN0xMEkgNX6XRV2 n/6u7d7BZugh8GMz30/CAz8JCael23AjLKAbwIVWkU9nG1cuIaNeeEapG2M4sfax8Ni9 NU9+Au8xN5p7VWvHjDNVGaU3hlY2E5NzGaa6hS1Q7x1PE1NeMOSuHK/pVz3T8yGnbgei cFpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=apBows719Ql6+y2BcpLIbVUnN8kkKRkZuJ5YeukjHu4=; fh=ZElygRj8gAF7NKJPG+mYkaCJrRpJ3EhhLlDUsGI781Y=; b=l2ukzN1f64O2coV5leQe5mhudrpoX0hFYeh7J89uULX69ri0DIU6hIfsnm6qvkaEYd npl1AeKDD6rXvRlyJp0bNBgvSFHk04BTRLBQo8F37W3L5eDxf7YEWNL7prINKYS8MuAv zabiObDP+qEeTFEdF68k8tBj0Itb+aoIxfODzgw+IV28VxmcykonAJsD++kDAjOMHKhO HydkJA+bkKsxPgwK+1xBV7GAVPBVdhxXqHdVFFWL62m+e2ixWFD2tj8PLyEHdmt0taV5 3c6d/J2WXw6H1Nud0bGWK6pyb0ZyrxhOUFJesswgNjJdDu/DVZ84oPm1VOpHeNZCUUg1 5vLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=SH51FT7E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id o4-20020a656144000000b005c1b5a76098si4064661pgv.771.2023.11.24.13.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 13:23:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=SH51FT7E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CA1D88043AE6; Fri, 24 Nov 2023 13:23:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjKXVWe (ORCPT + 99 others); Fri, 24 Nov 2023 16:22:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbjKXVWd (ORCPT ); Fri, 24 Nov 2023 16:22:33 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C6219A7 for ; Fri, 24 Nov 2023 13:22:39 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a00b01955acso342313566b.1 for ; Fri, 24 Nov 2023 13:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1700860957; x=1701465757; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=apBows719Ql6+y2BcpLIbVUnN8kkKRkZuJ5YeukjHu4=; b=SH51FT7Ew+d98DyAlBHAA5qXQhUL6YaR5qhhTrR45XMN/ZzDLwzlz2jb94PanQ6S5s MYctfLQnjyVSWdSer2cjH8nUQLLWB+Ez4lWt+RygNRFf8zDN+fE/kN3bryaLq0OTz9e4 p/+NZZhwRcvN3Iivq1MCNJ6OmSKRTL3iulN4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700860957; x=1701465757; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=apBows719Ql6+y2BcpLIbVUnN8kkKRkZuJ5YeukjHu4=; b=v1Wyd93t+wBIlexKMO/JV15u6QsaQtb7rTocP9lhpIT5CYNiIzBdVYnGOHatVUk6gw y0Bl/gcLuLIT1+OTt5byKoU6Z2DgTZqNmJqmHStInJaDCzzVwfBTVKY7LO6dQT0dfl2p WRwmIa/O3LH5G2mCnIORognY0SvZMoq+qMndsvxo+QZwkthAEdg7+ximegnZ7XMsuoK7 7s2e/7ESi4QwELYDz+BOvn/YdTji+ItT0vh+bNSWEDF2a4vmDBmS13nm6ag/5tKEL7W1 bPEd3itPxtRuW0NCguQ4jb/kXZdD6xmGkvNzlKaInYrSRzZ6FWHw8Y6Gue+2/MIUcAzO 0nRw== X-Gm-Message-State: AOJu0Yxz+yvfF+QI4Oy2ZqFFMY05KTH4QFQf+HAgY4PJmmiLDmUcZldW 4glZeGtuBSKVge0+O581XVEvlKd8/p/HFDoHq1/5FxlQ X-Received: by 2002:a17:906:5307:b0:a09:589f:8853 with SMTP id h7-20020a170906530700b00a09589f8853mr2316220ejo.66.1700860957498; Fri, 24 Nov 2023 13:22:37 -0800 (PST) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com. [209.85.208.44]) by smtp.gmail.com with ESMTPSA id kg23-20020a17090776f700b00a04431e5a44sm2560631ejc.16.2023.11.24.13.22.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Nov 2023 13:22:37 -0800 (PST) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-54b1812ae1fso182109a12.1 for ; Fri, 24 Nov 2023 13:22:36 -0800 (PST) X-Received: by 2002:a50:d715:0:b0:548:564d:959a with SMTP id t21-20020a50d715000000b00548564d959amr2756303edi.3.1700860956448; Fri, 24 Nov 2023 13:22:36 -0800 (PST) MIME-Version: 1.0 References: <20231124060200.GR38156@ZenIV> <20231124060422.576198-1-viro@zeniv.linux.org.uk> <20231124060422.576198-2-viro@zeniv.linux.org.uk> In-Reply-To: <20231124060422.576198-2-viro@zeniv.linux.org.uk> From: Linus Torvalds Date: Fri, 24 Nov 2023 13:22:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 02/21] coda_flag_children(): cope with dentries turning negative To: Al Viro , "Paul E. McKenney" Cc: linux-fsdevel@vger.kernel.org, Christian Brauner , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 13:23:00 -0800 (PST) On Thu, 23 Nov 2023 at 22:04, Al Viro wrote: > > ->d_lock on parent does not stabilize ->d_inode of child. > We don't do much with that inode in there, but we need > at least to avoid struct inode getting freed under us... Gaah. We've gone back and forth on this. Being non-preemptible is already equivalent to rcu read locking. From Documentation/RCU/rcu_dereference.rst: With the new consolidated RCU flavors, an RCU read-side critical section is entered using rcu_read_lock(), anything that disables bottom halves, anything that disables interrupts, or anything that disables preemption. so I actually think the coda code is already mostly fine, because that parent spin_lock may not stabilize d_child per se, but it *does* imply a RCU read lock. So I think you should drop the rcu_read_lock/rcu_read_unlock from that patch. But that struct inode *inode = d_inode_rcu(de); conversion is required to get a stable inode pointer. So half of this patch is unnecessary. Adding Paul to the cc just to verify that the docs are up-to-date and that we're still good here. Because we've gone back-and-forth on the "spinlocks are an implied RCU read-side critical section" a couple of times. Linus