diff options
author | Brian Behlendorf <[email protected]> | 2019-01-15 15:46:58 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2019-01-15 15:46:58 -0800 |
commit | 6e91a72fe3ff8bb282490773bd687632f3e8c79d (patch) | |
tree | 3eeada19664d8b2b4449c55fdb90c76fed5e17dc /tests | |
parent | 5e7f3ace5807f950f3529361e03970101e61aa44 (diff) |
Disable 'zfs remap' command
The implementation of 'zfs remap' has proven to be problematic since
it modifies the objset (but not its logical contents) by dirtying
metadata without owning it. The consequence of which is that
dmu_objset_remap_indirects() is vulnerable to certain races.
For example, if we are in the middle of receiving into the filesystem
while it is being remapped. Then it is possible we could evict the
objset when the receive completes (see dsl_dataset_clone_swap_sync_impl,
or dmu_recv_end_sync), but dmu_objset_remap_indirects() may be still
using the objset. The result of which would be a panic.
Extended runs of ztest(8) have exposed other possible races which
can occur when using 'zfs remap'. Several of these have been fixed
but there may be others which have not yet been encountered and
diagnosed.
Furthermore, the ability to manually remap a filesystem is no longer
particularly useful now that the removal code can map large chunks.
Coupled with the fact that explaining what this command does and why
it may be useful requires a detailed understanding of the internals
of device removal. These are details users should not be bothered
with.
Therefore, the 'zfs remap' command is being disabled but not entirely
removed. It may be removed in the future or potentially reworked
to address the issues described above. Since 'zfs remap' has never
been part of a tagged release its removal is expected to have
minimal impact.
The ZTS tests have been updated to continue to exercise the command
to prevent atrophy, but it has been removed entirely from ztest(8).
Reviewed by: Matt Ahrens <[email protected]>
Reviewed by: Tom Caputi <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #8238
Diffstat (limited to 'tests')
6 files changed, 18 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh index b03a8b4c8..2371c5a26 100755 --- a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh +++ b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh @@ -55,7 +55,10 @@ log_must zpool list -v $TESTPOOL # # remove a special allocation vdev and force a remapping +# N.B. The 'zfs remap' command has been disabled and may be removed. # +export ZFS_REMAP_ENABLED=YES + log_must zpool remove $TESTPOOL $CLASS_DISK0 log_must zfs remap $TESTPOOL/$TESTFS diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_cliargs.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_cliargs.ksh index 9a0b7d619..80a5e6e0d 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_cliargs.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_cliargs.ksh @@ -27,6 +27,9 @@ # 3. Verify other unsupported parameters raise an error # +# The 'zfs remap' command has been disabled and may be removed. +export ZFS_REMAP_ENABLED=YES + verify_runnable "both" function cleanup diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_obsolete_counts.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_obsolete_counts.ksh index 15d3ae493..1f0e0e85d 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_obsolete_counts.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_remap/zfs_remap_obsolete_counts.ksh @@ -29,6 +29,9 @@ # feature@obsolete_counts is enabled # +# N.B. The 'zfs remap' command has been disabled and may be removed. +export ZFS_REMAP_ENABLED=YES + verify_runnable "both" function cleanup diff --git a/tests/zfs-tests/tests/functional/removal/removal_remap.ksh b/tests/zfs-tests/tests/functional/removal/removal_remap.ksh index 04d0c50e4..5239ef3a5 100755 --- a/tests/zfs-tests/tests/functional/removal/removal_remap.ksh +++ b/tests/zfs-tests/tests/functional/removal/removal_remap.ksh @@ -21,6 +21,9 @@ . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/removal/removal.kshlib +# N.B. The 'zfs remap' command has been disabled and may be removed. +export ZFS_REMAP_ENABLED=YES + default_setup_noexit "$DISKS" diff --git a/tests/zfs-tests/tests/functional/removal/removal_remap_deadlists.ksh b/tests/zfs-tests/tests/functional/removal/removal_remap_deadlists.ksh index 6c630f2f5..a2f6580b4 100755 --- a/tests/zfs-tests/tests/functional/removal/removal_remap_deadlists.ksh +++ b/tests/zfs-tests/tests/functional/removal/removal_remap_deadlists.ksh @@ -21,6 +21,9 @@ . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/removal/removal.kshlib +# N.B. The 'zfs remap' command has been disabled and may be removed. +export ZFS_REMAP_ENABLED=YES + default_setup_noexit "$DISKS" log_onexit default_cleanup_noexit diff --git a/tests/zfs-tests/tests/functional/removal/removal_with_remap.ksh b/tests/zfs-tests/tests/functional/removal/removal_with_remap.ksh index d3a53e40b..6f56740b8 100755 --- a/tests/zfs-tests/tests/functional/removal/removal_with_remap.ksh +++ b/tests/zfs-tests/tests/functional/removal/removal_with_remap.ksh @@ -21,6 +21,9 @@ . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/removal/removal.kshlib +# N.B. The 'zfs remap' command has been disabled and may be removed. +export ZFS_REMAP_ENABLED=YES + default_setup_noexit "$DISKS" log_onexit default_cleanup_noexit |