All of lore.kernel.org
 help / color / mirror / Atom feed
* master - use exclusive file lock on VG for activation
@ 2018-06-07 15:22 Joe Thornber
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Thornber @ 2018-06-07 15:22 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=616eeba6f2b33640534e26dea43661724edf3a14
Commit:        616eeba6f2b33640534e26dea43661724edf3a14
Parent:        e7aa51c70f17af10df906a7e123a497c1cf3c1ba
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Jun 6 11:14:39 2018 -0500
Committer:     Joe Thornber <ejt@redhat.com>
CommitterDate: Thu Jun 7 16:17:04 2018 +0100

use exclusive file lock on VG for activation

Make activation commands:
  vgchange -ay, lvchange -ay, pvscan -aay

take an exclusive file lock on the VG to serialize
multiple concurrent activation commands which could
otherwise interfere with each other.
---
 tools/lvchange.c |    2 +-
 tools/pvscan.c   |    2 +-
 tools/vgchange.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/lvchange.c b/tools/lvchange.c
index a90174e..3ed6b06 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1386,7 +1386,7 @@ int lvchange_activate_cmd(struct cmd_context *cmd, int argc, char **argv)
 	} else /* Component LVs might be active, support easy deactivation */
 		cmd->process_component_lvs = 1;
 
-	ret = process_each_lv(cmd, argc, argv, NULL, NULL, 0,
+	ret = process_each_lv(cmd, argc, argv, NULL, NULL, READ_FOR_UPDATE,
 			      NULL, &_lvchange_activate_check, &_lvchange_activate_single);
 
 	if (ret != ECMD_PROCESSED)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 7cba0f4..61626e6 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -288,7 +288,7 @@ static int _pvscan_autoactivate(struct cmd_context *cmd, struct pvscan_aa_params
 		pp->refresh_all = 1;
 	}
 
-	ret = process_each_vg(cmd, 0, NULL, NULL, vgnames, 0, 0, handle, _pvscan_autoactivate_single);
+	ret = process_each_vg(cmd, 0, NULL, NULL, vgnames, READ_FOR_UPDATE, 0, handle, _pvscan_autoactivate_single);
 
 	destroy_processing_handle(cmd, handle);
 
diff --git a/tools/vgchange.c b/tools/vgchange.c
index a67c3be..b07057f 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -791,7 +791,7 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
 			cmd->lockd_vg_enforce_sh = 1;
 	}
 
-	if (update)
+	if (update || arg_is_set(cmd, activate_ARG))
 		flags |= READ_FOR_UPDATE;
 
 	if (!(handle = init_processing_handle(cmd, NULL))) {



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* master - use exclusive file lock on VG for activation
@ 2018-06-06 21:36 David Teigland
  0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2018-06-06 21:36 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=58a9254252a4c837601c15aabdae53d2f3c06edc
Commit:        58a9254252a4c837601c15aabdae53d2f3c06edc
Parent:        d2d8dd7f7f21798cac37d9cc6a7cdcb290a63f4f
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Jun 6 11:14:39 2018 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Wed Jun 6 13:58:34 2018 -0500

use exclusive file lock on VG for activation

Make activation commands:
  vgchange -ay, lvchange -ay, pvscan -aay

take an exclusive file lock on the VG to serialize
multiple concurrent activation commands which could
otherwise interfere with each other.
---
 tools/lvchange.c |    2 +-
 tools/pvscan.c   |    2 +-
 tools/vgchange.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/lvchange.c b/tools/lvchange.c
index a90174e..3ed6b06 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1386,7 +1386,7 @@ int lvchange_activate_cmd(struct cmd_context *cmd, int argc, char **argv)
 	} else /* Component LVs might be active, support easy deactivation */
 		cmd->process_component_lvs = 1;
 
-	ret = process_each_lv(cmd, argc, argv, NULL, NULL, 0,
+	ret = process_each_lv(cmd, argc, argv, NULL, NULL, READ_FOR_UPDATE,
 			      NULL, &_lvchange_activate_check, &_lvchange_activate_single);
 
 	if (ret != ECMD_PROCESSED)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 7cba0f4..61626e6 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -288,7 +288,7 @@ static int _pvscan_autoactivate(struct cmd_context *cmd, struct pvscan_aa_params
 		pp->refresh_all = 1;
 	}
 
-	ret = process_each_vg(cmd, 0, NULL, NULL, vgnames, 0, 0, handle, _pvscan_autoactivate_single);
+	ret = process_each_vg(cmd, 0, NULL, NULL, vgnames, READ_FOR_UPDATE, 0, handle, _pvscan_autoactivate_single);
 
 	destroy_processing_handle(cmd, handle);
 
diff --git a/tools/vgchange.c b/tools/vgchange.c
index a67c3be..b07057f 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -791,7 +791,7 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
 			cmd->lockd_vg_enforce_sh = 1;
 	}
 
-	if (update)
+	if (update || arg_is_set(cmd, activate_ARG))
 		flags |= READ_FOR_UPDATE;
 
 	if (!(handle = init_processing_handle(cmd, NULL))) {



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-07 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 15:22 master - use exclusive file lock on VG for activation Joe Thornber
  -- strict thread matches above, loose matches on Subject: below --
2018-06-06 21:36 David Teigland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.