Date: Thu, 16 Mar 2017 07:09:48 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r315385 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201703160709.v2G79mvJ095232@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Mar 16 07:09:47 2017 New Revision: 315385 URL: https://svnweb.freebsd.org/changeset/base/315385 Log: MFC r314548: Completely skip cache flushing for not supporting log devices. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Mar 16 07:09:19 2017 (r315384) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Mar 16 07:09:47 2017 (r315385) @@ -830,7 +830,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); @@ -843,12 +843,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)); } @@ -856,7 +857,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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703160709.v2G79mvJ095232>