@@ -1124,6 +1124,7 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
char *local = NULL;
int status = 0;
int locked = 0;
+ int domain_locked = 0;
qr = (struct dlm_query_region *) msg->buf;
@@ -1140,6 +1141,7 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
status = -EINVAL;
spin_lock(&dlm_domain_lock);
+ domain_locked = 1;
dlm = __dlm_lookup_domain_full(qr->qr_domain, qr->qr_namelen);
if (!dlm) {
mlog(ML_ERROR, "Node %d queried hb regions on domain %s "
@@ -1171,7 +1173,8 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
bail:
if (locked)
spin_unlock(&dlm->spinlock);
- spin_unlock(&dlm_domain_lock);
+ if (domain_locked)
+ spin_unlock(&dlm_domain_lock);
kfree(local);