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.
Reviewed-by: Brian Behlendorf <firstname.lastname@example.org>
Updated by Electric Monk almost 4 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed
commit 5bdd995ddb777f538bfbcc5e2d5ff1bed07ae56e Author: Richard Yao <email@example.com> Date: 2015-10-31T00:09:06.000Z 6386 Fix function call with uninitialized value in vdev_inuse Reviewed by: Brian Behlendorf <firstname.lastname@example.org> Reviewed by: Matthew Ahrens <email@example.com> Reviewed by: Dan Kimmel <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>