]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Skip VDEV_IO_DONE stage only for ZIO_TYPE_FREE.
authormav <mav@FreeBSD.org>
Mon, 15 Oct 2018 21:59:24 +0000 (21:59 +0000)
committermav <mav@FreeBSD.org>
Mon, 15 Oct 2018 21:59:24 +0000 (21:59 +0000)
commit714a10a768a70ece04cf860a601089e279e0bc6f
tree15353d51d83d2c493f9b2e0912b92b85f5498891
parentcbbb57703a710565ca8b0fbececd730054ed9931
Skip VDEV_IO_DONE stage only for ZIO_TYPE_FREE.

Device removal code uses zio_vdev_child_io() with ZIO_TYPE_NULL parent,
that never happened before.  It confused FreeBSD-specific TRIM code,
which does not use VDEV_IO_DONE for logical ZIO_TYPE_FREE ZIOs.  As
result of that stage being skipped device removal ZIOs leaked references
and memory that supposed to be freed by VDEV_IO_DONE, making it stuck.

It is a quick patch rather then a nice fix, but hopefully we'll be able
to drop it all together when alternative TRIM implementation finally get
landed.

PR: 228750, 229007
Discussed with: allanjude, avg, smh
Approved by: re (delphij)
MFC after: 5 days
Sponsored by: iXsystems, Inc.
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c