ext4_add_entry(): ->d_name.len is never 0
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Nov 2023 21:25:46 +0000 (16:25 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Dec 2023 17:53:11 +0000 (12:53 -0500)
That bogosity goes back to the initial merge of ext3.  Once upon a time
ext2 used to have a similar check; that got taken out during the switch
to page cache (June 2001).  ext3 got merged into mainline 5 months later,
still using buffer cache for directories; removal of the pointless check
in ext2 should've been done as a separate patch, but it hadn't been,
so that thing got missed...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ext4/namei.c

index d252935f9c8abbf72217451398287919b69d4c09..fa8b8dd841b56f0c256ab30e55ef8e61e0681216 100644 (file)
@@ -2388,8 +2388,6 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
 
        sb = dir->i_sb;
        blocksize = sb->s_blocksize;
-       if (!dentry->d_name.len)
-               return -EINVAL;
 
        if (fscrypt_is_nokey_name(dentry))
                return -ENOKEY;