Skip to content

Commit b64b073

Browse files
author
Al Viro
committed
__ocfs2_add_entry(), ocfs2_prepare_dir_for_insert(): namelen checks
namelen can't be zero; neither when it's coming from dentry name, nor when dealing with orphans (in ocfs2_orphan_add() and __ocfs2_prepare_orphan_dir()). Rudiment of old ext2 pointless check, long gone in ext2 itself... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 556f38b commit b64b073

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

fs/ocfs2/dir.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,9 +1593,6 @@ int __ocfs2_add_entry(handle_t *handle,
15931593
struct buffer_head *insert_bh = lookup->dl_leaf_bh;
15941594
char *data_start = insert_bh->b_data;
15951595

1596-
if (!namelen)
1597-
return -EINVAL;
1598-
15991596
if (ocfs2_dir_indexed(dir)) {
16001597
struct buffer_head *bh;
16011598

@@ -4245,12 +4242,6 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
42454242
trace_ocfs2_prepare_dir_for_insert(
42464243
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen);
42474244

4248-
if (!namelen) {
4249-
ret = -EINVAL;
4250-
mlog_errno(ret);
4251-
goto out;
4252-
}
4253-
42544245
/*
42554246
* Do this up front to reduce confusion.
42564247
*

0 commit comments

Comments
 (0)