Bug 244831 - sysutils/openzfs-kmod 2020022700 mount of encrypted dataset fails with I/O error
Summary: sysutils/openzfs-kmod 2020022700 mount of encrypted dataset fails with I/O error
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kris Moore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-15 17:26 UTC by rk
Modified: 2020-08-16 14:35 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (kmoore)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rk 2020-03-15 17:26:27 UTC
After upgrading the openzfs-kmod port to version 2020022700
attempts to mount encrypted datasets on 12.1-STABLE r358220 amd64 fail.

Loading the encryption key with "zfs load-key dp/store" works
but mounting using "zfs mount dp/store" fails with
"I/O error" and no further messages.

The pool itself then shows

  pool: dp
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://zfsonlinux.org/msg/ZFS-8000-8A
  scan: scrub repaired 0B in 0 days 00:00:00 with 0 errors on Mon Sep 16 11:07:50 2019
config:

        NAME        STATE     READ WRITE CKSUM
        dp          ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            ada0p1  ONLINE       0     0     0
            ada1p1  ONLINE       0     0     0
            ada2p1  ONLINE       0     0     0
            ada3p1  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

        dp/store:<0x0>

Downgrading openzfs-kmod to version 2019101600 allows me to
mount the encrypted dataset again.
Comment 1 rk 2020-03-20 10:16:44 UTC
Using openzfs/openzfs-kmod port version 2019101600 for running a full scrub
on the pool cleared the error (without actually finding any issues):

  pool: dp
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://zfsonlinux.org/msg/ZFS-8000-8A
  scan: scrub in progress since Thu Mar 19 17:27:55 2020
        19.0T scanned at 731M/s, 19.0T issued at 731M/s, 19.0T total
        0B repaired, 100.00% done, 0 days 00:00:00 to go
config:

        NAME        STATE     READ WRITE CKSUM
        dp          ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            ada0p1  ONLINE       0     0     0
            ada1p1  ONLINE       0     0     0
            ada2p1  ONLINE       0     0     0
            ada3p1  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

        dp/store:<0x0>

After completing the scrub the pool is clean again:

  pool: dp
 state: ONLINE
  scan: scrub repaired 0B in 0 days 07:34:17 with 0 errors on Fri Mar 20 01:02:1
2 2020
config:

        NAME        STATE     READ WRITE CKSUM
        dp          ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            ada0p1  ONLINE       0     0     0
            ada1p1  ONLINE       0     0     0
            ada2p1  ONLINE       0     0     0
            ada3p1  ONLINE       0     0     0

errors: No known data errors


Everything looks fine and I can mount the encrypted dataset without
problems.

To investigate further, I upgraded to the current openzfs/openzfs-kmod
port version 2020031600 and tried to reproduce the issue:

# zfs load-key dp/store
Enter passphrase for 'dp/store':
# zfs mount dp/store
cannot mount 'dp/store': Input/output error
# zpool status -v dp
  pool: dp
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: https://zfsonlinux.org/msg/ZFS-8000-8A
  scan: scrub repaired 0B in 0 days 07:34:17 with 0 errors on Fri Mar 20 01:02:1
2 2020
config:

        NAME        STATE     READ WRITE CKSUM
        dp          ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            ada0p1  ONLINE       0     0     0
            ada1p1  ONLINE       0     0     0
            ada2p1  ONLINE       0     0     0
            ada3p1  ONLINE       0     0     0
 
errors: Permanent errors have been detected in the following files:

        dp/store:<0x0>


So version 2020031600 causes the same problem.
Comment 2 rk 2020-08-16 14:23:06 UTC
I just re-tested with the current version available in the
sysutils/openzfs and systuils/openzfs-kmod ports: 2020080800
The problem is still there. I cannot mount encrypted datasets
with it. It still fails with I/O error and marks the pool as corrupted.
Going back to openzfs 2019101600 and scrubbing the pool fixes the problems
and I can mount the encrypted datasets again.
Comment 3 rk 2020-08-16 14:35:04 UTC
When running with the newer code (2020080800), I tried to create
a new encrypted dataset. This works OK. I can even mount it successfully.
However, the older datasets that were created with older openzfs versions
cannot be mounted. Attempts to mount them always fail with I/O error
and render the pool corrupted (until zpool scrub is run on it).