From owner-svn-src-head@freebsd.org Thu Mar 2 07:50:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9EC8CF589F; Thu, 2 Mar 2017 07:50:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6C626BE; Thu, 2 Mar 2017 07:50:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v227o6Ps064981; Thu, 2 Mar 2017 07:50:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v227o6qr064980; Thu, 2 Mar 2017 07:50:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703020750.v227o6qr064980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 2 Mar 2017 07:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314548 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 07:50:08 -0000 Author: mav Date: Thu Mar 2 07:50:06 2017 New Revision: 314548 URL: https://svnweb.freebsd.org/changeset/base/314548 Log: Completely skip cache flushing for not supporting log devices. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Mar 2 07:25:50 2017 (r314547) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Mar 2 07:50:06 2017 (r314548) @@ -838,7 +838,7 @@ zil_flush_vdevs(zilog_t *zilog) avl_tree_t *t = &zilog->zl_vdev_tree; void *cookie = NULL; zil_vdev_node_t *zv; - zio_t *zio; + zio_t *zio = NULL; ASSERT(zilog->zl_writer); @@ -851,12 +851,13 @@ zil_flush_vdevs(zilog_t *zilog) spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); - zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL); - while ((zv = avl_destroy_nodes(t, &cookie)) != NULL) { vdev_t *vd = vdev_lookup_top(spa, zv->zv_vdev); - if (vd != NULL) + if (vd != NULL && !vd->vdev_nowritecache) { + if (zio == NULL) + zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL); zio_flush(zio, vd); + } kmem_free(zv, sizeof (*zv)); } @@ -864,7 +865,8 @@ zil_flush_vdevs(zilog_t *zilog) * Wait for all the flushes to complete. Not all devices actually * support the DKIOCFLUSHWRITECACHE ioctl, so it's OK if it fails. */ - (void) zio_wait(zio); + if (zio) + (void) zio_wait(zio); spa_config_exit(spa, SCL_STATE, FTAG); }