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

Andriy Gapon avg at FreeBSD.org
Wed Jun 21 08:10:47 UTC 2017


Author: avg
Date: Wed Jun 21 08:10:45 2017
New Revision: 320185
URL: https://svnweb.freebsd.org/changeset/base/320185

Log:
  fix several fallouts from r320156, ZFS ABD import
  
  All of the problems were related to the FreeBSD-only features.
  One was caused by a mismerge in the zfsbootcfg support code.
  All others were in the TRIM support code.
  
  Reported by:	ken,
  		O. Hartmann <ohartmann at walstatt.org>,
  		Trond Endrestøl <Trond.Endrestol at fagskolen.gjovik.no>
  MFC after:	1 week
  X-MFC with:	r320156

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c	Wed Jun 21 06:44:56 2017	(r320184)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c	Wed Jun 21 08:10:45 2017	(r320185)
@@ -279,7 +279,8 @@ vdev_raidz_map_free(raidz_map_t *rm)
 
 	size = 0;
 	for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) {
-		abd_put(rm->rm_col[c].rc_abd);
+		if (rm->rm_col[c].rc_abd != NULL)
+			abd_put(rm->rm_col[c].rc_abd);
 		size += rm->rm_col[c].rc_size;
 	}
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Wed Jun 21 06:44:56 2017	(r320184)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Wed Jun 21 08:10:45 2017	(r320185)
@@ -347,7 +347,12 @@ zio_push_transform(zio_t *zio, abd_t *data, uint64_t s
 	 * Ensure that anyone expecting this zio to contain a linear ABD isn't
 	 * going to get a nasty surprise when they try to access the data.
 	 */
+#ifdef illumos
 	IMPLY(abd_is_linear(zio->io_abd), abd_is_linear(data));
+#else
+	IMPLY(zio->io_abd != NULL && abd_is_linear(zio->io_abd),
+	    abd_is_linear(data));
+#endif
 
 	zt->zt_orig_abd = zio->io_abd;
 	zt->zt_orig_size = zio->io_size;
@@ -3132,7 +3137,7 @@ zio_vdev_io_start(zio_t *zio)
 	    P2PHASE(zio->io_size, align) != 0) {
 		/* Transform logical writes to be a full physical block size. */
 		uint64_t asize = P2ROUNDUP(zio->io_size, align);
-		abd_t *abuf;
+		abd_t *abuf = NULL;
 		if (zio->io_type == ZIO_TYPE_READ ||
 		    zio->io_type == ZIO_TYPE_WRITE)
 			abuf = abd_alloc_sametype(zio->io_abd, asize);


More information about the svn-src-head mailing list