Blame SOURCES/libfuse-fix-crash-in-unlock_path.patch

a4924e
From 3a2bd4da6b0b713276528d0c818f9e7be515e8ec Mon Sep 17 00:00:00 2001
a4924e
From: "Ratna_Bolla@dell.com" <Ratna_Bolla@dell.com>
a4924e
Date: Mon, 4 Feb 2013 18:30:14 +0100
a4924e
Subject: [PATCH] libfuse: fix crash in unlock_path()
a4924e
a4924e
Patch by Ratna Manoj.
a4924e
a4924e
queue_element_unlock() should set ->first_locked and ->second_locked to false.
a4924e
a4924e
Discovered with 'fs_racer'.  The assert(wnode->treelock == TREELOCK_WRITE) in
a4924e
unlock_path() was hit within minutes.
a4924e
a4924e
Miklos: simplified patch
a4924e
---
a4924e
 ChangeLog  | 4 ++++
a4924e
 lib/fuse.c | 2 ++
a4924e
 2 files changed, 6 insertions(+)
a4924e
a4924e
diff --git a/ChangeLog b/ChangeLog
a4924e
index dbd10e85ebf8..076bcaf54490 100644
a4924e
--- a/ChangeLog
a4924e
+++ b/ChangeLog
a4924e
@@ -1,3 +1,7 @@
a4924e
+2013-02-04  Miklos Szeredi <miklos@szeredi.hu>
a4924e
+
a4924e
+	* libfuse: fix crash in unlock_path().  Patch by Ratna Manoj
a4924e
+
a4924e
 2012-10-01  Miklos Szeredi <miklos@szeredi.hu>
a4924e
 
a4924e
 	* Released 2.9.2
a4924e
diff --git a/lib/fuse.c b/lib/fuse.c
a4924e
index 599a587fbe60..1917346c759d 100644
a4924e
--- a/lib/fuse.c
a4924e
+++ b/lib/fuse.c
a4924e
@@ -1021,10 +1021,12 @@ static void queue_element_unlock(struct fuse *f, struct lock_queue_element *qe)
a4924e
 	if (qe->first_locked) {
a4924e
 		wnode = qe->wnode1 ? *qe->wnode1 : NULL;
a4924e
 		unlock_path(f, qe->nodeid1, wnode, NULL);
a4924e
+		qe->first_locked = false;
a4924e
 	}
a4924e
 	if (qe->second_locked) {
a4924e
 		wnode = qe->wnode2 ? *qe->wnode2 : NULL;
a4924e
 		unlock_path(f, qe->nodeid2, wnode, NULL);
a4924e
+		qe->second_locked = false;
a4924e
 	}
a4924e
 }
a4924e
 
a4924e
-- 
a4924e
2.14.3
a4924e