Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2495743rdb; Wed, 21 Feb 2024 09:15:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW6oE52k8CpWeZcEbvLhs2J12mu0Szy7dXLonMj4MJuDXs4BaR6u5ZOf1HadJZWooI/n0DbQDDB5r+RAEypDpmniyKjknMenn4m45F6Rw== X-Google-Smtp-Source: AGHT+IEkbASv8Exf17X30nmI3hywMOptSuplU0ilBigAD6OreM2CP/CGSv+vXY28OfC8ShjIoNGi X-Received: by 2002:a05:6a00:301e:b0:6e4:65a7:c806 with SMTP id ay30-20020a056a00301e00b006e465a7c806mr11582148pfb.8.1708535754705; Wed, 21 Feb 2024 09:15:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708535754; cv=pass; d=google.com; s=arc-20160816; b=W8XQIEryt1SEiJVWH7Bk6h0/D5paRUDqhgv4LrJwk0IB1JsHp6nfydNc0GtYF0qnBb Ax8G/hwqqDUlSWKAzV8yuP5t5Z/eHxXjgKUf7Gr/Czz+V32E8KkOV/kh8qBDxl3Svsyx EML20zIFPY4G4vuS9UlusMbL+TUSlHkhybe5rbJ6QkAbV//LfbSLpi1cS/kVN7hZy5yu tkZmaSC5GesMFMfq9EzVScP5g+NG7Qh911H9ltvNBgtvgsC3lNjxiiXTTDDlI5agOcmO G8WLLDTEWb4LXKGajyl23cY9auUcaK8HNoni8Vhjhs8pnMvBTmLp6RD6vtUNkfENkTNk VLPQ== 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=8tdzVCq0eMaTapAm4yEzDtdxr6Vp38VIgLMUbBssKM0=; b=GavMsZvqLShkyxkRsNosEo+kAiPbttyA1zwifZpIc4xKnnW7nRHMWfVupMQd+/vzz6 DQdT2hOCeTygfMETnHBzHSsFZwzACwCrFh1GNIQ4m5uTzpTeVDONZML4Fla5wpi+P9nV H6+EVQ0jqgVeUphFz3qGa8poW4CsHC0xLcZcphe/RsoADyPZPTH9Zh90Ghr38eZH3n79 3Dz6XtJgMT3zF1YZ4weME0Rml5Z0JjZrCdGdgc1oXAzYpR6m04e81aJTgJ3SbFGoHjB3 UAHSGEmb4/nQCeCRH+pVVarrC/oXPNqANpz6I/ZUI0EWumaTSGOkosn4lvC2cGMoWBsM dvtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MZn+Uo9n; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MZn+Uo9n; 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-1348-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p25-20020a637419000000b005dc87643ccdsi8330362pgc.79.2024.02.21.09.15.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 09:15:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1348-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MZn+Uo9n; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MZn+Uo9n; 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-1348-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1348-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E48DBB21305 for ; Wed, 21 Feb 2024 17:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E89B284A2F; Wed, 21 Feb 2024 17:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MZn+Uo9n"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="LJcTbZ/f"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="MZn+Uo9n"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="LJcTbZ/f" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 EF57983CAE; Wed, 21 Feb 2024 17:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535685; cv=none; b=HCBPaSXuUDwsflE7xZIQTDtOXpyz3y+C6kcBYtkut1/MzvgipeQdgMoh3G2HNNfCRbLUx3Whv1Y7Cdh+DGqVIHFp3CF3WLa/m1gjBU1D/f/4dG2P6hYQSbLo7lRs3ipMx8OeiknAivsVLYJXPaQCoiyOGNhZeqUSm2VCqLzX83c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535685; c=relaxed/simple; bh=YSq2jkFW7hjiLtpR74KFKwNmniOT+cj5vvdZvcq/S0g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aJJLXsCNJEMzJCX5NjxYnDuVmkt77e3vNh5l5vXgy6kTPo6uHtXaoLjU88Ax5ByxNDfCWNrVASSywZVo64RKYacjKiGOe0mkBPtsuzTb4l8n0kOkPa/ZbM7bX9oTmLXeFSkLZN+HLmxJRdA7qWVyCo8gKSMJS0o8sfU7+zaQmlk= 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=MZn+Uo9n; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=LJcTbZ/f; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=MZn+Uo9n; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=LJcTbZ/f; arc=none smtp.client-ip=195.135.223.131 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-out2.suse.de (Postfix) with ESMTPS id 361961FB71; Wed, 21 Feb 2024 17:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708535682; 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=MZn+Uo9n8lU/zJ19j+4W7XM4Fjar/rLSwjeUl1dDtQteRDiNTcjAbXe6JMyOLMbEUx4zQj KW2k+z3XzCDC5iC8YdOfqA8THQU/KFCZkvfYcc6DeGtJqaV9Z04OHgxRUCyqiGQdII+WVi zjx+zgJTnO7CtquX6CMey12IbiDay/s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708535682; 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=LJcTbZ/fvkD8/JPuvGBxgoj6IBcOFNMc9CZ4/LLVkRuhfRaRRKDkxT43X8yWUqZmeuvgfG Dw29StcDn4wb+DDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708535682; 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=MZn+Uo9n8lU/zJ19j+4W7XM4Fjar/rLSwjeUl1dDtQteRDiNTcjAbXe6JMyOLMbEUx4zQj KW2k+z3XzCDC5iC8YdOfqA8THQU/KFCZkvfYcc6DeGtJqaV9Z04OHgxRUCyqiGQdII+WVi zjx+zgJTnO7CtquX6CMey12IbiDay/s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708535682; 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=LJcTbZ/fvkD8/JPuvGBxgoj6IBcOFNMc9CZ4/LLVkRuhfRaRRKDkxT43X8yWUqZmeuvgfG Dw29StcDn4wb+DDw== 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 EEB02139D0; Wed, 21 Feb 2024 17:14:41 +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 yUyVM4Ev1mV0KgAAD6G6ig (envelope-from ); Wed, 21 Feb 2024 17:14:41 +0000 From: Gabriel Krisman Bertazi To: ebiggers@kernel.org, viro@zeniv.linux.org.uk, jaegeuk@kernel.org Cc: 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 v7 07/10] ext4: Configure dentry operations at dentry-creation time Date: Wed, 21 Feb 2024 12:14:09 -0500 Message-ID: <20240221171412.10710-8-krisman@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221171412.10710-1-krisman@suse.de> References: <20240221171412.10710-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-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.30 X-Spamd-Result: default: False [-0.30 / 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)[]; REPLY(-4.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)[mit.edu,gmail.com,vger.kernel.org,lists.sourceforge.net,kernel.org,suse.de]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[14.47%] 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