Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp625478rdb; Mon, 29 Jan 2024 12:46:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkk5QfO2/YNZhh32PBSDjOZJsMLG5S+G1/69lKPHn29I954nruWa2RZhiEXKgMFs96wLn5 X-Received: by 2002:a05:6808:220b:b0:3bd:e1c8:aac6 with SMTP id bd11-20020a056808220b00b003bde1c8aac6mr7298439oib.32.1706561172111; Mon, 29 Jan 2024 12:46:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706561172; cv=pass; d=google.com; s=arc-20160816; b=rvJtDWQc6BsyvtSjchZKKp+6QZQw3TTqGEMAFfzAQ0s00zsIQyEKTr1cNdiq2PKab+ jS48RenJeKxygdosAMcTxe3L6k8TgYeEKQOTwCIJYvasevKjVzg5Y4R3xSwepGSkRZjz W/rdaN22R+ycIR74P9oYzTkytukTW7DKCWD+iAcc9o+4Hyf5hMnkxua/ijPvYzRAH77K Gj93NuVA1xoAmenKyczoyPzycaNe6j+5cjpAGUd513Ih3VrkqLQP90JKYwz8/LUDN5s4 mQzlIBP/pV1ZxIi576d5j39pKdlrp3I6/pUkPO/ZdeNGibxT8ekOBhu1ukcJ/aemgrVb dibQ== 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; bh=dAXxsZUzQs43nPmCR7QF70NpWme+IPIt3kqL7m9PrBY=; fh=M648oune0DwZmCHpgeKmdqyNG9Pnhrh1APj5VeeCjyQ=; b=uJLMvKET1FQdwhngAOnwy2X55KnxPE6wCVt4z0Osw1Ui+YMSq2sWJd6Gy3rJ2BW3j2 izxXnE4ws5khaNWAFaGXa6Dxb9WPMxcqhM/EQvDnXiyTV5AwTRe+yR8A76ACdorLgbSE Fp52Rrn3o4mUlLwV5+DogEBjk4T6Ry+eGimPPcvD4uxLiXo+yod04bLBIz9R8gYvS/a+ Emt3Y4/hzxNh8qFL+5HCsl3hq8Cg+IefmHxmQQkMiZklwAWeVQMZxueYEpb8bXRLdcRw HIGMXJPzYfkWueGchlvqqQl7GHbaNGxea4BS8jU9XJp4WesKsFeiA+NzVf89tE+rLJY8 4pSw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k79-20020a628452000000b006dbc98ff8desi6310040pfd.147.2024.01.29.12.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 12:46:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 40A4AB231D2 for ; Mon, 29 Jan 2024 20:44:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FDF315956B; Mon, 29 Jan 2024 20:44:14 +0000 (UTC) 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 A41BA157E92; Mon, 29 Jan 2024 20:44:11 +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=1706561054; cv=none; b=jOvm47zAUDtPeCNZusurD6m7YlU5He32LtMkDLRocDwaUic6C08tMhJeE660e8XQkX5XgMOirLcZXWEzP5ZKXsYiq01QHGWOAPgjcqCIXVsJK8eKY62gA2vUWyWpzq2HJgMG294/nOF57FiE+6b1t5Xe5titDzpVOhmZY/nZ6aY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706561054; c=relaxed/simple; bh=SyI2wLhlC/SY13QjjJmfT+fhtHMRlxjaM0zdsPjwQH4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VPm4CSalIxlSVAWNE3jlOfo8qhYkyifw7TmTdcLKHv/nrgQul0JmjoGCpxqBUyc4XPPYRUZQR9TDKAR3nfePZ+KK2+YcIzz8UBv0E+GcrQbo6PerU/uy0TZnUQY35G7U/+VBZccNjhhpVTw2I9Wrol5pvzGwx6Gvj1MuHvsZI6I= 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; 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 [IPv6:2a07:de40:b281:104: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 E55342208D; Mon, 29 Jan 2024 20:44:09 +0000 (UTC) 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 46F9712FF7; Mon, 29 Jan 2024 20:44:09 +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 hepvAxkOuGXyDAAAD6G6ig (envelope-from ); Mon, 29 Jan 2024 20:44:09 +0000 From: Gabriel Krisman Bertazi To: ebiggers@kernel.org, viro@zeniv.linux.org.uk, jaegeuk@kernel.org, tytso@mit.edu Cc: amir73il@gmail.com, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Gabriel Krisman Bertazi Subject: [PATCH v5 09/12] ext4: Configure dentry operations at dentry-creation time Date: Mon, 29 Jan 2024 17:43:27 -0300 Message-ID: <20240129204330.32346-10-krisman@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129204330.32346-1-krisman@suse.de> References: <20240129204330.32346-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 X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: E55342208D 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 --- 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