Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 01b71e64bb87 ("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>

authored by

Christoph Hellwig and committed by
Carlos Maiolino
dc68c0f6 982d2616

+8 -6
+8 -6
fs/xfs/xfs_rtalloc.c
··· 1255 1255 min_logfsbs = min_t(xfs_extlen_t, xfs_log_calc_minimum_size(nmp), 1256 1256 nmp->m_rsumblocks * 2); 1257 1257 1258 - kfree(nmp); 1259 - 1260 1258 trace_xfs_growfs_check_rtgeom(mp, min_logfsbs); 1261 1259 1262 1260 if (min_logfsbs > mp->m_sb.sb_logblocks) 1263 - return -EINVAL; 1261 + goto out_inval; 1264 1262 1265 1263 if (xfs_has_zoned(mp)) { 1266 1264 uint32_t gblocks = mp->m_groups[XG_TYPE_RTG].blocks; ··· 1266 1268 1267 1269 if (rextsize != 1) 1268 1270 return -EINVAL; 1269 - div_u64_rem(mp->m_sb.sb_rblocks, gblocks, &rem); 1271 + div_u64_rem(nmp->m_sb.sb_rblocks, gblocks, &rem); 1270 1272 if (rem) { 1271 1273 xfs_warn(mp, 1272 1274 "new RT volume size (%lld) not aligned to RT group size (%d)", 1273 - mp->m_sb.sb_rblocks, gblocks); 1274 - return -EINVAL; 1275 + nmp->m_sb.sb_rblocks, gblocks); 1276 + goto out_inval; 1275 1277 } 1276 1278 } 1277 1279 1280 + kfree(nmp); 1278 1281 return 0; 1282 + out_inval: 1283 + kfree(nmp); 1284 + return -EINVAL; 1279 1285 } 1280 1286 1281 1287 /*