]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fix an architectural problem introduced in r320156, ZFS ABD import
authorAndriy Gapon <avg@FreeBSD.org>
Wed, 28 Jun 2017 13:59:20 +0000 (13:59 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Wed, 28 Jun 2017 13:59:20 +0000 (13:59 +0000)
commit1db5f1724bdb4ed297b6598c961f1ed3adad3960
tree57b91dc2eaee160f25751ca4eb18851f5d305b44
parentbb751fbbc7abc1af4f506e04b66caf5943742501
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
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c