HomeFreeBSD

Fix multihost stale cache file import

Description

Fix multihost stale cache file import

When the multihost property is enabled it should be impossible to
import an active pool even using the force (-f) option. This patch
prevents a forced import from succeeding when importing with a
stale cache file.

The root cause of the problem is that the kernel modules trusted
the hostid provided in configuration. This is always correct when
the configuration is generated by scanning for the pool. However,
when using an existing cache file the hostid could be stale which
would result in the activity check being skipped.

Resolve the issue by always using the hostid read from the label
configuration where the best uberblock was found.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6933
Closes #6971

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Dec 18 2017, 6:28 PM
GitHub <noreply@github.com>Committed on Dec 18 2017, 6:28 PM
Parents
rGe2d936e0f893: Honor --with-mounthelperdir where applicable
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGbbffb59efc49: Fix multihost stale cache file import (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Dec 18 2017, 6:28 PM