diff options
author | mav <mav@FreeBSD.org> | 2015-10-03 07:59:25 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-03 07:59:25 +0000 |
commit | d80d916b9a160f1eb050815c6d913c56d6155a75 (patch) | |
tree | a6cd6c7949e00019491e480c5827d2e1e0335b77 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c | |
parent | 8cd1ef567defef55434d33170fc041021cc8d1ea (diff) | |
download | FreeBSD-src-d80d916b9a160f1eb050815c6d913c56d6155a75.zip FreeBSD-src-d80d916b9a160f1eb050815c6d913c56d6155a75.tar.gz |
MFC r286689: 5981 Deadlock in dmu_objset_find_dp
illumos/illumos-gate@1d3f896f5469c69c1339890ec3d68e9feddb0343
https://www.illumos.org/issues/5981
When dmu_objset_find_dp gets called with a read lock held, it fans out
the work to the task queue. Each task in turn acquires its own read
lock before calling the callback. If during this process anyone tries
to a acquire a write lock, it will stall all read lock requests.Thus
the tasks will never finish, the read lock of the caller will never
get freed and the write lock never acquired. deadlock.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Arne Jansen <jansen@webgods.de>
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c index 706acff..2329f08 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c @@ -1143,6 +1143,13 @@ dsl_pool_config_enter(dsl_pool_t *dp, void *tag) } void +dsl_pool_config_enter_prio(dsl_pool_t *dp, void *tag) +{ + ASSERT(!rrw_held(&dp->dp_config_rwlock, RW_READER)); + rrw_enter_read_prio(&dp->dp_config_rwlock, tag); +} + +void dsl_pool_config_exit(dsl_pool_t *dp, void *tag) { rrw_exit(&dp->dp_config_rwlock, tag); |