From owner-svn-src-all@FreeBSD.ORG Thu Jun 20 11:24:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 80E7DBD1; Thu, 20 Jun 2013 11:24:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70B7B1DF1; Thu, 20 Jun 2013 11:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5KBOdl8090116; Thu, 20 Jun 2013 11:24:39 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5KBOdJF090115; Thu, 20 Jun 2013 11:24:39 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306201124.r5KBOdJF090115@svn.freebsd.org> From: Steven Hartland Date: Thu, 20 Jun 2013 11:24:39 +0000 (UTC) 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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 11:24:39 -0000 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)