]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/vdev.c
Preserve asize when last mirror child promoted to top-level vdev
authorAndrew Barnes <barnes333@gmail.com>
Tue, 10 Jun 2014 06:29:12 +0000 (16:29 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 2 Jul 2014 21:04:29 +0000 (14:04 -0700)
commit61e99a73bc34d602639c5a991abdc1e011a52d8d
treeb402987d54ad459c0b06368dccd2d459552faa59
parentb8fce77b08d110e5f1b8d3161b888b3e6f8e750c
Preserve asize when last mirror child promoted to top-level vdev

If the smaller of 2 different sized child vdev's of a mirrored vdev is
detached, and the pool has the autoexpand property set to off, as the
remaining larger vdev is promoted to a top level vdev it fails to retain
the asize of the original top level mirror vdev and therefore partially
autoexpands.

This partially autoexpanded state leaves the new vdev too large to
re-mirror by adding the smaller vdev back in, and the pool fails to
utilize the space until next imported.

If the autoexpand property is set to on, the child vdev grows
in size after it has been promoted to a top level vdev as expected.

This commit causes the remaining child mirror to retain the asize of its
old parent mirror vdev if the autoexpand property is set to off,
this allows the smaller vdev to be re-added if required the vdev
can then be told to expand if required by the usual using zpool online -e.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Andrew Barnes <barnes333@gmail.com>
Signed-off-by: George Wilson <george.wilson@delphix.com>
Closes #1208
module/zfs/vdev.c