diff options
author | mav <mav@FreeBSD.org> | 2018-04-16 03:47:53 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2018-04-16 03:47:53 +0000 |
commit | 32253781878f276b91c064399ca60806a1a885c7 (patch) | |
tree | 00b872b905331451b28c7b2e357328747cd799cb /sys/conf/files | |
parent | 363b397f90d8e82efd94b7643a25b005f159bef8 (diff) | |
download | FreeBSD-src-32253781878f276b91c064399ca60806a1a885c7.zip FreeBSD-src-32253781878f276b91c064399ca60806a1a885c7.tar.gz |
MFC r329802: MFV r329799, r329800:
9079 race condition in starting and ending condesing thread for indirect vdevs
illumos/illumos-gate@667ec66f1b4f491d5e839644e0912cad1c9e7122
The timeline of the race condition is the following:
[1] Thread A is about to finish condesing the first vdev in spa_condense_indirect_thread(),
so it calls the spa_condense_indirect_complete_sync() sync task which sets the
spa_condensing_indirect field to NULL. Waiting for the sync task to finish, thread A
sleeps until the txg is done. When this happens, thread A will acquire spa_async_lock
and set spa_condense_thread to NULL.
[2] While thread A waits for the txg to finish, thread B which is running spa_sync() checks
whether it should condense the second vdev in vdev_indirect_should_condense() by checking
the spa_condensing_indirect field which was set to NULL by spa_condense_indirect_thread()
from thread A. So it goes on and tries to spawn a new condensing thread in
spa_condense_indirect_start_sync() and the aforementioned assertions fails because thread A
has not set spa_condense_thread to NULL (which is basically the last thing it does before
returning).
The main issue here is that we rely on both spa_condensing_indirect and spa_condense_thread to
signify whether a condensing thread is running. Ideally we would only use one throughout the
codebase. In addition, for managing spa_condense_thread we currently use spa_async_lock which
basically tights condensing to scrubing when it comes to pausing and resuming those actions
during spa export.
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
Diffstat (limited to 'sys/conf/files')
-rw-r--r-- | sys/conf/files | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/conf/files b/sys/conf/files index 6a0d23c..45e9543 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -259,6 +259,7 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c optional zfs compile- cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/zthr.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/os/callb.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/os/fm.c optional zfs compile-with "${ZFS_C}" |