Skip to contentSkip to conversation

master - lvmlockd: avoid double unlock of client_mutex

PATCH Zdenek Kabelac 1 participant 1 message Aug 25, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=288e10cf8b990cd740fba409d6f20525209f4f43
Commit:        288e10cf8b990cd740fba409d6f20525209f4f43
Parent:        b3b1e788e16c77f6784f30b8e984f68792f8fa1a
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Aug 25 14:07:45 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Aug 25 14:20:59 2017 +0200

lvmlockd: avoid double unlock of client_mutex

Avoid double unlocking of client_mutex and and unlock client_mutex in 'else' branch since it's already unlocked in 'if (cl->dead)' branch.

---
 WHATS_NEW                        |    1 +
 daemons/lvmlockd/lvmlockd-core.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
index ac69c16..32bbc41 100644
@@ -1,5 +1,6 @@
 Version 2.02.174 - 
 =================================
+  Avoid double unlocking of client & lockspace mutexes in lvmlockd.
   Fix leaking of file descriptor for non-blocking filebased locking.
   Fix check for 2nd mda at end of disk fits if using pvcreate --restorefile.
   Use maximum metadataarea size that fits with pvcreate --restorefile.
daemons/lvmlockd/lvmlockd-core.c +2 -2
index 36d84e2..253d86b 100644
@@ -4761,8 +4761,8 @@ static void *client_thread_main(void *arg_in)
 			} else {
 				pthread_mutex_unlock(&cl->mutex);
 			}
-		}
-		pthread_mutex_unlock(&client_mutex);
+		} else
+			pthread_mutex_unlock(&client_mutex);
 	}
 out:
 	return NULL;