Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp227256rdb; Tue, 19 Dec 2023 15:00:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfNHHBBH4oWJVrIzoaUYSYvrLqZxWI/KYJycM3gUKhqaowoedjqrPWoEaSP9OsZI8F/cWc X-Received: by 2002:a05:6a00:4b95:b0:6d4:ecab:7137 with SMTP id ks21-20020a056a004b9500b006d4ecab7137mr5864992pfb.10.1703026851420; Tue, 19 Dec 2023 15:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703026851; cv=none; d=google.com; s=arc-20160816; b=V9w1HG6uqppHWnNnWBEfQBQ5fDuMaNb38zKQnumWWh1wXEPOtCu0a+xxW48XQLj3ey N28fBg41odxZYtdQHf4TIEuo9q/wMt83AQ9L3WVEPOCd+LZ88ORpyzbwbkbp88Aft1sd 1G8kTQ0qksAIrxH/ihOSbPgCTNRHbn/GBOEp5xjwIn0TcoV1lc73F9pF6e61Z0P7zUlf SVDana1wGzpaxZaMMifj2p0qZkMc705Az6ftZkpunm43DYIIVe9eFfNKhtSnkn55jiI4 dRBDXwXxxGivyXcOPaZr7LSa4BLu9eV6IXMz+K2Q2amIs9hew1hjd11H3xieUZqnpC+h SfZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=cPZjcFe2UtpHKwNCjX+zMVytkrN625ypejHKQAKt4LE=; fh=TBQtGPAwpHWLLfGWNdLhxG8+7Hpfce/nym2WwbyQEuY=; b=ZaX3DtWiTJ4X93DnAhaTl8M/mSFeRQbDUc18/50hJdG5JD5G8+7Fs7h5krOQdPh3U+ X03pveCKUgmygc2YmKquEZYDQkA8X86WxBrEmT7n73jf0Yro6XRZ/Dlzg3IJ+q6vkFrN x4G985LtWFpEujqhh/qGdcQ4Jo8SJ9NnUTXRc0Ji99eOO4ke5Co9HUkBX8Iog7hdiOQ+ q0xhEKmxjNXJ63PWHozKfm7YZ6zWCSCjUmcxUtb2H3BQvBq7VQw/5Q4CQKlM/5NCaQM+ o0lRByjyX91zTHK7hiconJ6haxv8HFwnRAwobtBeAlQh4lXvuwwIL5UPECBDlFZ0fAkW Gtpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N1paRRI5; spf=pass (google.com: domain of linux-ext4+bounces-504-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 15-20020a63164f000000b005cdacde404fsi2906330pgw.617.2023.12.19.15.00.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 15:00:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-504-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N1paRRI5; spf=pass (google.com: domain of linux-ext4+bounces-504-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 D02802881A3 for ; Tue, 19 Dec 2023 23:00:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AA443D0BD; Tue, 19 Dec 2023 23:00:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N1paRRI5" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0AC7D273FD; Tue, 19 Dec 2023 23:00:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22131C433C8; Tue, 19 Dec 2023 23:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703026841; bh=hHJulODtDt71xBDQ4Kigub7raLKaCHtkE0PAl5iwWM4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N1paRRI5Tq0qTgXygPdUnER2lIsTcDSHZucDxNTTgprXGzrFxtuZXwheJoqsQE/ck JlmlAsbU6ShcUl0ot2RHvMyU7yNp8ESSUj+HWGTbnHmWeY/BB/SIjBY5voUXjdpGJZ Ya0JA5TWQfsVxYVuTGts0QiTbQMxEyjMvvDV5hVslNiGUuS1awPU0Edr9n+FT8wiTY GQamGF11orinqxEa72HXGmSHFecdznNX2svTHt+1umgfV57K+mj3SmECLUz3p4Lk2+ ExIfEvAWEOFNT3wdivWuiQ4eh9SvmEhMt5arWLAYhbUIC+TmZv5Hd1dIZVy+lhJP3q oNOj4RoX3BeNg== Date: Tue, 19 Dec 2023 16:00:29 -0700 From: Eric Biggers To: Gabriel Krisman Bertazi Cc: viro@zeniv.linux.org.uk, 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: <20231219230029.GG38652@quark.localdomain> 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> 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 IIUC, this patch minimizes the overhead of fscrypt_d_revalidate() both for encrypted and unencrypted dentries. That's what's needed (seeing as this series makes fscrypt_d_revalidate be installed on unencrypted dentries), but the commit message only mentions the encrypted case. It would be helpful to mention both. > --- > 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) No need for the & in &fscrypt_d_revalidate. - Eric