svn commit: r321111 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Tue Jul 18 07:41:40 UTC 2017


Author: avg
Date: Tue Jul 18 07:41:38 2017
New Revision: 321111
URL: https://svnweb.freebsd.org/changeset/base/321111

Log:
  fix a regression in r320452, ZFS ABD import
  
  I overlooked the fact that vdev_op_io_done hook is called even if the
  actual I/O is skipped, for example, in the case of a missing vdev.
  Arguably, this could be considered an issue in the zio pipeline engine,
  but for now I am adding defensive code to check for io_bp being NULL
  along with assertions that that happens only when it can be really
  expected.
  
  PR:		220691
  Reported by:	peter, cy
  Tested by:	cy
  MFC after:	1 week
  X-MFC with:	r320156, r320452

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Tue Jul 18 06:57:50 2017	(r321110)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Tue Jul 18 07:41:38 2017	(r321111)
@@ -1090,6 +1090,14 @@ vdev_geom_io_done(zio_t *zio)
 {
 	struct bio *bp = zio->io_bio;
 
+	if (bp == NULL) {
+		ASSERT3S(zio->io_error, !=, 0);
+		IMPLY(zio->io_type == ZIO_TYPE_READ ||
+		    zio->io_type == ZIO_TYPE_WRITE,
+		    zio->io_error == ENXIO);
+		return;
+	}
+
 	if (zio->io_type == ZIO_TYPE_READ) {
 		abd_return_buf_copy(zio->io_abd, bp->bio_data, zio->io_size);
 	} else if (zio->io_type == ZIO_TYPE_WRITE) {


More information about the svn-src-all mailing list