Skip to content

Commit dc68c0f

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: fix the zoned RT growfs check for zone alignment
The grofs code for zoned RT subvolums already tries to check for zone alignment, but gets it wrong by using the old instead of the new mount structure. Fixes: 01b71e6 ("xfs: support growfs on zoned file systems") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Cc: stable@vger.kernel.org # v6.15 Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 982d261 commit dc68c0f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

fs/xfs/xfs_rtalloc.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,29 +1255,31 @@ xfs_growfs_check_rtgeom(
12551255
min_logfsbs = min_t(xfs_extlen_t, xfs_log_calc_minimum_size(nmp),
12561256
nmp->m_rsumblocks * 2);
12571257

1258-
kfree(nmp);
1259-
12601258
trace_xfs_growfs_check_rtgeom(mp, min_logfsbs);
12611259

12621260
if (min_logfsbs > mp->m_sb.sb_logblocks)
1263-
return -EINVAL;
1261+
goto out_inval;
12641262

12651263
if (xfs_has_zoned(mp)) {
12661264
uint32_t gblocks = mp->m_groups[XG_TYPE_RTG].blocks;
12671265
uint32_t rem;
12681266

12691267
if (rextsize != 1)
12701268
return -EINVAL;
1271-
div_u64_rem(mp->m_sb.sb_rblocks, gblocks, &rem);
1269+
div_u64_rem(nmp->m_sb.sb_rblocks, gblocks, &rem);
12721270
if (rem) {
12731271
xfs_warn(mp,
12741272
"new RT volume size (%lld) not aligned to RT group size (%d)",
1275-
mp->m_sb.sb_rblocks, gblocks);
1276-
return -EINVAL;
1273+
nmp->m_sb.sb_rblocks, gblocks);
1274+
goto out_inval;
12771275
}
12781276
}
12791277

1278+
kfree(nmp);
12801279
return 0;
1280+
out_inval:
1281+
kfree(nmp);
1282+
return -EINVAL;
12811283
}
12821284

12831285
/*

0 commit comments

Comments
 (0)