Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2042555rwp; Thu, 13 Jul 2023 23:01:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlHAfAce1YY7CLiGQCQAqargVwUIUEyjzvsoPgXH9tnZpJ0ye7j5B5NdxHsmWsDonhmKvjbP X-Received: by 2002:ac2:4a72:0:b0:4f9:5ca0:9334 with SMTP id q18-20020ac24a72000000b004f95ca09334mr2504612lfp.34.1689314470013; Thu, 13 Jul 2023 23:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689314469; cv=none; d=google.com; s=arc-20160816; b=hOj2b1S441yj94Xi7JaqWihtNObDQrfMVJyxVdjkRgA14zsZTHsqCTtospaj6PWN7E YJMu5whZwmpSfGjAkDJyp/lJD7fb4X4677NLCIY9ZbXf7y9i1A+IdyQu5yPegJc/lxq8 XXCsvvI+TvaN7kzRx82tj6b5Rv8QMyChUn75VWrkHMGtGPU+NebCaKLzgvfKQm2tfXdW krGHe88iLkVRSxXR2krcadnDioK5FK47Ztx/cZdmfhNIOk8B4/4R+xs4hHWg+cqO+rHS hWMYxgFWrrsoQL4FTGxGF7+HfMAa21NYoLloj4N3pY82YQljy0a8MtXcg2m/3UjcNE2v DHtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SHcPWexzbWLR6et3TqJdT5GImKuE8Je85P9KdC6KhHQ=; fh=O9HCw4Bmf2qwjO8ss3GrzvYYvoiF4ciMiD4gTT9PRio=; b=qXC8C/gTPFX9XXTUO/zgOFNHT6ix8W0FBzebFtquvmbOQp8EqReuP0FVNT8B3/Do2h ZAUy/8Qas5FgRwPYoDGxLmUFaaj1aWm60sOODhTYvh7gus2li0IkwG5okny87gkO0OVB 27lC5cdWtGjJTQ1UzkgTcOvNZHh4LNIe9dDL5sMq/UkNzlm8h9BqO/D2wVGntBxPyXII iU+chu9oipD2kt83MDI14asdf+7TBjODdQmYk4124x5B+iR3GT/TfQoykOsO1cgUOOPP dYT1OFJm4NRXj5GrEXPUidN0Y6M7hpxhoMpTwkF3PJ5whwlhUV2adEeysmGiJNOzpwto 0Zzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S579h9VF; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a056402038d00b0051df75a5cb3si1145487edv.472.2023.07.13.23.00.26; Thu, 13 Jul 2023 23:01:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@kernel.org header.s=k20201202 header.b=S579h9VF; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234545AbjGNFt3 (ORCPT + 99 others); Fri, 14 Jul 2023 01:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234921AbjGNFt2 (ORCPT ); Fri, 14 Jul 2023 01:49:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93B6126BC; Thu, 13 Jul 2023 22:49:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2664C61C17; Fri, 14 Jul 2023 05:49:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49121C433C8; Fri, 14 Jul 2023 05:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689313766; bh=7DnQ3lPm58MYsorHdkMUvAqvzRj0azqqi5D765n2mkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S579h9VF/gTjL7FvtkLYx19YYonmDP7oeWhNKTLavRhs6b3XqYHgciC57V+g2JAc6 XDYLHNlyHIPB90N1QlVqUjNVjTxyaOg6ZCus0W7CSpPcYIuqXGgDChAB8aTb7TWtxC A2pqs2CMuucrYF7hFG6kcldXkI/W7HCnK06IDecW3moef29b2zPcK4doO2IUvh4Ydi 0igEQZt+pNQk3PsQyt1sm21qdsqaiCQ3xvKjameBVU14iiQVByJpgZfhVWgrRIZvu3 NRr/X6QyILlYhdnE6gydOJpJvUQX0oua2oHDN7N+GHaEOqaB3yLnswxVELldGyWbkQ MFzFnxcJJdtjw== Date: Thu, 13 Jul 2023 22:49:24 -0700 From: Eric Biggers To: Gabriel Krisman Bertazi Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, tytso@mit.edu, jaegeuk@kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH v2 7/7] f2fs: Enable negative dentries on case-insensitive lookup Message-ID: <20230714054924.GF913@sol.localdomain> References: <20230422000310.1802-1-krisman@suse.de> <20230422000310.1802-8-krisman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230422000310.1802-8-krisman@suse.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org On Fri, Apr 21, 2023 at 08:03:10PM -0400, Gabriel Krisman Bertazi wrote: > From: Gabriel Krisman Bertazi > > Instead of invalidating negative dentries during case-insensitive > lookups, mark them as such and let them be added to the dcache. > d_ci_revalidate is able to properly filter them out if necessary based > on the dentry casefold flag. > > Signed-off-by: Gabriel Krisman Bertazi > --- > fs/f2fs/namei.c | 23 ++--------------------- > 1 file changed, 2 insertions(+), 21 deletions(-) > > diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c > index 11fc4c8036a9..57ca7ea86509 100644 > --- a/fs/f2fs/namei.c > +++ b/fs/f2fs/namei.c > @@ -564,17 +564,8 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, > goto out_iput; > } > out_splice: > -#if IS_ENABLED(CONFIG_UNICODE) > - if (!inode && IS_CASEFOLDED(dir)) { > - /* Eventually we want to call d_add_ci(dentry, NULL) > - * for negative dentries in the encoding case as > - * well. For now, prevent the negative dentry > - * from being cached. > - */ > - trace_f2fs_lookup_end(dir, dentry, ino, err); > - return NULL; > - } > -#endif > + if (IS_ENABLED(CONFIG_UNICODE) && IS_CASEFOLDED(dir)) > + d_set_casefold_lookup(dentry); I wonder if a more consistent place for the above code would be earlier in f2fs_lookup(), next to the call to generic_set_encrypted_ci_d_ops()? That's where the dentry_operations are set. It's also next to f2fs_prepare_lookup() which is where DCACHE_NOKEY_NAME gets set if needed. - Eric