diff options
author | George Wilson <[email protected]> | 2012-04-08 13:23:08 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-04-11 11:32:06 -0700 |
commit | 5ffb9d1d05d7c512b987dff51f587466d537770f (patch) | |
tree | 9ac15361477cfe4f3e34d1bfb1c27e978dbb3530 /module/zfs/vdev.c | |
parent | b129c6590e07edcc95f3b64ec210d94cf885c192 (diff) |
Illumos #1951: leaking a vdev when removing an l2cache device
1952 memory leak when adding a file-based l2arc device
1954 leak in ZFS from metaslab_group_create and zfs_ereport_checksum
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Matt Ahrens <[email protected]>
Reviewed by: Eric Schrock <[email protected]>
Reviewed by: Bill Pijewski <[email protected]>
Reviewed by: Dan McDonald <[email protected]>
Approved by: Eric Schrock <[email protected]>
References to Illumos issues:
https://www.illumos.org/issues/1951
https://www.illumos.org/issues/1952
https://www.illumos.org/issues/1954
Ported-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #650
Diffstat (limited to 'module/zfs/vdev.c')
-rw-r--r-- | module/zfs/vdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 9f044b68c..1630d2fae 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -492,7 +492,7 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvlist_t *nv, vdev_t *parent, uint_t id, &vd->vdev_removing); } - if (parent && !parent->vdev_parent) { + if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { ASSERT(alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_ADD || alloctype == VDEV_ALLOC_SPLIT || @@ -669,6 +669,8 @@ vdev_top_transfer(vdev_t *svd, vdev_t *tvd) svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + if (tvd->vdev_mg) + ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); tvd->vdev_mg = svd->vdev_mg; tvd->vdev_ms = svd->vdev_ms; |