HomeFreeBSD

zpool import -m also removing spare and cache when log device is missing

Description

zpool import -m also removing spare and cache when log device is missing

spa_import() relies on a pool config fetched by spa_try_import() for
spare/cache devices. Import flags are not passed to spa_tryimport(),
which makes it return early due to a missing log device and missing
retrieving the cache device and spare eventually. Passing
ZFS_IMPORT_MISSING_LOG to spa_tryimport() makes it fetch the correct
configuration regardless of the missing log device.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #14794

Details

Provenance
Ameer Hamza <ahamza@ixsystems.com>Authored on May 3 2023, 10:10 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on May 5 2023, 4:07 PM
Parents
rG33075e465f82: Allow MMP to bypass waiting for other threads
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG75ec145710e5: zpool import -m also removing spare and cache when log device is missing (authored by Ameer Hamza <ahamza@ixsystems.com>).May 5 2023, 4:07 PM