block/011: recover test target devices to online or live status
The test case runs fio while disabling and enabling PCI device of the
test target block device. This often leaves the devices in offline or
dead status. For example, when the block device is a HDD connected to
HBA, kernel makes the device into offline mode with this message:
sd x:x:x:x Device offlined - not ready after error recovery
This causes following test cases to fail. To avoid the failure, remove
and rescan the devices to get them back to online or live status. This
improvement is similar as the commit
f8f33218eca7 ("block/011: recover
test target NVME device capacity"). While at this change, improve code
comments for the commit
f8f33218eca7, and add missing local variable
declarations.
Of note is that the added rescan operation triggers a lockdep WARN if
the system has devices which depend on P2SB [1].
[1] https://lore.kernel.org/linux-pci/6xb24fjmptxxn5js2fjrrddjae6twex5bjaftwqsuawuqqqydx@7cl3uik5ef6j/
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>