zfs/lib
наб 3430eced80 libzfs: zfs_mount_at(): load key for encryption root if MS_CRYPT
zfs_crypto_load_key() only works on encryption roots,
and zfs mount -la would fail if it encounters a datasets that
is sorted before their encroots.

To trigger:
  truncate -s 40G /tmp/test
  dd if=/dev/urandom of=/tmp/k bs=128 count=1 status=none
  zpool create -O encryption=on -O keylocation=file:///tmp/k \
               -O keyformat=passphrase test /tmp/test
  zfs create -o mountpoint=/a test/a
  zfs create -o mountpoint=/b test/b
  zfs umount test
  zfs unload-key test
  zfs mount -la

The final mount errored out with:
  Key load error: Keys must be loaded for
    encryption root of 'test/a' (test).
  Key load error: Keys must be loaded for
    encryption root of 'test/b' (test).

And only /test was mounted

This technically breaks the libzfs API, but the previous behavior was
decidedly a bug.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11870 
Closes #11875
2021-06-23 13:22:14 -07:00
..
libavl Fixes for make dist 2020-06-26 14:20:02 -07:00
libefi pool may become suspended during device expansion 2020-09-18 12:38:30 -07:00
libicp Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libnvpair Include the ABI with dist tarball 2020-11-22 10:01:47 -08:00
libshare zpool command complains about /etc/exports.d 2020-10-01 12:20:06 -07:00
libspl FreeBSD: fix HEAD build, conditionally remove FDSYNC defines 2021-01-24 16:05:56 -08:00
libtpool Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libunicode Fixes for make dist 2020-06-26 14:20:02 -07:00
libuutil Fix a resource leak in uu_avl_pool_destroy 2021-01-28 11:39:00 -08:00
libzfs libzfs: zfs_mount_at(): load key for encryption root if MS_CRYPT 2021-06-23 13:22:14 -07:00
libzfs_core libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds 2021-06-23 13:22:14 -07:00
libzfsbootenv libzfsbootenv: do not depend on libnvpair 2020-11-24 10:27:14 -08:00
libzpool libzpool: set_global_var: fix endianness handling (fixes zdb -o ) 2021-03-05 12:51:48 -08:00
libzstd Avoid symbol collision with in-kernel zstdlib 2020-08-24 12:20:41 -07:00
libzutil libzutil: zfs_isnumber(): return false if input empty 2021-06-23 13:22:14 -07:00
Makefile.am Library ABI tracking with abigail 2020-11-17 20:29:02 +00:00