Skip to contentSkip to conversation

xfs: remove redundant extra assert from xfs_zone_gc_query

PATCH Applied [email protected] 2 participants 3 messages Nov 9 – Nov 18 XFS filesystem

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 xfs: remove redundant extra assert from xfs_zone_gc_query

From: Carlos Maiolino <[email protected]>

We initially assert that iter->next_startblock is lower or equal than the total blocks in the rtg. If we are in the later case (next_startblock being equal to blocks in rtg) the conditional right after the first assert, will jump out of the function. After the conditional, the only remaining case is next_startblock being lower than the rtg block count. So the second assert seems redundant to me.

---
 fs/xfs/xfs_zone_gc.c | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/xfs_zone_gc.c +0 -1
index cea5447a886d..00644d997963 100644
@@ -337,7 +337,6 @@ xfs_zone_gc_query(
 	if (iter->next_startblock == rtg_blocks(rtg))
 		goto done;
 
-	ASSERT(iter->next_startblock < rtg_blocks(rtg));
 	ri_low.rm_startblock = iter->next_startblock;
 	memset(&ri_high, 0xFF, sizeof(ri_high));
 
Signature · 1 line
2.56.0
author maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 9 lines · On Mon, 09 Nov 2026 11:25:01 +0100, [email protected] wrote:

We initially assert that iter->next_startblock is lower or equal than the total blocks in the rtg. If we are in the later case (next_startblock being equal to blocks in rtg) the conditional right after the first assert, will jump out of the function. After the conditional, the only remaining case is next_startblock being lower than the rtg block count. So the second assert seems redundant to me.

[...]

Applied to for-next, thanks!

[1/1] xfs: remove redundant extra assert from xfs_zone_gc_query

      commit: e5d3bcc6897a30d4a47e0332bc86a7c2bd44a6c8

Best regards,

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