From owner-svn-src-all@FreeBSD.ORG Thu Jun 27 14:32:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 91C0AD41; Thu, 27 Jun 2013 14:32:52 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 828D01918; Thu, 27 Jun 2013 14:32:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5REWqRW067845; Thu, 27 Jun 2013 14:32:52 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5REWphP067841; Thu, 27 Jun 2013 14:32:51 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201306271432.r5REWphP067841@svn.freebsd.org> From: Steven Hartland Date: Thu, 27 Jun 2013 14:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252306 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2013 14:32:52 -0000 Author: smh Date: Thu Jun 27 14:32:51 2013 New Revision: 252306 URL: http://svnweb.freebsd.org/changeset/base/252306 Log: MFC r252056: Fix destroyed ZFS pools failing to import MFC r252059: Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call syntax. MFC r252060: Fix intermittent ZFS lock panic MFC r252061: Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/sys/cddl/compat/opensolaris/sys/mutex.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Jun 27 13:03:19 2013 (r252305) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Jun 27 14:32:51 2013 (r252306) @@ -5332,10 +5332,9 @@ main(int argc, char **argv) * 'freeze' is a vile debugging abomination, so we treat * it as such. */ - char buf[16384]; - int fd = open(ZFS_DEV, O_RDWR); - (void) strcpy((void *)buf, argv[2]); - return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf)); + zfs_cmd_t zc = { 0 }; + (void) strlcpy(zc.zc_name, argv[2], sizeof (zc.zc_name)); + return (!!zfs_ioctl(g_zfs, ZFS_IOC_POOL_FREEZE, &zc)); } else { (void) fprintf(stderr, gettext("unrecognized " "command '%s'\n"), cmdname); Modified: stable/8/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/mutex.h Thu Jun 27 13:03:19 2013 (r252305) +++ stable/8/sys/cddl/compat/opensolaris/sys/mutex.h Thu Jun 27 14:32:51 2013 (r252306) @@ -71,8 +71,7 @@ typedef struct sx kmutex_t; #define mutex_tryenter(lock) sx_try_xlock(lock) #define mutex_exit(lock) sx_xunlock(lock) #define mutex_owned(lock) sx_xlocked(lock) -/* TODO: Change to sx_xholder() once it is moved from kern_sx.c to sx.h. */ -#define mutex_owner(lock) ((lock)->sx_lock & SX_LOCK_SHARED ? NULL : (struct thread *)SX_OWNER((lock)->sx_lock)) +#define mutex_owner(lock) sx_xholder(lock) #endif /* _KERNEL */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Jun 27 13:03:19 2013 (r252305) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Jun 27 14:32:51 2013 (r252306) @@ -1834,6 +1834,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg) vdev_config_dirty(vd->vdev_top); } + bzero(&smlock, sizeof (smlock)); mutex_init(&smlock, NULL, MUTEX_DEFAULT, NULL); space_map_create(&smsync, sm->sm_start, sm->sm_size, sm->sm_shift, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jun 27 13:03:19 2013 (r252305) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jun 27 14:32:51 2013 (r252306) @@ -270,8 +270,7 @@ vdev_geom_read_config(struct g_consumer continue; if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, - &state) != 0 || state == POOL_STATE_DESTROYED || - state > POOL_STATE_L2CACHE) { + &state) != 0 || state > POOL_STATE_L2CACHE) { nvlist_free(*config); *config = NULL; continue;