Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 2019 08:47:10 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r354379 - vendor-sys/illumos/dist/uts/common/fs/zfs
Message-ID:  <201911060847.xA68lA5v040957@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Nov  6 08:47:09 2019
New Revision: 354379
URL: https://svnweb.freebsd.org/changeset/base/354379

Log:
  10701 Correct lock ASSERTs in vdev_label_read/write
  
  illumos/illumos-gate@58447f688d5e308373ab16a3b129bc0ba0fbc154
  https://github.com/illumos/illumos-gate/commit/58447f688d5e308373ab16a3b129bc0ba0fbc154
  
  https://www.illumos.org/issues/10701
    Port of ZoL commit:
    0091d66f4e Correct lock ASSERTs in vdev_label_read/write
    At a minimum, this fixes a blown assert during an MMP test run when running on
    a DEBUG build.
  
  Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
  Author: Olaf Faaland <faaland1@llnl.gov>

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c	Wed Nov  6 08:46:24 2019	(r354378)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c	Wed Nov  6 08:47:09 2019	(r354379)
@@ -184,8 +184,9 @@ static void
 vdev_label_read(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset,
     uint64_t size, zio_done_func_t *done, void *private, int flags)
 {
-	ASSERT(spa_config_held(zio->io_spa, SCL_STATE_ALL, RW_WRITER) ==
-	    SCL_STATE_ALL);
+	ASSERT(
+	    spa_config_held(zio->io_spa, SCL_STATE, RW_READER) == SCL_STATE ||
+	    spa_config_held(zio->io_spa, SCL_STATE, RW_WRITER) == SCL_STATE);
 	ASSERT(flags & ZIO_FLAG_CONFIG_WRITER);
 
 	zio_nowait(zio_read_phys(zio, vd,
@@ -198,17 +199,9 @@ void
 vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset,
     uint64_t size, zio_done_func_t *done, void *private, int flags)
 {
-#ifdef _KERNEL
-	/*
-	 * This assert is invalid in the user-level ztest MMP code because
-	 * the ztest thread is not in dsl_pool_sync_context. ZoL does not
-	 * build the user-level code with DEBUG so this is not an issue there.
-	 */
-	ASSERT(spa_config_held(zio->io_spa, SCL_ALL, RW_WRITER) == SCL_ALL ||
-	    (spa_config_held(zio->io_spa, SCL_CONFIG | SCL_STATE, RW_READER) ==
-	    (SCL_CONFIG | SCL_STATE) &&
-	    dsl_pool_sync_context(spa_get_dsl(zio->io_spa))));
-#endif
+	ASSERT(
+	    spa_config_held(zio->io_spa, SCL_STATE, RW_READER) == SCL_STATE ||
+	    spa_config_held(zio->io_spa, SCL_STATE, RW_WRITER) == SCL_STATE);
 	ASSERT(flags & ZIO_FLAG_CONFIG_WRITER);
 
 	zio_nowait(zio_write_phys(zio, vd,



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