aboutsummaryrefslogtreecommitdiff
path: root/module/zfs/vdev_raidz.c
diff options
context:
space:
mode:
authorPaul Dagnelie <pcd@delphix.com>2025-06-27 18:54:20 +0000
committerGitHub <noreply@github.com>2025-06-27 18:54:20 +0000
commit69ee01aa4b106dd57016b0d756201ecf7c211d46 (patch)
tree285508b891b7eb6ea7561ac0356dea507c0cdcba /module/zfs/vdev_raidz.c
parentea076d6921d08deb22f51ff7f4ba00a08bc9dd86 (diff)
Diffstat (limited to 'module/zfs/vdev_raidz.c')
-rw-r--r--module/zfs/vdev_raidz.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c
index 5941e645e750..71c4bfbdaf00 100644
--- a/module/zfs/vdev_raidz.c
+++ b/module/zfs/vdev_raidz.c
@@ -2257,6 +2257,14 @@ vdev_raidz_asize_to_psize(vdev_t *vd, uint64_t asize, uint64_t txg)
ASSERT0(asize % (1 << ashift));
psize = (asize >> ashift);
+ /*
+ * If the roundup to nparity + 1 caused us to spill into a new row, we
+ * need to ignore that row entirely (since it can't store data or
+ * parity).
+ */
+ uint64_t rows = psize / cols;
+ psize = psize - (rows * cols) <= nparity ? rows * cols : psize;
+ /* Subtract out parity sectors for each row storing data. */
psize -= nparity * DIV_ROUND_UP(psize, cols);
psize <<= ashift;