HomeFreeBSD

Fix function call with uninitialized value in vdev_inuse

Description

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

Details

Provenance
Richard Yao <ryao@gentoo.org>Authored on Apr 23 2014, 3:18 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 23 2014, 5:32 PM
Parents
rG928ee9fe1845: Properly NULL terminate string in zfs_strcmp_pathname
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG485c581c41c4: Fix function call with uninitialized value in vdev_inuse (authored by Richard Yao <ryao@gentoo.org>).Sep 23 2014, 5:32 PM