From patchwork Wed Dec 20 05:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 13499525 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1798DCA47; Wed, 20 Dec 2023 05:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="HDFtu6yu" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=duE4g5Ia2UG16LD2iQr91EPGHVpyuW2l4XuSdK8kuqQ=; b=HDFtu6yuFHkNPvIAjEE71Wjv2e NfXTza8VpIokRxipJV1PMES/LsoKt9+MooDUnHOuiMDloPzrN5v4rhbY27Pv23W9dexx8LWbNKJTm bli+odXTQk3b+lb2S/pxT1h1DcQczVabTOF9mpM/sJtAq/GdRBGOeyT23R0IdRa1pJ7Hb58sL1BFN YanO2ZhVurVrq05Agir2ogIS5sG6cYy97P3vQDeJWaIEk/K0xXjRfZ2TFkg9/luGj4s88EriAq4Kd Oze4C+qZaOup21uyvj6no7Q+z1FU8EQR3Zw8zZzFw/Ic3sN+q+KFEZXhOuJnXmK35Sir/HquW1o/n ze+IWVhQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rFp6M-00HJE1-39; Wed, 20 Dec 2023 05:26:39 +0000 Date: Wed, 20 Dec 2023 05:26:38 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: ocfs2-devel@lists.linux.dev Subject: [PATCH 14/22] __ocfs2_add_entry(), ocfs2_prepare_dir_for_insert(): namelen checks Message-ID: <20231220052638.GM1674809@ZenIV> References: <20231220051348.GY1674809@ZenIV> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231220051348.GY1674809@ZenIV> Sender: Al Viro 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(-) 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. * From patchwork Wed Dec 20 05:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 13499538 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BF2615AC7; Wed, 20 Dec 2023 05:31:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="RVKU61um" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZHgu0AQ/45c1KhOXk4b/ywGXu8x5KY6GeTbYpQi4v/E=; b=RVKU61um3Adbdte+S06pAz6h57 DWPdD4bODQ3cG/0V0l5INNZiU3oanM1z5gsIMc+bty+VDsZEG5jBC1UZwvPOCRQDphNyCFR6T8C/A 41SpBERtJoxAmpRYrdbQxdXt6+47OjT5sMvIUg7xc4E4dJklT0tLKRXrKtu3wjh8Y+ucH5P2pD+7W 31SG0CjHDSenwD6VT4JahkyvKu1NSj5oEoGzA003oc2kGoenCpdfHCAizxSmrkeO8vamZIUEVQUqO WBN7314J0Ma00qqgNJ1QLGIFcFUUrNT2Wc9nTmSTSVJu2usV88MdiMKDj4bQLQxyM4qzAyAJllbHB TrDgeJ7g==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rFpAd-00HJaz-0F; Wed, 20 Dec 2023 05:31:03 +0000 Date: Wed, 20 Dec 2023 05:31:03 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: ocfs2-devel@lists.linux.dev Subject: [PATCH 19/22] ocfs2_find_match(): there's no such thing as NULL or negative ->d_parent Message-ID: <20231220053103.GR1674809@ZenIV> References: <20231220051348.GY1674809@ZenIV> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231220051348.GY1674809@ZenIV> Sender: Al Viro Signed-off-by: Al Viro --- fs/ocfs2/dcache.c | 7 ------- 1 file changed, 7 deletions(-) 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;