Received: by 2002:a05:7412:a9a3:b0:f9:93eb:408e with SMTP id o35csp66617rdh; Wed, 20 Dec 2023 23:19:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8K+v3AKx066RoP4gfO6QG3Na8KRfGDjIyVVfg5kzl8akmWx1cIMQWpaxWp72PEgA7/XBE X-Received: by 2002:a17:902:e789:b0:1d0:4c09:7d31 with SMTP id cp9-20020a170902e78900b001d04c097d31mr11939253plb.65.1703143185160; Wed, 20 Dec 2023 23:19:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703143185; cv=none; d=google.com; s=arc-20160816; b=n/TUEWy/bqAc9R1gip/9LhZo4JGBbWivHXDKB0Xo21TpF9A3Feb1cAq7++GArN9AGB zmjjGuauB85XgZ8+ZsPy0z4xjV++ls+pn3h4BV28AETJrcq3jdJAGehxe/6TWCtSkDC2 1FzGWDVe6vu0/YPyvzdImU6ioi22fxI3PVhjDaEv3wStdoe1Xefj4h1dZwu9QU9sAMVZ dW58X0LDWChD4Rz+vNhUL32tWrtCH4Rdf+M0mWapo6lXHG5EO3iXir1IjT0XiOmuqE/4 2zOaegfR0Ky2yns3O4HGqV0Emm+h+CIMR5XWO0WHL7S+hsLpxRoNIv5GKShYeJbA7Szp UD9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=FlGscbfTW0+KZ3jK5mNcHMl5tg6QSPd929CFqIP8WR4=; fh=kXqLGNI5UpibQPJ0WNL3Mn/k/4D1m20a7gaTh18NVxE=; b=rKfW6FTcQOKHfHQ7pj4fmcSX7Uo1GZlTYHgt9vRu/yLjsTFUbFduj2SGrFX2fniCE7 a5U9QfoQfz+RrZzhhkCYArOGkEAKWRLjxJlp9MltTaBYBzXLHscINurAzavpErWDpEyL btiH0hGKajrv4W87oQFaOFT73TiKKo+9JyPFI2mNznuJM40NU4BQmR2WSfa9vQDXjca4 2UMpeWkdj1YR/GSAd2yYGsqJ3dnuWLaF1dTS6VO23F+cJKBaj/4YI+D5wmV9IucuBpaW tYMawZXUrQKsWJ9xPuX1fFceus8QCsNiA+5zVDkSyMu8hvRD/OyFNVUaxrK559ukDq6C bzbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=p9aUctXy; spf=pass (google.com: domain of linux-ext4+bounces-511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ba4-20020a170902720400b001cc3397aa27si1015021plb.62.2023.12.20.23.19.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 23:19:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=p9aUctXy; spf=pass (google.com: domain of linux-ext4+bounces-511-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5DD43B22E41 for ; Thu, 21 Dec 2023 07:19:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA67DD309; Thu, 21 Dec 2023 07:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="p9aUctXy" X-Original-To: linux-ext4@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CE72C2C6; Thu, 21 Dec 2023 07:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk 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=FlGscbfTW0+KZ3jK5mNcHMl5tg6QSPd929CFqIP8WR4=; b=p9aUctXyb8mC3Y8J31qjUJd/Dm kXv/m0A37ctQPOfBFc5ArzhSiO0fWfVarlLSk8vvvvv/+l5lwCEMG/y7C1UsrruMCzuoiVzuB/yux EQnW7FqU+9ynAtgrB9TsBAjwd0z66pMobmqauRorvhD5vhNmZ1ItZg7AXrXM+XYtGTs6e1ehZvlkL Fm3dLRmAH3qmvfPQD0pKQPX3x6ZICAS+Bzr2vcSXAPotfuKzhE708sJ46Lw1YnpVCbQeqpdFKaqT9 fivLhjGFX7ZgOTDXv6xfeDLr/iRTpC6KlfZWhaqTIdUXGecoiwZwaCpBGTTAVWTCjG2WTytOOJry4 mQuh31qg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rGDL4-001IZE-2A; Thu, 21 Dec 2023 07:19:26 +0000 Date: Thu, 21 Dec 2023 07:19:26 +0000 From: Al Viro To: Gabriel Krisman Bertazi Cc: ebiggers@kernel.org, jaegeuk@kernel.org, tytso@mit.edu, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 2/8] fscrypt: Drop d_revalidate if key is available Message-ID: <20231221071926.GB1674809@ZenIV> References: <20231215211608.6449-1-krisman@suse.de> <20231215211608.6449-3-krisman@suse.de> <20231221071402.GA1674809@ZenIV> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231221071402.GA1674809@ZenIV> Sender: Al Viro On Thu, Dec 21, 2023 at 07:14:02AM +0000, Al Viro wrote: > On Fri, Dec 15, 2023 at 04:16:02PM -0500, Gabriel Krisman Bertazi wrote: > > fscrypt dentries are always valid once the key is available. Since the > > key cannot be removed without evicting the dentry, we don't need to keep > > retrying to revalidate it. > > > > Signed-off-by: Gabriel Krisman Bertazi > > --- > > fs/crypto/fname.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c > > index 7b3fc189593a..0457ba2d7d76 100644 > > --- a/fs/crypto/fname.c > > +++ b/fs/crypto/fname.c > > @@ -591,8 +591,15 @@ int fscrypt_d_revalidate(struct dentry *dentry, unsigned int flags) > > * reverting to no-key names without evicting the directory's inode > > * -- which implies eviction of the dentries in the directory. > > */ > > - if (!(dentry->d_flags & DCACHE_NOKEY_NAME)) > > + if (!(dentry->d_flags & DCACHE_NOKEY_NAME)) { > > + /* > > + * If fscrypt is the only feature requiring > > + * revalidation for this dentry, we can just disable it. > > + */ > > + if (dentry->d_op->d_revalidate == &fscrypt_d_revalidate) > > Umm... What about ceph? IOW, why do we care how had we gotten to that > function - directly via ->d_revalidate() or from ->d_revalidate() instance? Nevermind.