lvm2/fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
Eric ren 1a6b6dce97 Accepting request 563494 from network:ha-clustering:Unstable
- lvmlockd: add lockopt values for skipping selected locks (fate#323203) 
 + fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch

- lvmlockd: add lockopt values for skipping selected locks (fate#323203) 
 + fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch

- lvmlockd: add lockopt values for skipping selected locks (fate#323203) 
 + fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch

OBS-URL: https://build.opensuse.org/request/show/563494
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=214
2018-01-11 02:12:30 +00:00

80 lines
2.6 KiB
Diff

From 46cedb105bb7fdba0107794ca5801c2a0e8fd524 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Tue, 9 Jan 2018 11:18:57 -0600
Subject: [PATCH 1/2] lvmlockd: add lockopt values for skipping selected locks
and add lockopt to common options.
---
tools/command-lines.in | 9 ++++-----
tools/lvmcmdline.c | 10 ++++++++++
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index d0e5e060c..a1776ce8a 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -187,7 +187,7 @@
# OO_ALL is included in every command automatically.
#
OO_ALL: --commandprofile String, --config String, --debug,
---driverloaded Bool, --help, --longhelp, --profile String, --quiet,
+--driverloaded Bool, --help, --lockopt String, --longhelp, --profile String, --quiet,
--verbose, --version, --yes, --test
#
@@ -1524,19 +1524,18 @@ ID: vgchange_systemid
DESC: Change the system ID of a VG.
vgchange --lockstart
-OO: --lockopt String, --select String
+OO: --select String
OP: VG|Tag|Select ...
ID: vgchange_lockstart
DESC: Start the lockspace of a shared VG in lvmlockd.
vgchange --lockstop
-OO: --lockopt String, --select String
+OO: --select String
OP: VG|Tag|Select ...
ID: vgchange_lockstop
DESC: Stop the lockspace of a shared VG in lvmlockd.
vgchange --locktype LockType VG
-OO: --lockopt String
ID: vgchange_locktype
DESC: Change the lock type for a shared VG.
@@ -1563,7 +1562,7 @@ OO: --addtag Tag, --alloc Alloc, --autobackup Bool, --clustered Bool, --maxlogic
--physicalextentsize SizeMB, --force, --zero Bool, --labelsector Number,
--metadatasize SizeMB, --pvmetadatacopies MetadataCopiesPV, --vgmetadatacopies MetadataCopiesVG,
--reportformat ReportFmt, --dataalignment SizeKB, --dataalignmentoffset SizeKB,
---shared, --systemid String, --locktype LockType, --lockopt String
+--shared, --systemid String, --locktype LockType
ID: vgcreate_general
---
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index b693722c1..791e27206 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2682,6 +2682,16 @@ static int _init_lvmlockd(struct cmd_context *cmd)
return 1;
}
+ if (use_lvmlockd && arg_is_set(cmd, lockopt_ARG)) {
+ const char *opts = arg_str_value(cmd, lockopt_ARG, "");
+ if (strstr(opts, "skiplv"))
+ cmd->lockd_lv_disable = 1;
+ if (strstr(opts, "skipvg"))
+ cmd->lockd_vg_disable = 1;
+ if (strstr(opts, "skipgl"))
+ cmd->lockd_gl_disable = 1;
+ }
+
if (use_lvmlockd && locking_is_clustered()) {
log_error("ERROR: configuration setting use_lvmlockd cannot be used with clustered locking_type 3.");
return 0;
--
2.13.6