Skip to contentSkip to conversation

ocfs2-remove-redundant-null-check-in-rename-path.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jul 10, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: ocfs2: remove redundant NULL check in rename path
has been removed from the -mm tree. Its filename was
ocfs2-remove-redundant-null-check-in-rename-path.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Long Li <[email protected]>
Subject: ocfs2: remove redundant NULL check in rename path
Date: Tue, 17 Jun 2025 09:25:34 +0800

The code checks newfe_bh for NULL after it has already been dereferenced to access b_data. This NULL check is unnecessary for two reasons:

1. If ocfs2_inode_lock() succeeds (returns >= 0), newfe_bh is guaranteed to be valid.
2. We've already dereferenced newfe_bh to access b_data, so it must be non-NULL at this point.

Remove the redundant NULL check in the trace_ocfs2_rename_over_existing() call to improve code clarity.

---

 fs/ocfs2/namei.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/namei.c renamed from fs/ocfs2/namei.c~ocfs2-remove-redundant-null-check-in-rename-path +2 -2
@@ -1452,8 +1452,8 @@ static int ocfs2_rename(struct mnt_idmap
 		newfe = (struct ocfs2_dinode *) newfe_bh->b_data;
 
 		trace_ocfs2_rename_over_existing(
-		     (unsigned long long)newfe_blkno, newfe_bh, newfe_bh ?
-		     (unsigned long long)newfe_bh->b_blocknr : 0ULL);
+		     (unsigned long long)newfe_blkno, newfe_bh,
+		     (unsigned long long)newfe_bh->b_blocknr);
 
 		if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) {
 			status = ocfs2_prepare_orphan_dir(osb, &orphan_dir,

_

Patches currently in -mm which might be from [email protected] are