Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1681

kernel-2.6.18-238.el5.src.rpm

From: David Teigland <teigland@redhat.com>
Subject: [RHEL5.1 PATCH] dlm: fix NULL reference in send_ls_not_ready
Date: Fri, 13 Jul 2007 16:43:28 -0500
Bugzilla: 248187
Message-Id: <20070713214328.GA32409@redhat.com>
Changelog: [DLM] fix NULL reference in send_ls_not_ready


bz 248187

Fix regression from "[RHEL5.1 PATCH] dlm: variable allocation types"
which attempts to dereference an "ls" struct when it's NULL.  Just
use the NOFS allocation type instead of trying to get the allocation
type from the ls struct (which would be either GFP_KERNEL or GFP_NOFS
if the struct existed).

Index: linux-rhel51-quilt/fs/dlm/rcom.c
===================================================================
--- linux-rhel51-quilt.orig/fs/dlm/rcom.c	2007-06-08 12:02:33.000000000 -0500
+++ linux-rhel51-quilt/fs/dlm/rcom.c	2007-07-13 14:54:37.000000000 -0500
@@ -385,8 +385,7 @@
 	dlm_recover_process_copy(ls, rc_in);
 }
 
-static int send_ls_not_ready(struct dlm_ls *ls, int nodeid,
-			     struct dlm_rcom *rc_in)
+static int send_ls_not_ready(int nodeid, struct dlm_rcom *rc_in)
 {
 	struct dlm_rcom *rc;
 	struct rcom_config *rf;
@@ -394,7 +393,7 @@
 	char *mb;
 	int mb_len = sizeof(struct dlm_rcom) + sizeof(struct rcom_config);
 
-	mh = dlm_lowcomms_get_buffer(nodeid, mb_len, ls->ls_allocation, &mb);
+	mh = dlm_lowcomms_get_buffer(nodeid, mb_len, GFP_NOFS, &mb);
 	if (!mh)
 		return -ENOBUFS;
 	memset(mb, 0, mb_len);
@@ -463,7 +462,7 @@
 		log_print("lockspace %x from %d type %x not found",
 			  hd->h_lockspace, nodeid, rc->rc_type);
 		if (rc->rc_type == DLM_RCOM_STATUS)
-			send_ls_not_ready(ls, nodeid, rc);
+			send_ls_not_ready(nodeid, rc);
 		return;
 	}