]> granicus.if.org Git - zfs/commit
Fix function call with uninitialized value in vdev_inuse
authorRichard Yao <ryao@gentoo.org>
Wed, 23 Apr 2014 03:18:17 +0000 (23:18 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 23 Sep 2014 17:32:45 +0000 (10:32 -0700)
commit485c581c41c4da15a17f045605ce5a7562b3b8a2
treefbf3828260c5b8a878f6f021dfa364a6e39de037
parent928ee9fe184572a50e686b0c5173edb1b538c627
Fix function call with uninitialized value in vdev_inuse

LLVM's static analyzer reported that we could pass an uninitialized
pool_guid to spa_by_guid() in vdev_inuse(). Upon review, it is correct.
An attempt to repurpose a spare or L2ARC drive from an exported pool
will cause the pool_guid passed to spa_by_guid() to be unintialized
information from the stack. This will cause non-deterministic behavior.
Since there is no reason why we cannot repurpose such disks, we modify
vdev_inuse() to avoid calling spa_by_guid() when they are detected.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2330
module/zfs/vdev_label.c