Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 4, 2023

Conversation

ixhamza
Copy link

@ixhamza ixhamza commented May 4, 2023

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 openzfs#14794

Motivation and Context

Description

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

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 openzfs#14794
@ixhamza ixhamza requested review from amotin and usaleem-ix May 4, 2023 14:05
@ixhamza
Copy link
Author

ixhamza commented May 4, 2023

zfs-2.1.12 PR: openzfs#14821

@ixhamza ixhamza merged commit a03a950 into truenas/zfs-2.1-release May 4, 2023
16 of 18 checks passed
@ixhamza ixhamza deleted the NAS-117393-truenas branch May 4, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants