freebsd-dev/module
Tom Caputi c40a1124e1 Fix consistency of ztest_device_removal_active
ztest currently uses the boolean flag ztest_device_removal_active
to protect some tests that may not run successfully if they occur
at the same time as ztest_device_removal(). Unfortunately, in the
event that ztest is in the middle of a device removal when it
decides to issue a SIGKILL, the device removal will be
automatically restarted (without setting the flag) when the pool
is re-imported on the next run. This patch corrects this by
ensuring that any in-progress removals are completed before running
further tests after the re-import.

This patch also makes a few small changes to prevent race conditions
involving the creation and destruction of spa->spa_vdev_removal,
since this field is not protected by any locks. Some checks that
may run concurrently with setting / unsetting this field have been
updated to check spa->spa_removing_phys.sr_state instead. The most
significant change here is that spa_removal_get_stats() no longer
accounts for in-flight work done, since that could result in a NULL
pointer dereference.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8105
2018-11-28 20:47:09 -08:00
..
avl Update build system and packaging 2018-05-29 16:00:33 -07:00
icp Fedora 28: Fix misc bounds check compiler warnings 2018-08-26 12:55:44 -07:00
lua Update build system and packaging 2018-05-29 16:00:33 -07:00
nvpair Add new fnvlist_lookup_* functions 2018-10-03 15:30:55 -07:00
spl Create /proc/sys/kernel/spl/gitrev with git hash 2018-10-08 21:57:02 -07:00
unicode Update build system and packaging 2018-05-29 16:00:33 -07:00
zcommon Defer new resilvers until the current one ends 2018-10-18 21:06:18 -07:00
zfs Fix consistency of ztest_device_removal_active 2018-11-28 20:47:09 -08:00
.gitignore Prepare SPL repo to merge with ZFS repo 2018-05-29 14:51:39 -07:00
Makefile.in Update build system and packaging 2018-05-29 16:00:33 -07:00