All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - pvck: repair should clear hints
Date: Wed,  2 Sep 2020 19:22:18 +0000 (GMT)	[thread overview]
Message-ID: <20200902192218.8A7CE3857C48@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f5a669f3145c92220346871bad4ab1c0149a1cc2
Commit:        f5a669f3145c92220346871bad4ab1c0149a1cc2
Parent:        8b9028bbe7a6f2e01ba6bddcf256d02fc11d4858
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Sep 2 14:21:17 2020 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Wed Sep 2 14:21:17 2020 -0500

pvck: repair should clear hints

repairing a pv can cause the hint file to become incorrect
---
 test/shell/hints.sh | 15 +++++++++++++++
 tools/pvck.c        |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/test/shell/hints.sh b/test/shell/hints.sh
index f95505a20..176ee2176 100644
--- a/test/shell/hints.sh
+++ b/test/shell/hints.sh
@@ -338,6 +338,21 @@ pvs
 not diff $HINTS $PREV
 
 
+#
+# Test pvck --repair forces refresh
+#
+
+rm $HINTS $PREV
+pvs
+cp $HINTS $PREV
+pvck --repairtype label_header -y "$dev5"
+cat $NEWHINTS
+grep 'Created empty by pvck' $HINTS
+# this next pvs creates new hints
+pvs
+# the only diff will be "Created by..."
+not diff $HINTS $PREV
+
 
 #
 # Test incorrect dev-to-pvid info in hints is detected
diff --git a/tools/pvck.c b/tools/pvck.c
index 302c74621..39449af68 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -3037,6 +3037,8 @@ 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];
 
+		clear_hint_file(cmd);
+
 		if (!(dev = dev_cache_get(cmd, pv_name, cmd->filter))) {
 			log_error("No device found for %s %s.", pv_name, dev_cache_filtered_reason(pv_name));
 			return ECMD_FAILED;



                 reply	other threads:[~2020-09-02 19:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200902192218.8A7CE3857C48@sourceware.org \
    --to=teigland@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.