Date: Fri, 19 Oct 2018 04:37:28 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339441 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201810190437.w9J4bSvu055759@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Oct 19 04:37:27 2018 New Revision: 339441 URL: https://svnweb.freebsd.org/changeset/base/339441 Log: MFC r339372: 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 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Oct 19 04:30:25 2018 (r339440) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Oct 19 04:37:27 2018 (r339441) @@ -1180,7 +1180,8 @@ zio_vdev_child_io(zio_t *pio, blkptr_t *bp, vdev_t *vd } /* Not all IO types require vdev io done stage e.g. free */ - if (!(pio->io_pipeline & ZIO_STAGE_VDEV_IO_DONE)) + if (type == ZIO_TYPE_FREE && + !(pio->io_pipeline & ZIO_STAGE_VDEV_IO_DONE)) pipeline &= ~ZIO_STAGE_VDEV_IO_DONE; if (vd->vdev_ops->vdev_op_leaf) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810190437.w9J4bSvu055759>