Skip to content

Commit 04aa5f4

Browse files
committed
ext4: Configure dentry operations at dentry-creation time
This was already the case for case-insensitive before commit bb9cd91 ("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. Acked-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Eric Biggers <ebiggers@google.com> Link: https://lore.kernel.org/r/20240221171412.10710-8-krisman@suse.de Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
1 parent 70dfe3f commit 04aa5f4

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

fs/ext4/namei.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,6 @@ static struct buffer_head *ext4_lookup_entry(struct inode *dir,
17621762
struct buffer_head *bh;
17631763

17641764
err = ext4_fname_prepare_lookup(dir, dentry, &fname);
1765-
generic_set_encrypted_ci_d_ops(dentry);
17661765
if (err == -ENOENT)
17671766
return NULL;
17681767
if (err)

fs/ext4/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5484,6 +5484,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
54845484
goto failed_mount4;
54855485
}
54865486

5487+
generic_set_sb_d_ops(sb);
54875488
sb->s_root = d_make_root(root);
54885489
if (!sb->s_root) {
54895490
ext4_msg(sb, KERN_ERR, "get root dentry failed");

0 commit comments

Comments
 (0)