Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8779130rwp; Wed, 19 Jul 2023 15:29:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGcVWMl61uTgWg7hCR26+LZ6TOUI2eP43d/BzDrDl/+GVtAeUZTAsIIg1mVWkgsrsVFRRjn X-Received: by 2002:a17:907:d0a:b0:993:22a2:8158 with SMTP id gn10-20020a1709070d0a00b0099322a28158mr4289105ejc.61.1689805768123; Wed, 19 Jul 2023 15:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689805768; cv=none; d=google.com; s=arc-20160816; b=jtUW/vAhAnqDg/Wlfmhk5UGt4PanCtQ8zBqAP2yxF9BhZeOS/W551+V6OWpCbaIGT3 iM9gWkas1zrL0S3+5/hl9Z9Cc8wBd0I/DXaUmFlcdIC+U2sZZg7Nc0Ch8O0amOzslmSO xaQ+MsruDn8HaPGbie574GtKMVpuuaoSIHYPagRpafFUB7rySgIMz7CL05zAVDD0i17W FtXwayMB0RPWh00KMHbFhxo5zVwPMHWxhN5YlCFtd/O0kYBQMiF2Gk+BS5GmG9htW2NU HyLdP94sv7rBrSvZn1LQfYe59RFjneyKbPWhlvrwhJCTtaUNAAYFPaS5DVqdjJa/u6nk POuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=j57Lx3+FpTaFO/zYYXnGH9kXhTYF7EBk2WE6e4N0FWw=; fh=HFDFbc5lRXwuu0vgGURCiLYm5ywsvQKdSNBX4pGxTs4=; b=GzbwMbmEbdo4shkOLJvNiv4X+7jwwaAymwERs/NR6K6MRzLGsUNAl+VxrE+sCaWWp9 0othUi+Ls46Cm7wNMj80R/UwReJdG3daeFHxDyDp5bqo/dw0a60KxdweJDtehCiURb+v TIqxcf1q+3hTdo0DzT+NZNh3jmLDG5Buk43R2XiqonlwApPi25O4w2nMNIDI6yss1xMH BxmLXZk/7h7vIbHEhtIwAVJiKteMm2+HMRlDby/VqNET/7OxKKT2aVLMqwMFEfZ9nF/7 SScmWR4O8oept/Eu/9YXLs3zvuBc3qKAvXA7STpPZxE7N+t4xpdHFcDgg526t5zdMRG7 gS8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Y+kAHqKY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a17090622c500b0099845f657a9si1993706eja.662.2023.07.19.15.29.03; Wed, 19 Jul 2023 15:29:28 -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=@suse.de header.s=susede2_rsa header.b=Y+kAHqKY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjGSWTl (ORCPT + 99 others); Wed, 19 Jul 2023 18:19:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjGSWTj (ORCPT ); Wed, 19 Jul 2023 18:19:39 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D51F21FDC; Wed, 19 Jul 2023 15:19:37 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 93204222DD; Wed, 19 Jul 2023 22:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689805176; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j57Lx3+FpTaFO/zYYXnGH9kXhTYF7EBk2WE6e4N0FWw=; b=Y+kAHqKY0B+MOXA1cqgFXSoT2CrLqbPARo0bEA5bjdqhUyyd1cBaVZYr1q2YQY7ve6TmK1 inx5dr765acnZxFTuXZ1RYSHnuBHixlBv9blHoB1iaLIYkJX+G6AeISiI8wAwfc8WKoxei JX9Mw0y8yS85yQCAmOEYc+uhj5jcp0s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689805176; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j57Lx3+FpTaFO/zYYXnGH9kXhTYF7EBk2WE6e4N0FWw=; b=LC8gA7gzUrHj6EcWEVQg8eHdZtfWCWmk/lWpyn7jyRmFvPKeznMNhITrvomwCCent7ATW4 Wnjfrts9A2o92BCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 595FE1361C; Wed, 19 Jul 2023 22:19:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id z846EHhhuGQZJgAAMHmgww (envelope-from ); Wed, 19 Jul 2023 22:19:36 +0000 From: Gabriel Krisman Bertazi To: viro@zeniv.linux.org.uk, brauner@kernel.org, tytso@mit.edu, ebiggers@kernel.org, jaegeuk@kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Gabriel Krisman Bertazi , Gabriel Krisman Bertazi Subject: [PATCH v3 4/7] libfs: Chain encryption checks after case-insensitive revalidation Date: Wed, 19 Jul 2023 18:19:15 -0400 Message-ID: <20230719221918.8937-5-krisman@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230719221918.8937-1-krisman@suse.de> References: <20230719221918.8937-1-krisman@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: Gabriel Krisman Bertazi Support encrypted dentries in generic_ci_d_revalidate by chaining fscrypt_d_revalidate at the tail of the d_revalidate. This allows filesystem to just call generic_ci_d_revalidate and let it handle any case-insensitive dentry (encrypted or not). Signed-off-by: Gabriel Krisman Bertazi --- Changes since v2: - Enable negative dentries of encrypted filesystems (Eric) --- fs/libfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index dd213f446427..0e5d3bb1dddc 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1506,7 +1506,7 @@ static inline int generic_ci_d_revalidate(struct dentry *dentry, } } } - return 1; + return fscrypt_d_revalidate(dentry, flags); } static const struct dentry_operations generic_ci_dentry_ops = { @@ -1526,7 +1526,7 @@ static const struct dentry_operations generic_encrypted_dentry_ops = { static const struct dentry_operations generic_encrypted_ci_dentry_ops = { .d_hash = generic_ci_d_hash, .d_compare = generic_ci_d_compare, - .d_revalidate = fscrypt_d_revalidate, + .d_revalidate_name = generic_ci_d_revalidate, }; #endif -- 2.41.0