Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58552
b: refs/heads/master
c: 79d72b5
h: refs/heads/master
v: v3
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Jul 9, 2007
1 parent 4642743 commit 11ff145
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c85d65e91430db94ae9ce0cf38b56e496658b642
refs/heads/master: 79d72b54483bf81b9f9de0dd555c710ac7267986
32 changes: 19 additions & 13 deletions trunk/fs/dlm/lockspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
{
struct dlm_ls *ls;
int i, size, error = -ENOMEM;
int do_unreg = 0;

if (namelen > DLM_LOCKSPACE_LEN)
return -EINVAL;
Expand Down Expand Up @@ -525,32 +526,34 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
error = dlm_recoverd_start(ls);
if (error) {
log_error(ls, "can't start dlm_recoverd %d", error);
goto out_rcomfree;
goto out_delist;
}

dlm_create_debug_file(ls);

error = kobject_setup(ls);
if (error)
goto out_del;
goto out_stop;

error = kobject_register(&ls->ls_kobj);
if (error)
goto out_del;
goto out_stop;

/* let kobject handle freeing of ls if there's an error */
do_unreg = 1;

error = do_uevent(ls, 1);
if (error)
goto out_unreg;
goto out_stop;

dlm_create_debug_file(ls);

log_debug(ls, "join complete");

*lockspace = ls;
return 0;

out_unreg:
kobject_unregister(&ls->ls_kobj);
out_del:
dlm_delete_debug_file(ls);
out_stop:
dlm_recoverd_stop(ls);
out_rcomfree:
out_delist:
spin_lock(&lslist_lock);
list_del(&ls->ls_list);
spin_unlock(&lslist_lock);
Expand All @@ -562,7 +565,10 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
out_rsbfree:
kfree(ls->ls_rsbtbl);
out_lsfree:
kfree(ls);
if (do_unreg)
kobject_unregister(&ls->ls_kobj);
else
kfree(ls);
out:
module_put(THIS_MODULE);
return error;
Expand Down Expand Up @@ -708,7 +714,7 @@ static int release_lockspace(struct dlm_ls *ls, int force)
dlm_clear_members_gone(ls);
kfree(ls->ls_node_array);
kobject_unregister(&ls->ls_kobj);
/* The ls structure will be freed when the kobject is done with */
/* The ls structure will be freed when the kobject is done with */

mutex_lock(&ls_lock);
ls_count--;
Expand Down

0 comments on commit 11ff145

Please sign in to comment.