public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 12/22] ext4_add_entry(): ->d_name.len is never 0
       [not found] <20231220051348.GY1674809@ZenIV>
@ 2023-12-20  5:24 ` Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2023-12-20  5:24 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Theodore Ts'o, linux-ext4

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 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index d252935f9c8a..fa8b8dd841b5 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -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;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-20  5:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20231220051348.GY1674809@ZenIV>
2023-12-20  5:24 ` [PATCH 12/22] ext4_add_entry(): ->d_name.len is never 0 Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox