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.
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.
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.
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).