From owner-svn-src-head@freebsd.org Tue Jan 26 12:28:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B0AA46D7E; Tue, 26 Jan 2016 12:28:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE181E5D; Tue, 26 Jan 2016 12:28:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QCSrbv009142; Tue, 26 Jan 2016 12:28:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QCSrbq009141; Tue, 26 Jan 2016 12:28:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201601261228.u0QCSrbq009141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Jan 2016 12:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294794 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 12:28:54 -0000 Author: mav Date: Tue Jan 26 12:28:53 2016 New Revision: 294794 URL: https://svnweb.freebsd.org/changeset/base/294794 Log: MFV r294793: 6367 spa_config_tryenter incorrectly handles the multiple-lock case Reviewed by: Alek Pinchuk Reviewed by: Josef 'Jeff' Sipek Reviewed by: Prashanth Sreenivasa Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Reviewed by: Steven Hartland Approved by: Matthew Ahrens illumos/illumos-gate@e495b6e6735b803e422025a630352ef9bba788c5 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Jan 26 12:26:32 2016 (r294793) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Jan 26 12:28:53 2016 (r294794) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -449,14 +449,16 @@ spa_config_tryenter(spa_t *spa, int lock if (rw == RW_READER) { if (scl->scl_writer || scl->scl_write_wanted) { mutex_exit(&scl->scl_lock); - spa_config_exit(spa, locks ^ (1 << i), tag); + spa_config_exit(spa, locks & ((1 << i) - 1), + tag); return (0); } } else { ASSERT(scl->scl_writer != curthread); if (!refcount_is_zero(&scl->scl_count)) { mutex_exit(&scl->scl_lock); - spa_config_exit(spa, locks ^ (1 << i), tag); + spa_config_exit(spa, locks & ((1 << i) - 1), + tag); return (0); } scl->scl_writer = curthread;