Commit b64b0732 authored by Al Viro's avatar Al Viro
Browse files

__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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 556f38bf
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1593,9 +1593,6 @@ int __ocfs2_add_entry(handle_t *handle,
	struct buffer_head *insert_bh = lookup->dl_leaf_bh;
	char *data_start = insert_bh->b_data;

	if (!namelen)
		return -EINVAL;

	if (ocfs2_dir_indexed(dir)) {
		struct buffer_head *bh;

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

	if (!namelen) {
		ret = -EINVAL;
		mlog_errno(ret);
		goto out;
	}

	/*
	 * Do this up front to reduce confusion.
	 *