HomeFreeBSD

Fix recovery import (-F) with encrypted pool

Description

Fix recovery import (-F) with encrypted pool

When performing zil_claim() at pool import time, it is
important that encrypted datasets set os_next_write_raw
before writing to the zil_header_t. This prevents the code
from attempting to re-authenticate the objset_phys_t when
it writes it out, which is unnecessary because the
zil_header_t is not protected by either objset MAC and
impossible since the keys aren't loaded yet. Unfortunately,
one of the code paths did not set this flag, which causes
failed ASSERTs during 'zpool import -F'. This patch corrects
this issue.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #6864
Closes #6916

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Dec 4 2017, 7:10 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 2 2018, 7:39 PM
Parents
rGae76f45cda0e: Encryption Stability and On-Disk Format Fixes
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGd53bd7f5244a: Fix recovery import (-F) with encrypted pool (authored by Tom Caputi <tcaputi@datto.com>).Feb 2 2018, 7:39 PM