]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dlm: handle release_option as unsigned
authorAlexander Aring <aahringo@redhat.com>
Thu, 14 Aug 2025 15:22:13 +0000 (11:22 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 14 Aug 2025 20:16:05 +0000 (15:16 -0500)
Future patches will introduce a invalid argument check for undefined
values. All values for release_option are positive integer values to not
check on negative values as well we just change the parameter to
unsigned int.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lockspace.c
include/linux/dlm.h

index d986b7ef153dcf214dae6533c450a91fb0cd9e38..8eadbf0fdf179d5f5c31962dc46ef137c88be059 100644 (file)
@@ -676,7 +676,7 @@ int dlm_new_user_lockspace(const char *name, const char *cluster,
    This is because there may be LKBs queued as ASTs that have been unlinked
    from their RSBs and are pending deletion once the AST has been delivered */
 
-static int lockspace_busy(struct dlm_ls *ls, int release_option)
+static int lockspace_busy(struct dlm_ls *ls, unsigned int release_option)
 {
        struct dlm_lkb *lkb;
        unsigned long id;
@@ -704,7 +704,7 @@ static int lockspace_busy(struct dlm_ls *ls, int release_option)
        return rv;
 }
 
-static int release_lockspace(struct dlm_ls *ls, int release_option)
+static int release_lockspace(struct dlm_ls *ls, unsigned int release_option)
 {
        int busy, rv;
 
@@ -792,7 +792,7 @@ static int release_lockspace(struct dlm_ls *ls, int release_option)
  * See DLM_RELEASE defines for release_option values and their meaning.
  */
 
-int dlm_release_lockspace(void *lockspace, int force)
+int dlm_release_lockspace(void *lockspace, unsigned int release_option)
 {
        struct dlm_ls *ls;
        int error;
@@ -803,7 +803,7 @@ int dlm_release_lockspace(void *lockspace, int force)
        dlm_put_lockspace(ls);
 
        mutex_lock(&ls_lock);
-       error = release_lockspace(ls, force);
+       error = release_lockspace(ls, release_option);
        if (!error)
                ls_count--;
        if (!ls_count)
index 108eb953eb18110ad3f78103266df2d5ab1aec90..34015a008b801ca8a08754f0832bab4d890b1c99 100644 (file)
@@ -122,7 +122,8 @@ int dlm_new_lockspace(const char *name, const char *cluster,
  * release_option: see DLM_RELEASE values above.
  */
 
-int dlm_release_lockspace(dlm_lockspace_t *lockspace, int release_option);
+int dlm_release_lockspace(dlm_lockspace_t *lockspace,
+                         unsigned int release_option);
 
 /*
  * dlm_lock