andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 4 months ago
Clone

Blame 0364-Ticket-47976-deadlock-in-mep-delete-post-op.patch

dc8c34
From e9a63cda57c8825dfe57c9e5dc3feb28ee21a575 Mon Sep 17 00:00:00 2001
dc8c34
From: Thierry Bordaz <tbordaz@redhat.com>
dc8c34
Date: Thu, 5 Nov 2015 11:44:05 +0100
dc8c34
Subject: [PATCH 364/365] Ticket 47976: deadlock in mep delete post op
dc8c34
dc8c34
Bug Description:
dc8c34
	When deleting the original entry, some DB pages are acquired in write.
dc8c34
	The deadlock occurs because when reading the parent entry of the MEP entry
dc8c34
	MEP plugin requires read access to one of the page acquired by the deletion of the original entry.
dc8c34
	The read access can be granted if it is using the parent txn.
dc8c34
	This bug requires that the parent entry of the MEP entry is not found in the entry cache, so
dc8c34
	it requires database access
dc8c34
dc8c34
Fix Description:
dc8c34
	Fix ldbm_delete, so that it reads id2entry db with parent txn
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47976
dc8c34
dc8c34
Reviewed by: Ludwig Krispenz, Rich Megginson (Thanks you !!)
dc8c34
dc8c34
Platforms tested: F17
dc8c34
dc8c34
Flag Day: no
dc8c34
dc8c34
Doc impact: no
dc8c34
dc8c34
(cherry picked from commit 24a38f20ae999cf731702ef1d785f5f0d5cd115f)
dc8c34
---
dc8c34
 ldap/servers/slapd/back-ldbm/ldbm_delete.c | 2 +-
dc8c34
 1 file changed, 1 insertion(+), 1 deletion(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
dc8c34
index 47f884c..f30e2a6 100644
dc8c34
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
dc8c34
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
dc8c34
@@ -370,7 +370,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
dc8c34
 			 * the parent.  If we fail to lock the entry, just try again.
dc8c34
 			 */
dc8c34
 			while(1){
dc8c34
-				parent = id2entry(be, pid ,NULL, &retval);
dc8c34
+				parent = id2entry(be, pid ,&txn, &retval);
dc8c34
 				if (parent && (cache_retry = cache_lock_entry(&inst->inst_cache, parent))) {
dc8c34
 					/* Failed to obtain parent entry's entry lock */
dc8c34
 					if(cache_retry == RETRY_CACHE_LOCK &&
dc8c34
-- 
dc8c34
2.4.3
dc8c34