Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Oct 2018 14:53:52 +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-11@freebsd.org
Subject:   svn commit: r339139 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201810031453.w93ErqR1035574@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Oct  3 14:53:51 2018
New Revision: 339139
URL: https://svnweb.freebsd.org/changeset/base/339139

Log:
  MFC r337209:
  MFV r337208: 9591 ms_shift can be incorrectly changed in MOS config for
  indirect vdevs that have been historically expanded
  
  illumos/illumos-gate@11f6a9680e013a7c9c57dc0b64d3e91e2eee1a6b
  
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: George Wilson <gwilson@zfsmail.com>
  Reviewed by: John Kennedy <john.kennedy@delphix.com>
  Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
  Reviewed by: Tim Chase <tim@chase2k.com>
  Approved by: Richard Lowe <richlowe@richlowe.net>
  Author:     Serapheim Dimitropoulos <serapheim@delphix.com>

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

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c	Wed Oct  3 14:53:07 2018	(r339138)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c	Wed Oct  3 14:53:51 2018	(r339139)
@@ -22,7 +22,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2018 by Delphix. All rights reserved.
  * Copyright 2017 Joyent, Inc.
  */
 
@@ -559,6 +559,18 @@ spa_config_update(spa_t *spa, int what)
 		 */
 		for (c = 0; c < rvd->vdev_children; c++) {
 			vdev_t *tvd = rvd->vdev_child[c];
+
+			/*
+			 * Explicitly skip vdevs that are indirect or
+			 * log vdevs that are being removed. The reason
+			 * is that both of those can have vdev_ms_array
+			 * set to 0 and we wouldn't want to change their
+			 * metaslab size nor call vdev_expand() on them.
+			 */
+			if (!vdev_is_concrete(tvd) ||
+			    (tvd->vdev_islog && tvd->vdev_removing))
+				continue;
+
 			if (tvd->vdev_ms_array == 0) {
 				vdev_ashift_optimize(tvd);
 				vdev_metaslab_set_size(tvd);

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Oct  3 14:53:07 2018	(r339138)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Oct  3 14:53:51 2018	(r339139)
@@ -4284,11 +4284,11 @@ vdev_expand(vdev_t *vd, uint64_t txg)
 {
 	ASSERT(vd->vdev_top == vd);
 	ASSERT(spa_config_held(vd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL);
+	ASSERT(vdev_is_concrete(vd));
 
 	vdev_set_deflate_ratio(vd);
 
-	if ((vd->vdev_asize >> vd->vdev_ms_shift) > vd->vdev_ms_count &&
-	    vdev_is_concrete(vd)) {
+	if ((vd->vdev_asize >> vd->vdev_ms_shift) > vd->vdev_ms_count) {
 		VERIFY(vdev_metaslab_init(vd, txg) == 0);
 		vdev_config_dirty(vd);
 	}



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