]> git.proxmox.com Git - mirror_zfs.git/commit - tests/runfiles/common.run
zpool import -m also removing spare and cache when log device is missing
authorAmeer Hamza <ahamza@ixsystems.com>
Wed, 3 May 2023 22:10:32 +0000 (03:10 +0500)
committerGitHub <noreply@github.com>
Wed, 3 May 2023 22:10:32 +0000 (15:10 -0700)
commit82ac409acc77935ae366b800ee7cefb14939bbae
treea9a3b0215d47ce90daaf34abee1fa0c8ed4d1493
parenta46001adb9b143eebf43cd7ca4b508c044f80f00
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
module/zfs/spa.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_import/import_log_missing.ksh [new file with mode: 0755]