This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL47 - dlm-kernel: Don't free lock_info struct if aconversion fails


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=48a8896a0e35d0fbc7e275216ae809c8854f5b01
Commit:        48a8896a0e35d0fbc7e275216ae809c8854f5b01
Parent:        df27ce8d386c4c852feca8b9e25a1279ca8b1f50
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Tue Nov 4 10:53:26 2008 +0000
Committer:     Chris Feist <cfeist@redhat.com>
CommitterDate: Tue Jan 6 15:51:25 2009 -0600

dlm-kernel: Don't free lock_info struct if a conversion fails

What can happen is that a lock conversion is attempted while the lock is still
in the process of being granted. This causes the dlm_unlock request to fail and
the lock_request frees the lock_info structure because it thinks the call that
failed was a new lock rather than a conversion.

The fix is a straightforward flag check.

bz#466498

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 dlm-kernel/src/device.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlm-kernel/src/device.c b/dlm-kernel/src/device.c
index 18e43db..d7afeaf 100644
--- a/dlm-kernel/src/device.c
+++ b/dlm-kernel/src/device.c
@@ -2,7 +2,7 @@
 *******************************************************************************
 **
 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-**  Copyright (C) 2004 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
@@ -1023,8 +1023,8 @@ static int do_user_lock(struct file_info *fi, uint8_t cmd, struct dlm_lock_param
 	return li->li_lksb.sb_lkid;
 
  out_err:
-	if (test_bit(LI_FLAG_FIRSTLOCK, &li->li_flags)) {
-
+	if (!(kparams->flags & DLM_LKF_CONVERT) &&
+	    test_bit(LI_FLAG_FIRSTLOCK, &li->li_flags)) {
 		release_lockinfo(li);
 	}
 	return status;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]