Author: mav
Date: Tue Jan 26 12:26:32 2016
New Revision: 294793
URL: https://svnweb.freebsd.org/changeset/base/294793

Log:
  6367 spa_config_tryenter incorrectly handles the multiple-lock case
  
  Reviewed by: Alek Pinchuk <[email protected]>
  Reviewed by: Josef 'Jeff' Sipek <[email protected]>
  Reviewed by: Prashanth Sreenivasa <[email protected]>
  Reviewed by: Matthew Ahrens <[email protected]>
  Reviewed by: Dan McDonald <[email protected]>
  Reviewed by: Steven Hartland <[email protected]>
  Approved by: Matthew Ahrens <[email protected]>
  
  illumos/illumos-gate@e495b6e6735b803e422025a630352ef9bba788c5

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c        Tue Jan 26 
11:28:55 2016        (r294792)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c        Tue Jan 26 
12:26:32 2016        (r294793)
@@ -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 (c) 2014 Spectra Logic Corporation, All rights reserved.
  * Copyright 2013 Saso Kiselkov. All rights reserved.
  */
@@ -386,14 +386,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;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to