From b64b0732c3eec11783dd6bb12757dc04395a73e1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 12 Nov 2023 17:03:14 -0500 Subject: __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 --- fs/ocfs2/dir.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'fs/ocfs2') diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index a14c8fee6ee5..d620d4c53c6f 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -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. * -- cgit v1.2.3 From fda43691041c7ee685da903641402a0f913fe9e9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 14 Nov 2023 12:20:22 -0500 Subject: ocfs2_find_match(): there's no such thing as NULL or negative ->d_parent Signed-off-by: Al Viro --- fs/ocfs2/dcache.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'fs/ocfs2') diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index 04fc8344063a..a9b8688aaf30 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -124,17 +124,10 @@ static int ocfs2_match_dentry(struct dentry *dentry, if (!dentry->d_fsdata) return 0; - if (!dentry->d_parent) - return 0; - if (skip_unhashed && d_unhashed(dentry)) return 0; parent = d_inode(dentry->d_parent); - /* Negative parent dentry? */ - if (!parent) - return 0; - /* Name is in a different directory. */ if (OCFS2_I(parent)->ip_blkno != parent_blkno) return 0; -- cgit v1.2.3