mirror of https://github.com/torvalds/linux.git
dlm: check for undefined release_option values
Checking on all undefined release_option values to return -EINVAL in case a user is providing them to dlm_release_lockspace(). Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
parent
8d90041a0d
commit
8e40210788
|
|
@ -797,6 +797,9 @@ int dlm_release_lockspace(void *lockspace, unsigned int release_option)
|
|||
struct dlm_ls *ls;
|
||||
int error;
|
||||
|
||||
if (release_option > __DLM_RELEASE_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
ls = dlm_find_lockspace_local(lockspace);
|
||||
if (!ls)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ int dlm_new_lockspace(const char *name, const char *cluster,
|
|||
#define DLM_RELEASE_NORMAL 2
|
||||
#define DLM_RELEASE_NO_EVENT 3
|
||||
#define DLM_RELEASE_RECOVER 4
|
||||
#define __DLM_RELEASE_MAX DLM_RELEASE_RECOVER
|
||||
|
||||
/*
|
||||
* dlm_release_lockspace
|
||||
|
|
|
|||
Loading…
Reference in New Issue