]> granicus.if.org Git - zfs/commit
Fix import wrong spare/l2 device when path change
authorChunwei Chen <david.chen@osnexus.com>
Thu, 25 May 2017 22:56:12 +0000 (15:56 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jun 2017 13:39:42 +0000 (06:39 -0700)
commitb870c4b5d716d87ddfb29f28745e639dd635fd5f
treecb333fe3b5ec001151b76413d92b745f74e6f6e0
parent2e9c8dbddfa5d53aa2f9c508e3dc1263d89466ad
Fix import wrong spare/l2 device when path change

If, for example, your aux device was /dev/sdc, but now the aux device is
removed and /dev/sdc points to other device. zpool import will still
use that device and corrupt it.

The problem is that the spa_validate_aux in spa_import, rather than
validate the on-disk label, it would actually write label to disk. We
remove them since spa_load_{spares,l2cache} seems to do everything we
need and they would actually validate on-disk label.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #6158
module/zfs/spa.c