Commit c6e6f0ba authored by David Teigland's avatar David Teigland Committed by Steven Whitehouse
Browse files

[DLM] force removal of user lockspace



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: default avatarDavid Teigland <teigland@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 623d9355
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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;
@@ -341,6 +341,9 @@ 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,
@@ -348,7 +351,7 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
	   before the release will procede */

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