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>
{
dlm_lockspace_t *lockspace;
struct dlm_ls *ls;
- int error;
+ int error, force = 0;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
}
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,
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;
}