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