aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lockspace.c14
-rw-r--r--fs/dlm/lowcomms.c1
2 files changed, 14 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 109333c8ec..f8842ca443 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -43,6 +43,10 @@ static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len)
43 ssize_t ret = len; 43 ssize_t ret = len;
44 int n = simple_strtol(buf, NULL, 0); 44 int n = simple_strtol(buf, NULL, 0);
45 45
46 ls = dlm_find_lockspace_local(ls->ls_local_handle);
47 if (!ls)
48 return -EINVAL;
49
46 switch (n) { 50 switch (n) {
47 case 0: 51 case 0:
48 dlm_ls_stop(ls); 52 dlm_ls_stop(ls);
@@ -53,6 +57,7 @@ static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len)
53 default: 57 default:
54 ret = -EINVAL; 58 ret = -EINVAL;
55 } 59 }
60 dlm_put_lockspace(ls);
56 return ret; 61 return ret;
57} 62}
58 63
@@ -143,6 +148,12 @@ static ssize_t dlm_attr_store(struct kobject *kobj, struct attribute *attr,
143 return a->store ? a->store(ls, buf, len) : len; 148 return a->store ? a->store(ls, buf, len) : len;
144} 149}
145 150
151static void lockspace_kobj_release(struct kobject *k)
152{
153 struct dlm_ls *ls = container_of(k, struct dlm_ls, ls_kobj);
154 kfree(ls);
155}
156
146static struct sysfs_ops dlm_attr_ops = { 157static struct sysfs_ops dlm_attr_ops = {
147 .show = dlm_attr_show, 158 .show = dlm_attr_show,
148 .store = dlm_attr_store, 159 .store = dlm_attr_store,
@@ -151,6 +162,7 @@ static struct sysfs_ops dlm_attr_ops = {
151static struct kobj_type dlm_ktype = { 162static struct kobj_type dlm_ktype = {
152 .default_attrs = dlm_attrs, 163 .default_attrs = dlm_attrs,
153 .sysfs_ops = &dlm_attr_ops, 164 .sysfs_ops = &dlm_attr_ops,
165 .release = lockspace_kobj_release,
154}; 166};
155 167
156static struct kset dlm_kset = { 168static struct kset dlm_kset = {
@@ -678,7 +690,7 @@ static int release_lockspace(struct dlm_ls *ls, int force)
678 dlm_clear_members_gone(ls); 690 dlm_clear_members_gone(ls);
679 kfree(ls->ls_node_array); 691 kfree(ls->ls_node_array);
680 kobject_unregister(&ls->ls_kobj); 692 kobject_unregister(&ls->ls_kobj);
681 kfree(ls); 693 /* The ls structure will be freed when the kobject is done with */
682 694
683 mutex_lock(&ls_lock); 695 mutex_lock(&ls_lock);
684 ls_count--; 696 ls_count--;
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 867f93d041..6da6b14d5a 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -519,6 +519,7 @@ static int receive_from_sock(void)
519 msg.msg_flags = 0; 519 msg.msg_flags = 0;
520 msg.msg_control = incmsg; 520 msg.msg_control = incmsg;
521 msg.msg_controllen = sizeof(incmsg); 521 msg.msg_controllen = sizeof(incmsg);
522 msg.msg_iovlen = 1;
522 523
523 /* I don't see why this circular buffer stuff is necessary for SCTP 524 /* I don't see why this circular buffer stuff is necessary for SCTP
524 * which is a packet-based protocol, but the whole thing breaks under 525 * which is a packet-based protocol, but the whole thing breaks under