Received: by 2002:a05:7412:a9a3:b0:f9:93eb:408e with SMTP id o35csp64782rdh; Wed, 20 Dec 2023 23:14:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IECAHm12Kv1QjmaBlJcgLeFCxIXZvjPt4vmWXt/3EeKXfh3AxapzbW6XmLayAfYVufZXheU X-Received: by 2002:a05:6358:e49e:b0:170:e321:ce3e with SMTP id by30-20020a056358e49e00b00170e321ce3emr823473rwb.45.1703142867904; Wed, 20 Dec 2023 23:14:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703142867; cv=none; d=google.com; s=arc-20160816; b=YqBXqS8dGx9/fk1Fmj6ROqGwKRWROcReRQT0yxy7guJazxweml1hSMLM4sDByIA4h8 QGwFqRotSqIxDigtMumsvyGH7we6vhBpSKuUPlavLvPkn7JY8DXg1/MXo7VgGhWxcRqN L1vpEmyvpEoAALk6stxPcOQJlN2etQaOi9ZM6ztk84HcY1rjESOFGYb7gjeeoJUsvD3a vBdSRp08HImshep7E1ovFudlA1UKDEXO0w5QK5O5YbwqsJVMDVCUMgXYJP9mKb9IXijk gtgGO97OIwm54exIBjirUSdKRVcf+PF+hClC9b4cOV/uqdseYvhJ6zrENJNvOGoFpiIZ +6SA== 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=7URlUR6GG2Ifw9APY3b1ld2EAWLXn6C+XpO3zuDJHbQ=; fh=kXqLGNI5UpibQPJ0WNL3Mn/k/4D1m20a7gaTh18NVxE=; b=YBtD9C99OZWhLZT4cpilof6Q1v0ju6jy+u9Se7Uyx3mu52zXJqBXCiKN79zyDyqdL8 uY15obahvDW2EeKA1JmcukVIDp9yeu3cgPivoe4Eazb+lxmtuc0FBvPhzTl64g0BkutC 1hmLi9iqOwOQ7Om44Wfy1TuTt2D2e0aey4Ce34F9ki4KxWA7ngaf7wZfgv3HF8Dx1HLO 9Jl5WM9aaEhvIZR1XZsOQbaNBE/dSxRMuX6WpgWcGXAdPPeHxbpof8Nq2zqbWzbrcywL bs+fN2YSPPl3n3MJMrrRzi4VA+ntqW9p4Xz4OLXit0rxN78uWsbehBwUL9ThMfTrYJHT 4AyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=cZbHkl6a; spf=pass (google.com: domain of linux-ext4+bounces-510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-510-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 sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w129-20020a626287000000b006c0e02cdadcsi1072510pfb.208.2023.12.20.23.14.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 23:14:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=cZbHkl6a; spf=pass (google.com: domain of linux-ext4+bounces-510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-510-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3D047288061 for ; Thu, 21 Dec 2023 07:14:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 684B3D2E8; Thu, 21 Dec 2023 07:14:13 +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="cZbHkl6a" 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 4624A156D4; Thu, 21 Dec 2023 07:14:09 +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=7URlUR6GG2Ifw9APY3b1ld2EAWLXn6C+XpO3zuDJHbQ=; b=cZbHkl6a5nwYZNq+11W7X2snrz sVfC1MYbX1OiaEYz7aZahEGRBNxmRHskk2EkUWvW6SdYW0aRFIRfhe0scCb4U7aMLvFuoj/r7ocJC f++WD+1m+nz0Fdxd94MpTQT4XGCKX1i1aERfZtHno5azYCHbXXyTiSu/FIsx2Dod4rZGsIl30IzU0 UK8fsYCdOm4M4uyMLhqr7OgFNfrHfnGDh//3Onez24q/yzQfgACiLMHDQ14yBylNmfQGPjJW5f86a QH9oj+bIrViH/DBKnoR1pAejUEdA/BbxD/FLBDrMebFUgjZQraUvHqMSWxKyOsvmDNBRlfyWiyPL0 3zKo2PJw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rGDFq-001ILj-2n; Thu, 21 Dec 2023 07:14:02 +0000 Date: Thu, 21 Dec 2023 07:14:02 +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: <20231221071402.GA1674809@ZenIV> References: <20231215211608.6449-1-krisman@suse.de> <20231215211608.6449-3-krisman@suse.de> 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: <20231215211608.6449-3-krisman@suse.de> Sender: Al Viro 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?