.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /****************************************************************************** |
---|
2 | 3 | ******************************************************************************* |
---|
3 | 4 | ** |
---|
4 | 5 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
---|
5 | 6 | ** Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. |
---|
6 | 7 | ** |
---|
7 | | -** This copyrighted material is made available to anyone wishing to use, |
---|
8 | | -** modify, copy, or redistribute it subject to the terms and conditions |
---|
9 | | -** of the GNU General Public License v.2. |
---|
10 | 8 | ** |
---|
11 | 9 | ******************************************************************************* |
---|
12 | 10 | ******************************************************************************/ |
---|
.. | .. |
---|
160 | 158 | &dlm_attr_recover_nodeid.attr, |
---|
161 | 159 | NULL, |
---|
162 | 160 | }; |
---|
| 161 | +ATTRIBUTE_GROUPS(dlm); |
---|
163 | 162 | |
---|
164 | 163 | static ssize_t dlm_attr_show(struct kobject *kobj, struct attribute *attr, |
---|
165 | 164 | char *buf) |
---|
.. | .. |
---|
189 | 188 | }; |
---|
190 | 189 | |
---|
191 | 190 | static struct kobj_type dlm_ktype = { |
---|
192 | | - .default_attrs = dlm_attrs, |
---|
| 191 | + .default_groups = dlm_groups, |
---|
193 | 192 | .sysfs_ops = &dlm_attr_ops, |
---|
194 | 193 | .release = lockspace_kobj_release, |
---|
195 | 194 | }; |
---|
.. | .. |
---|
198 | 197 | |
---|
199 | 198 | static int do_uevent(struct dlm_ls *ls, int in) |
---|
200 | 199 | { |
---|
201 | | - int error; |
---|
202 | | - |
---|
203 | 200 | if (in) |
---|
204 | 201 | kobject_uevent(&ls->ls_kobj, KOBJ_ONLINE); |
---|
205 | 202 | else |
---|
.. | .. |
---|
210 | 207 | /* dlm_controld will see the uevent, do the necessary group management |
---|
211 | 208 | and then write to sysfs to wake us */ |
---|
212 | 209 | |
---|
213 | | - error = wait_event_interruptible(ls->ls_uevent_wait, |
---|
214 | | - test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags)); |
---|
| 210 | + wait_event(ls->ls_uevent_wait, |
---|
| 211 | + test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags)); |
---|
215 | 212 | |
---|
216 | | - log_rinfo(ls, "group event done %d %d", error, ls->ls_uevent_result); |
---|
| 213 | + log_rinfo(ls, "group event done %d", ls->ls_uevent_result); |
---|
217 | 214 | |
---|
218 | | - if (error) |
---|
219 | | - goto out; |
---|
220 | | - |
---|
221 | | - error = ls->ls_uevent_result; |
---|
222 | | - out: |
---|
223 | | - if (error) |
---|
224 | | - log_error(ls, "group %s failed %d %d", in ? "join" : "leave", |
---|
225 | | - error, ls->ls_uevent_result); |
---|
226 | | - return error; |
---|
| 215 | + return ls->ls_uevent_result; |
---|
227 | 216 | } |
---|
228 | 217 | |
---|
229 | 218 | static int dlm_uevent(struct kset *kset, struct kobject *kobj, |
---|
.. | .. |
---|
431 | 420 | int do_unreg = 0; |
---|
432 | 421 | int namelen = strlen(name); |
---|
433 | 422 | |
---|
434 | | - if (namelen > DLM_LOCKSPACE_LEN) |
---|
| 423 | + if (namelen > DLM_LOCKSPACE_LEN || namelen == 0) |
---|
435 | 424 | return -EINVAL; |
---|
436 | 425 | |
---|
437 | 426 | if (!lvblen || (lvblen % 8)) |
---|
.. | .. |
---|
681 | 670 | out_lkbidr: |
---|
682 | 671 | idr_destroy(&ls->ls_lkbidr); |
---|
683 | 672 | out_rsbtbl: |
---|
684 | | - for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) { |
---|
685 | | - if (ls->ls_remove_names[i]) |
---|
686 | | - kfree(ls->ls_remove_names[i]); |
---|
687 | | - } |
---|
| 673 | + for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) |
---|
| 674 | + kfree(ls->ls_remove_names[i]); |
---|
688 | 675 | vfree(ls->ls_rsbtbl); |
---|
689 | 676 | out_lsfree: |
---|
690 | 677 | if (do_unreg) |
---|