Author: mav
Date: Sun Mar 20 23:49:58 2016
New Revision: 297092
URL: https://svnweb.freebsd.org/changeset/base/297092

Log:
  MFC r294794: MFV r294793:
  6367 spa_config_tryenter incorrectly handles the multiple-lock case
  
  Reviewed by: Alek Pinchuk <alek.pinc...@nexenta.com>
  Reviewed by: Josef 'Jeff' Sipek <josef.si...@nexenta.com>
  Reviewed by: Prashanth Sreenivasa <prash...@gmail.com>
  Reviewed by: Matthew Ahrens <mahr...@delphix.com>
  Reviewed by: Dan McDonald <dan...@omniti.com>
  Reviewed by: Steven Hartland <steven.hartl...@multiplay.co.uk>
  Approved by: Matthew Ahrens <mahr...@delphix.com>
  
  illumos/illumos-gate@e495b6e6735b803e422025a630352ef9bba788c5

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

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 
20 23:48:26 2016        (r297091)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 
20 23:49:58 2016        (r297092)
@@ -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 <m...@freebsd.org>. All rights reserved.
  * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  * Copyright 2013 Saso Kiselkov. All rights reserved.
@@ -459,14 +459,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;
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to