[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] [PATCH] dlm: Allow large nodeids



David Teigland wrote:
> On Tue, Jan 27, 2009 at 02:06:30PM -0600, David Teigland wrote:
>> On Tue, Jan 27, 2009 at 11:33:30AM +0000, Chrissie Caulfield wrote:
>>> This an updated patch that uses hlists rather than list_heads to save
>>> memory in the connection structure.
>>>
>>> Thanks to Steven Whitehouse for the suggestion.
>> I fixed some checkpatch warnings, tested, and pushed into the "next" branch.
> 
> I take that back after hitting the following on unmount,
> 
> Pid: 4484, comm: umount Not tainted 2.6.29-rc2 #1
> RIP: 0010:[<ffffffffa04ecfb4>]  [<ffffffffa04ecfb4>] foreach_conn+0x20/0x46 [dlm]
> RSP: 0018:ffff880072db5d38  EFLAGS: 00010202

Thanks,

The attached patch should, I hope, fix that

-- 

Chrissie
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 6025669..14adca9 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -222,6 +222,19 @@ static void foreach_conn(void (*conn_func)(struct connection *con))
 	}
 }
 
+static void foreach_conn_safe(void (*conn_func)(struct connection *con))
+{
+	int i;
+	struct hlist_node *h, *n;
+	struct connection *con;
+
+	for (i=0; i < CONN_HASH_SIZE; i++) {
+		hlist_for_each_entry_safe(con, h, n, &connection_hash[i], list) {
+			conn_func(con);
+		}
+	}
+}
+
 static struct connection *nodeid2con(int nodeid, gfp_t allocation)
 {
 	struct connection *con;
@@ -1450,7 +1463,7 @@ void dlm_lowcomms_stop(void)
 	mutex_lock(&connections_lock);
 	clean_writequeues();
 
-	foreach_conn(free_conn);
+	foreach_conn_safe(free_conn);
 
 	mutex_unlock(&connections_lock);
 	kmem_cache_destroy(con_cache);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]