Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2013 11:24:39 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r252027 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201306201124.r5KBOdJF090115@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Thu Jun 20 11:24:38 2013
New Revision: 252027
URL: http://svnweb.freebsd.org/changeset/base/252027

Log:
  MFC r248573:
  Don't register repair writes in the trim map.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Jun 20 09:55:53 2013	(r252026)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Thu Jun 20 11:24:38 2013	(r252027)
@@ -2553,7 +2553,13 @@ zio_vdev_io_start(zio_t *zio)
 		}
 	}
 
-	if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE) {
+	/*
+	 * Note that we ignore repair writes for TRIM because they can conflict
+	 * with normal writes. This isn't an issue because, by definition, we
+	 * only repair blocks that aren't freed.
+	 */
+	if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE &&
+	    !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) {
 		if (!trim_map_write_start(zio))
 			return (ZIO_PIPELINE_STOP);
 	}
@@ -2575,13 +2581,12 @@ zio_vdev_io_done(zio_t *zio)
 	    zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE);
 
 	if (vd != NULL && vd->vdev_ops->vdev_op_leaf &&
-	    zio->io_type == ZIO_TYPE_WRITE) {
-		trim_map_write_done(zio);
-	}
-
-	if (vd != NULL && vd->vdev_ops->vdev_op_leaf &&
 	    (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) {
 
+		if (zio->io_type == ZIO_TYPE_WRITE &&
+		    !(zio->io_flags & ZIO_FLAG_IO_REPAIR))
+			trim_map_write_done(zio);
+
 		vdev_queue_io_done(zio);
 
 		if (zio->io_type == ZIO_TYPE_WRITE)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306201124.r5KBOdJF090115>