Skip to contentSkip to conversation

main - pvck: add lock_global() before clean_hint_file()

PATCH David Teigland 1 participant 1 message Jun 11, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8331321070899507b904d8a0ec78b413c826ae32
Commit:        8331321070899507b904d8a0ec78b413c826ae32
Parent:        17b27464868ac7049624d9b90f68c59200866997
Author:        Wu Guanghao <[email protected]>
AuthorDate:    Fri Jun 11 10:18:56 2021 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Jun 11 10:21:07 2021 -0500

pvck: add lock_global() before clean_hint_file()

---
 tools/pvck.c | 3 +++
 1 file changed, 3 insertions(+)
tools/pvck.c +3 -0
index 74663ec43..aba6a9cc8 100644
@@ -3037,6 +3037,9 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
 	if (arg_is_set(cmd, repairtype_ARG) || arg_is_set(cmd, repair_ARG)) {
 		pv_name = argv[0];
 
+		if (!lock_global(cmd, "ex"))
+			return ECMD_FAILED;
+
 		clear_hint_file(cmd);
 
 		if (!setup_device(cmd, pv_name)) {