Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Feb 2010 22:31:43 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r204073 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201002182231.o1IMVhKW097786@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Thu Feb 18 22:31:43 2010
New Revision: 204073
URL: http://svn.freebsd.org/changeset/base/204073

Log:
  Add tunable and sysctl to skip hostid check on pool import.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Thu Feb 18 22:30:37 2010	(r204072)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Thu Feb 18 22:31:43 2010	(r204073)
@@ -62,6 +62,14 @@
 #include "zfs_prop.h"
 #include "zfs_comutil.h"
 
+/* Check hostid on import? */
+static int check_hostid = 1;
+
+SYSCTL_DECL(_vfs_zfs);
+TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0,
+    "Check hostid on import?");
+
 int zio_taskq_threads[ZIO_TYPES][ZIO_TASKQ_TYPES] = {
 	/*	ISSUE	INTR					*/
 	{	1,	1	},	/* ZIO_TYPE_NULL	*/
@@ -1168,7 +1176,7 @@ spa_load(spa_t *spa, nvlist_t *config, s
 			    ZPOOL_CONFIG_HOSTNAME, &hostname) == 0);
 
 			(void) ddi_strtoul(hw_serial, NULL, 10, &myhostid);
-			if (hostid != 0 && myhostid != 0 &&
+			if (check_hostid && hostid != 0 && myhostid != 0 &&
 			    (unsigned long)hostid != myhostid) {
 				cmn_err(CE_WARN, "pool '%s' could not be "
 				    "loaded as it was last accessed by "



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