Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2801399rdb; Mon, 12 Feb 2024 18:14:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVnHFj+/A0cB+0QnUsVCQJ/EokYUmpvReNO1zHLQYR/7x/d5UOuETSBCYn8GlbpkHDij+mDUYWZQa4v7chA6o+k+NAmYVe4sl3akFhnog== X-Google-Smtp-Source: AGHT+IG7+KFDl6//9BV7jb+LawOrKxzQqoWod5vqfjf2ZKkVVKg+04j6n7p4tltTLUfG9x+3dZSV X-Received: by 2002:a17:90b:390:b0:296:865d:e0c0 with SMTP id ga16-20020a17090b039000b00296865de0c0mr4977823pjb.45.1707790467841; Mon, 12 Feb 2024 18:14:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707790467; cv=pass; d=google.com; s=arc-20160816; b=qwzZOFwcr/qjaICTxPYbSesHhU9ZA9BZdkhlQHEthYEM5vx9QjPr5MjiD/Z7IVxmIp sVzhPbb3DW2TagTIupajyALnTb9C0x+wbp6Y+9bARDC+Fmxi2Rxp2K4zIsDKP4vJyfcC hkMbvTDR6bAv04LbvLvfw8qu42ZG6VIsg7u5uhewX0v4dLKGz0fJMITzE4fxaIT3VDNA SeOIYIMKsT+q2l3pEr1W2aXvszZKE79WOBSpjZ37f4A6ic1o0YKHWgeWcMuEk+/ktN06 4TU4f/L0AKimlI2XbwcGO2+rIf3egWpf6FwRrUhrCSmo51m6/JrnEOO5XKq/+AvoicGZ yCMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=hi5jtsblHY1BOgkoB3I3CrylBb57gl+1FT3PsX85sGM=; fh=TyJ0ITfkwk57hmUE6wZTMdJEbqQ1fuIcqRyTnt6VPeE=; b=Z1dmVHv44Q1H1L0yZHNvayJJpj4G8nxZy0yBXLb3iRzHsQ0a58RAZilvzC5pP1F6V/ w2lE0CDjK05Zpb/KixKrKug4opVGoqiYYhe7n2DkgM7pkRVLjvdNiTM9bezQa1hSU3nZ rFZmW6AIxi2aNjyjSFz+xVOVAGp0XI14lnOt5SoysdqYOlp6obPMzrrD08t5xHMnKSRJ BQFzVIdJE4NtPcXxYpnowSGwzbds8EMdfwfyQrTpTEOzaQc5347b41lLsIPeuOx0l/w4 Kd6fRp+/VMRFhfwQez8yHorng9+3uYq+JF7mf3ARPAlmk/Gau/G//PjmfmSFh1rZNugZ jbjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hVuMOjbE; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hVuMOjbE; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1211-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de X-Forwarded-Encrypted: i=2; AJvYcCXAQaB691gMg/7MAWCqmADb+TEAwEEV3pFmYamIYnpjQ7AYiC06esNj9JnoLpR/aUa+aEbRRH8zRNUVRSBpCflN3U02auC8x6pJwVyfyQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nc3-20020a17090b37c300b00296f578b285si1204962pjb.187.2024.02.12.18.14.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 18:14:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1211-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=@suse.de header.s=susede2_rsa header.b=hVuMOjbE; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hVuMOjbE; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1211-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 073BE28098E for ; Tue, 13 Feb 2024 02:14:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D74668825; Tue, 13 Feb 2024 02:13:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="hVuMOjbE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tPjQit1Z"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="hVuMOjbE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="tPjQit1Z" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDEEF79DF; Tue, 13 Feb 2024 02:13:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707790437; cv=none; b=op8xGS241HrE5eMbglVj9GmWzJuK/qXzFnk5GhZhgYB8O+zUahmhTxghIu2X0TJv4f0cqaHelsnC0DmennuJAIufnwdFrtFzKgPcaWEPD+px2Oi6zvRHf6aDmkB5eOXqJlIc0ZiBUrc0VhAkLzrqGuw55pn3iagrTMDN5h/SdJ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707790437; c=relaxed/simple; bh=YSq2jkFW7hjiLtpR74KFKwNmniOT+cj5vvdZvcq/S0g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K2MZTC8Ae8mDpUwz/qEWnymzEH3oXJHwQu764AK56szNM/UGXFWagYuOY89go0ok0gBdKVNeOnVlueNvVQ6EJUGjQ22CAEzZCMfxDu5FIdWKfC2W0W1ZLGu2dvOKbzKaZ1eC9bBdwT3vgOWxRFWs54Z3qalvx+38Bs+n5Z03eFs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=hVuMOjbE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=tPjQit1Z; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=hVuMOjbE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=tPjQit1Z; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5B28321D85; Tue, 13 Feb 2024 02:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707790434; 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=hi5jtsblHY1BOgkoB3I3CrylBb57gl+1FT3PsX85sGM=; b=hVuMOjbEPjAKxO+eRdFT0k4FmFsY97JekKQX6tPSkfGoKcdIVjpZtbeMBxsNTROlzge+LC CZ1OeOI6c8HSgQAdCyUEsIIR2Gn+scexYaSSnDE8Rv37dyNQDoQBAEyaYqBCsX3aaWbkHA RPGhQnqoSJFsO0SCxplcbeO8kwn6gSs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707790434; 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=hi5jtsblHY1BOgkoB3I3CrylBb57gl+1FT3PsX85sGM=; b=tPjQit1ZCC4CLiuqICPID+Z0SOAlg/CvCj7Quy0i4TpcH+sYWdy4at33oIE73ewdTd21Sk lmN9y46o6suEVzBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1707790434; 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=hi5jtsblHY1BOgkoB3I3CrylBb57gl+1FT3PsX85sGM=; b=hVuMOjbEPjAKxO+eRdFT0k4FmFsY97JekKQX6tPSkfGoKcdIVjpZtbeMBxsNTROlzge+LC CZ1OeOI6c8HSgQAdCyUEsIIR2Gn+scexYaSSnDE8Rv37dyNQDoQBAEyaYqBCsX3aaWbkHA RPGhQnqoSJFsO0SCxplcbeO8kwn6gSs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1707790434; 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=hi5jtsblHY1BOgkoB3I3CrylBb57gl+1FT3PsX85sGM=; b=tPjQit1ZCC4CLiuqICPID+Z0SOAlg/CvCj7Quy0i4TpcH+sYWdy4at33oIE73ewdTd21Sk lmN9y46o6suEVzBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2383213A4B; Tue, 13 Feb 2024 02:13:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id WG+2AmLQymUneAAAD6G6ig (envelope-from ); Tue, 13 Feb 2024 02:13:54 +0000 From: Gabriel Krisman Bertazi To: ebiggers@kernel.org, viro@zeniv.linux.org.uk Cc: jaegeuk@kernel.org, tytso@mit.edu, amir73il@gmail.com, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, brauner@kernel.org, Gabriel Krisman Bertazi Subject: [PATCH v6 07/10] ext4: Configure dentry operations at dentry-creation time Date: Mon, 12 Feb 2024 21:13:18 -0500 Message-ID: <20240213021321.1804-8-krisman@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213021321.1804-1-krisman@suse.de> References: <20240213021321.1804-1-krisman@suse.de> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLzk7q5dcbbphp39zi8hi5jhbt)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[10]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[kernel.org,mit.edu,gmail.com,vger.kernel.org,lists.sourceforge.net,suse.de]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[14.43%] X-Spam-Flag: NO This was already the case for case-insensitive before commit bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops"), but it was changed to set at lookup-time to facilitate the integration with fscrypt. But it's a problem because dentries that don't get created through ->lookup() won't have any visibility of the operations. Since fscrypt now also supports configuring dentry operations at creation-time, do it for any encrypted and/or casefold volume, simplifying the implementation across these features. Signed-off-by: Gabriel Krisman Bertazi Acked-by: Theodore Ts'o --- fs/ext4/namei.c | 1 - fs/ext4/super.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index d252935f9c8a..3f0b853a371e 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1762,7 +1762,6 @@ static struct buffer_head *ext4_lookup_entry(struct inode *dir, struct buffer_head *bh; err = ext4_fname_prepare_lookup(dir, dentry, &fname); - generic_set_encrypted_ci_d_ops(dentry); if (err == -ENOENT) return NULL; if (err) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c5fcf377ab1f..de80a9cc699a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5493,6 +5493,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) goto failed_mount4; } + generic_set_sb_d_ops(sb); sb->s_root = d_make_root(root); if (!sb->s_root) { ext4_msg(sb, KERN_ERR, "get root dentry failed"); -- 2.43.0