freebsd-dev/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys
Andriy Gapon 1db5f1724b fix an architectural problem introduced in r320156, ZFS ABD import
The implementation of ZFS refcount_t uses the emulated illumos mutex
(the sx lock) and the waiting memory allocation when ZFS_DEBUG is
enabled.  This makes refcount_t unsuitable for use in GEOM g_up
thread where sleeping is prohibited.

When importing the ABD change I modified vdev_geom using illumos
vdev_disk as an example.  As a result, I added a call to abd_return_buf
in vdev_geom_io_intr.  The latter is called on g_up thread while the
former uses refcount_t.

This change fixes the problem by deferring the abd_return_buf call to
the previously unused vdev_geom_io_done that is called on a ZFS zio
taskqueue thread where sleeping is allowed.

A side bonus of this change is that now a vdev zio has a pointer
to its corresponding bio while the zio is active.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
Tested by:	Shawn Webb <shawn.webb@hardenedbsd.org>
MFC after:	1 week
X-MFC with:	r320156
2017-06-28 13:59:20 +00:00
..
abd.h MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
arc.h MFV r316916: 7970 zfs_arc_num_sublists_per_state should be common to all multilists 2017-05-24 22:15:16 +00:00
blkptr.h
bplist.h
bpobj.h
bptree.h
bqueue.h
dbuf.h MFV r302991: 6950 ARC should cache compressed data 2016-09-03 08:30:51 +00:00
ddt.h MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
dmu_impl.h MFC r316912: 7793 ztest fails assertion in dmu_tx_willuse_space 2017-05-24 21:43:34 +00:00
dmu_objset.h MFV r316917: 7968 multi-threaded spa_sync() 2017-05-24 22:21:24 +00:00
dmu_send.h MFV 316894 2017-04-25 17:57:43 +00:00
dmu_traverse.h
dmu_tx.h MFC r316914: 7801 add more by-dnode routines 2017-05-24 21:49:21 +00:00
dmu_zfetch.h MFV r297831: 6322 ZFS indirect block predictive prefetch 2016-04-11 21:09:15 +00:00
dmu.h MFV r319738: 8155 simplify dmu_write_policy handling of pre-compressed buffers 2017-06-09 15:26:03 +00:00
dnode.h MFV r316917: 7968 multi-threaded spa_sync() 2017-05-24 22:21:24 +00:00
dsl_bookmark.h
dsl_dataset.h MFC r316912: 7793 ztest fails assertion in dmu_tx_willuse_space 2017-05-24 21:43:34 +00:00
dsl_deadlist.h
dsl_deleg.h
dsl_destroy.h
dsl_dir.h MFC r316912: 7793 ztest fails assertion in dmu_tx_willuse_space 2017-05-24 21:43:34 +00:00
dsl_pool.h MFV r316917: 7968 multi-threaded spa_sync() 2017-05-24 22:21:24 +00:00
dsl_prop.h
dsl_scan.h
dsl_synctask.h
dsl_userhold.h
metaslab_impl.h MFV 316898 2017-04-27 22:00:03 +00:00
metaslab.h MFV r315290, r315291: 7303 dynamic metaslab selection 2017-03-24 09:37:00 +00:00
multilist.h MFV r316917: 7968 multi-threaded spa_sync() 2017-05-24 22:21:24 +00:00
range_tree.h
refcount.h MFV 316894 2017-04-25 17:57:43 +00:00
rrwlock.h
sa_impl.h
sa.h
spa_boot.h
spa_impl.h MFV 316900 2017-04-27 23:31:38 +00:00
spa.h MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
space_map.h
space_reftree.h
trim_map.h
txg_impl.h
txg.h MFV r318931: 8063 verify that we do not attempt to access inactive txg 2017-05-26 11:37:11 +00:00
uberblock_impl.h
uberblock.h
unique.h
vdev_disk.h
vdev_file.h zfs: port vdev_file part of illumos change 3306 2017-06-26 09:10:09 +00:00
vdev_impl.h MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
vdev_raidz.h
vdev.h zfsbootcfg: a simple tool to set next boot (one time) options for zfsboot 2016-10-29 14:09:32 +00:00
zap_impl.h MFC r316912: 7793 ztest fails assertion in dmu_tx_willuse_space 2017-05-24 21:43:34 +00:00
zap_leaf.h
zap.h MFC r316914: 7801 add more by-dnode routines 2017-05-24 21:49:21 +00:00
zfeature.h
zfs_acl.h
zfs_context.h MFV r296505: 6531 Provide mechanism to artificially limit disk performance 2016-03-08 17:27:13 +00:00
zfs_ctldir.h reimplement zfsctl (.zfs) support 2017-02-21 17:47:08 +00:00
zfs_debug.h MFV r315290, r315291: 7303 dynamic metaslab selection 2017-03-24 09:37:00 +00:00
zfs_dir.h zfs: honour and make use of vfs vnode locking protocol 2016-08-05 06:23:06 +00:00
zfs_fuid.h
zfs_ioctl.h MFV r318944: 8265 Reserve send stream flag for large dnode feature 2017-05-26 12:08:38 +00:00
zfs_onexit.h
zfs_rlock.h
zfs_sa.h
zfs_stat.h
zfs_vfsops.h reimplement zfsctl (.zfs) support 2017-02-21 17:47:08 +00:00
zfs_znode.h implement zfs_vptocnp() using z_parent property 2016-10-07 06:29:24 +00:00
zil_impl.h MFV r318947: 7578 Fix/improve some aspects of ZIL writing. 2017-06-22 16:52:22 +00:00
zil.h MFV r318931: 8063 verify that we do not attempt to access inactive txg 2017-05-26 11:37:11 +00:00
zio_checksum.h MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
zio_compress.h MFV r318946: 8021 ARC buf data scatter-ization 2017-06-20 17:39:24 +00:00
zio_impl.h MFV r304155: 7090 zfs should improve allocation order and throttle allocations 2016-09-03 10:04:37 +00:00
zio_priority.h
zio.h fix an architectural problem introduced in r320156, ZFS ABD import 2017-06-28 13:59:20 +00:00
zrlock.h
zvol.h