From 41b6683357cd45d10e95f8e372e02fa6eb86bdd7 Mon Sep 17 00:00:00 2001 From: Satyam Sharma Date: Tue, 8 May 2007 09:18:58 +0100 Subject: [PATCH] --- yaml --- r: 58539 b: refs/heads/master c: 3168b0780d06ace875696f8a648d04d6089654e5 h: refs/heads/master i: 58537: 7c09c5f43fa9d47e1788abfb14f28f1c6534cbc1 58535: 6524938261035dc102cd05e7d56ab5d4e4045862 v: v3 --- [refs] | 2 +- trunk/fs/dlm/config.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index bbf7b9978b62..8f2f43622c66 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b524fe646c9a226a847e30ca1221dc22e952f16b +refs/heads/master: 3168b0780d06ace875696f8a648d04d6089654e5 diff --git a/trunk/fs/dlm/config.c b/trunk/fs/dlm/config.c index 822abdcd1434..5a3d390cc826 100644 --- a/trunk/fs/dlm/config.c +++ b/trunk/fs/dlm/config.c @@ -748,9 +748,16 @@ static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len) static struct space *get_space(char *name) { + struct config_item *i; + if (!space_list) return NULL; - return to_space(config_group_find_obj(space_list, name)); + + down(&space_list->cg_subsys->su_sem); + i = config_group_find_obj(space_list, name); + up(&space_list->cg_subsys->su_sem); + + return to_space(i); } static void put_space(struct space *sp) @@ -776,20 +783,20 @@ static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr) if (cm->nodeid != nodeid) continue; found = 1; + config_item_get(i); break; } else { if (!cm->addr_count || memcmp(cm->addr[0], addr, sizeof(*addr))) continue; found = 1; + config_item_get(i); break; } } up(&clusters_root.subsys.su_sem); - if (found) - config_item_get(i); - else + if (!found) cm = NULL; return cm; }