xfs: remove redundant extra assert from xfs_zone_gc_query
[email protected]
maintainerPATCH 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
@@ -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
Looks good:
Quoted 9 lines · On Mon, 09 Nov 2026 11:25:01 +0100, [email protected] wrote:
We initially assert that
iter->next_startblockis lower or equal than the total blocks in the rtg. If we are in the later case (next_startblockbeing 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 isnext_startblockbeing 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]>