]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
shmem_whiteout(): fix regression from tree-in-dcache series
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Dec 2025 17:36:15 +0000 (12:36 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Dec 2025 03:28:53 +0000 (22:28 -0500)
Now that shmem_mknod() hashes the new dentry, d_rehash() in
shmem_whiteout() should be removed.

X-paperbag: brown
Reported-by: Hugh Dickins <hughd@google.com>
Acked-by: Hugh Dickins <hughd@google.com>
Tested-by: Hugh Dickins <hughd@google.com>
Fixes: 2313598222f9 ("convert ramfs and tmpfs")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
mm/shmem.c

index 3f194c9842a8caabf1405a3822167346b22810c0..d3edc809e2e716dbba4ce0b70ce8947a998c90ae 100644 (file)
@@ -4019,22 +4019,10 @@ static int shmem_whiteout(struct mnt_idmap *idmap,
        whiteout = d_alloc(old_dentry->d_parent, &old_dentry->d_name);
        if (!whiteout)
                return -ENOMEM;
-
        error = shmem_mknod(idmap, old_dir, whiteout,
                            S_IFCHR | WHITEOUT_MODE, WHITEOUT_DEV);
        dput(whiteout);
-       if (error)
-               return error;
-
-       /*
-        * Cheat and hash the whiteout while the old dentry is still in
-        * place, instead of playing games with FS_RENAME_DOES_D_MOVE.
-        *
-        * d_lookup() will consistently find one of them at this point,
-        * not sure which one, but that isn't even important.
-        */
-       d_rehash(whiteout);
-       return 0;
+       return error;
 }
 
 /*