File 0040-pvck-add-lock_global-before-clean_hint_file.patch of Package lvm2

From 8331321070899507b904d8a0ec78b413c826ae32 Mon Sep 17 00:00:00 2001
From: Wu Guanghao <wuguanghao3@huawei.com>
Date: Fri, 11 Jun 2021 10:18:56 -0500
Subject: [PATCH 7/8] pvck: add lock_global() before clean_hint_file()

Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
---
 tools/pvck.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/pvck.c b/tools/pvck.c
index 74663ec43f65..aba6a9cc8787 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -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)) {
-- 
1.8.3.1
openSUSE Build Service is sponsored by