mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-10 20:36:21 +03:00
zhack: Fix importing large allocation profiles on small pools (#18256)
This patch fixes a segmentation fault in zhack metaslab leak which might
be triggered by feeding zhack with a fragmentation profile that's
exported from a pool larger than the target pool.
Fixes: 8f15d2e4d5
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com>
This commit is contained in:
parent
0f608aa6ca
commit
3408332d71
@ -745,8 +745,11 @@ zhack_do_metaslab_leak(int argc, char **argv)
|
||||
&start, &size), ==, 2);
|
||||
|
||||
ASSERT(vd);
|
||||
metaslab_t *cur =
|
||||
vd->vdev_ms[start >> vd->vdev_ms_shift];
|
||||
size_t idx;
|
||||
idx = start >> vd->vdev_ms_shift;
|
||||
if (idx >= vd->vdev_ms_count)
|
||||
continue;
|
||||
metaslab_t *cur = vd->vdev_ms[idx];
|
||||
if (prev != cur) {
|
||||
if (prev) {
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user