diff options
author | Olaf Faaland <[email protected]> | 2017-05-02 13:55:24 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-05-02 13:55:24 -0700 |
commit | 9d3f7b87919b7d0d869153ca72844f565cd0bf52 (patch) | |
tree | cdfb1aae9160c70ad29405d39cff1a5fb8ba7607 /include | |
parent | e7fbeb606a18b9f04daadddc19b9c4f9a9b34841 (diff) |
Write label 2,3 uberblocks when vdev expands
When vdev_psize increases, the location of labels 2 and 3 changes
because their location is relative to the end of the device.
The configs for labels 2 and 3 are written during the next spa_sync()
because the vdev is added to the dirty config list. However, the
uberblock rings are not re-written in their new location, leaving the
device vulnerable to the beginning of the device being overwritten or
damaged.
This patch copies the uberblock ring from label 0 to labels 2 and 3,
in their new locations, at the next sync after vdev_psize increases.
Also, add a test zpool_expand_004_pos.ksh to confirm the uberblocks
are copied.
Reviewed-by: BearBabyLiu <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Olaf Faaland <[email protected]>
Closes #5108
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/vdev_impl.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/vdev_impl.h b/include/sys/vdev_impl.h index d7f11a2b8..c9e9bede9 100644 --- a/include/sys/vdev_impl.h +++ b/include/sys/vdev_impl.h @@ -229,6 +229,7 @@ struct vdev { boolean_t vdev_cant_write; /* vdev is failing all writes */ boolean_t vdev_isspare; /* was a hot spare */ boolean_t vdev_isl2cache; /* was a l2cache device */ + boolean_t vdev_copy_uberblocks; /* post expand copy uberblocks */ vdev_queue_t vdev_queue; /* I/O deadline schedule queue */ vdev_cache_t vdev_cache; /* physical block cache */ spa_aux_vdev_t *vdev_aux; /* for l2cache and spares vdevs */ |