Skip to contentSkip to conversation

xfs: fix wrong lookup direction in xfs_refcount_lookup_eq tracepoint

PATCH Applied [email protected] 2 participants 3 messages Nov 26 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: fix wrong lookup direction in xfs_refcount_lookup_eq tracepoint

From: Jianyun Gao <[email protected]>

The trace_xfs_refcount_lookup() call in xfs_refcount_lookup_eq() passes XFS_LOOKUP_LE. But the actual btree lookup below uses XFS_LOOKUP_EQ, so the trace record reports a mismatched lookup direction and misleads debugging.

Fixes 08daa3ccf541b8 ("xfs: add repair helpers for the reference count btree")
---
 fs/xfs/libxfs/xfs_refcount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_refcount.c +1 -1
index 75e469576a8b..6a15a1afed1a 100644
@@ -96,7 +96,7 @@ xfs_refcount_lookup_eq(
 {
 	trace_xfs_refcount_lookup(cur,
 			xfs_refcount_encode_startblock(bno, domain),
-			XFS_LOOKUP_LE);
+			XFS_LOOKUP_EQ);
 	cur->bc_rec.rc.rc_startblock = bno;
 	cur->bc_rec.rc.rc_blockcount = 0;
 	cur->bc_rec.rc.rc_domain = domain;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · On Thu, Nov 26, 2026 at 10:34:01AM +0800, [email protected] wrote:

From: Jianyun Gao <[email protected]>

The trace_xfs_refcount_lookup() call in xfs_refcount_lookup_eq() passes XFS_LOOKUP_LE. But the actual btree lookup below uses XFS_LOOKUP_EQ, so the trace record reports a mismatched lookup direction and misleads debugging.

Fixes 08daa3ccf541b8 ("xfs: add repair helpers for the reference count btree")
---
 fs/xfs/libxfs/xfs_refcount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/libxfs/xfs_refcount.c +0 -0
index 75e469576a8b..6a15a1afed1a 100644

fs/xfs/libxfs/xfs_refcount.c xfs_refcount_lookup_eq( · line 102

Quoted 8 lines
fs/xfs/libxfs/xfs_refcount.c +1 -1
@@ -96,7 +96,7 @@ xfs_refcount_lookup_eq(
 {
 	trace_xfs_refcount_lookup(cur,
 			xfs_refcount_encode_startblock(bno, domain),
-			XFS_LOOKUP_LE);
+			XFS_LOOKUP_EQ);
 	cur->bc_rec.rc.rc_startblock = bno;
 	cur->bc_rec.rc.rc_blockcount = 0;
 	cur->bc_rec.rc.rc_domain = domain;
Quoted 4 lines
Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On Thu, 26 Nov 2026 10:34:01 +0800, [email protected] wrote:

The trace_xfs_refcount_lookup() call in xfs_refcount_lookup_eq() passes XFS_LOOKUP_LE. But the actual btree lookup below uses XFS_LOOKUP_EQ, so the trace record reports a mismatched lookup direction and misleads debugging.

Applied to for-next, thanks!

[1/1] xfs: fix wrong lookup direction in xfs_refcount_lookup_eq tracepoint

      commit: a2a0791c4ef58ce943c7925491f31be95ebc7624

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>