Skip to content

Commit

Permalink
[DLM] force removal of user lockspace
Browse files Browse the repository at this point in the history
Check if the FORCEFREE flag has been provided from user space.  If so, set
the force option to dlm_release_lockspace() so that any remaining locks
will be freed.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
David Teigland authored and Steven Whitehouse committed Aug 31, 2006
1 parent 623d935 commit c6e6f0b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fs/dlm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
{
dlm_lockspace_t *lockspace;
struct dlm_ls *ls;
int error;
int error, force = 0;

if (!capable(CAP_SYS_ADMIN))
return -EPERM;
Expand All @@ -341,15 +341,18 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
}
kfree(ls->ls_device.name);

if (params->flags & DLM_USER_LSFLG_FORCEFREE)
force = 2;

lockspace = ls->ls_local_handle;

/* dlm_release_lockspace waits for references to go to zero,
so all processes will need to close their device for the ls
before the release will procede */

dlm_put_lockspace(ls);
error = dlm_release_lockspace(lockspace, 0);
out:
error = dlm_release_lockspace(lockspace, force);
out:
return error;
}

Expand Down

0 comments on commit c6e6f0b

Please sign in to comment.