lvmlockd: --lockopt was mistakenly ignored when --nolocking was set 1974979820
authorDavid Teigland <teigland@redhat.com>
Fri, 8 Aug 2025 19:06:24 +0000 (14:06 -0500)
committerDavid Teigland <teigland@redhat.com>
Fri, 8 Aug 2025 19:06:24 +0000 (14:06 -0500)
tools/lvmcmdline.c

index a346c8a5d7c30872933c8063c79eb7e9c302ed4e..4fce42341bb9e28e1c1f5c2906ad2fdd532c944b 100644 (file)
@@ -2986,6 +2986,19 @@ static int _init_lvmlockd(struct cmd_context *cmd)
        if (use_lvmlockd)
                cmd->enable_hints = 0;
 
+       if (arg_is_set(cmd, lockopt_ARG)) {
+               lockd_lockopt_get_flags(arg_str_value(cmd, lockopt_ARG, ""), &cmd->lockopt);
+
+               if (use_lvmlockd) {
+                       if (cmd->lockopt & LOCKOPT_SKIPLV)
+                               cmd->lockd_lv_disable = 1;
+                       if (cmd->lockopt & LOCKOPT_SKIPVG)
+                               cmd->lockd_vg_disable = 1;
+                       if (cmd->lockopt & LOCKOPT_SKIPGL)
+                               cmd->lockd_gl_disable = 1;
+               }
+       }
+
        if (use_lvmlockd && arg_is_set(cmd, nolocking_ARG)) {
                /* --nolocking is only allowed with vgs/lvs/pvs commands */
                cmd->lockd_gl_disable = 1;
@@ -2994,17 +3007,6 @@ static int _init_lvmlockd(struct cmd_context *cmd)
                return 1;
        }
 
-       if (use_lvmlockd && arg_is_set(cmd, lockopt_ARG)) {
-               lockd_lockopt_get_flags(arg_str_value(cmd, lockopt_ARG, ""), &cmd->lockopt);
-
-               if (cmd->lockopt & LOCKOPT_SKIPLV)
-                       cmd->lockd_lv_disable = 1;
-               if (cmd->lockopt & LOCKOPT_SKIPVG)
-                       cmd->lockd_vg_disable = 1;
-               if (cmd->lockopt & LOCKOPT_SKIPGL)
-                       cmd->lockd_gl_disable = 1;
-       }
-
        lvmlockd_disconnect(); /* start over when tool context is refreshed */
        lvmlockd_socket = getenv("LVM_LVMLOCKD_SOCKET");
        if (!lvmlockd_socket)
This page took 0.091473 seconds and 5 git commands to generate.