Author: mm
Date: Tue Dec 14 15:36:47 2010
New Revision: 216436
URL: http://svn.freebsd.org/changeset/base/216436

Log:
  MFC r208683, r210999, r212385:
  
  MFC r208683 (pjd):
  Fix a bug where resilver is not started automatically on pool import or load.
  If disk was missing on pool load or import and on next pool load or import
  it was present, resilver wasn't started automatically and ZFS reported all
  disks as ONLINE and healthy. Then, when another disk died, pool became
  unaccessible, because if it was 2-way mirror or RAIDZ1 two vdevs were
  out of sync.
  
  To fix the problem, start resilver automatically on pool load or import.
  
  Obtained from:        OpenSolaris
  
  MFC r210999 (pjd):
  In FreeBSD we use 'jailed' property.
  
  MFC r212385 (pjd):
  On FreeBSD we can log from pool that have multiple top-level vdevs or log
  vdevs, so don't deny adding new vdevs if bootfs property is set.
  
  Approved by:  re (kib), pjd, delphij (mentor)

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c       Tue Dec 
14 15:35:44 2010        (r216435)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c       Tue Dec 
14 15:36:47 2010        (r216436)
@@ -1595,6 +1595,12 @@ spa_load(spa_t *spa, nvlist_t *config, s
                 */
                if (need_update)
                        spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE);
+
+               /*
+                * Check all DTLs to see if anything needs resilvering.
+                */
+               if (vdev_resilver_needed(rvd, NULL, NULL))
+                       spa_async_request(spa, SPA_ASYNC_RESILVER);
        }
 
        error = 0;

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Dec 
14 15:35:44 2010        (r216435)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Dec 
14 15:36:47 2010        (r216436)
@@ -357,7 +357,7 @@ zfs_secpolicy_setprop(const char *name, 
                         * quota on things *under* (ie. contained by)
                         * the thing they own.
                         */
-                       if (dsl_prop_get_integer(name, "zoned", &zoned,
+                       if (dsl_prop_get_integer(name, "jailed", &zoned,
                            setpoint))
                                return (EPERM);
                        if (!zoned || strlen(name) <= strlen(setpoint))
@@ -1217,8 +1217,12 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
 {
        spa_t *spa;
        int error;
+#ifdef sun
        nvlist_t *config, **l2cache, **spares;
        uint_t nl2cache = 0, nspares = 0;
+#else
+       nvlist_t *config;
+#endif
 
        error = spa_open(zc->zc_name, &spa, FTAG);
        if (error != 0)
@@ -1226,6 +1230,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
 
        error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size,
            &config);
+#ifdef sun
        (void) nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_L2CACHE,
            &l2cache, &nl2cache);
 
@@ -1246,6 +1251,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
                spa_close(spa, FTAG);
                return (EDOM);
        }
+#endif
 
        if (error == 0) {
                error = spa_vdev_add(spa, config);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to