]> sourceware.org Git - lvm2.git/commitdiff
pvck: repair should clear hints
authorDavid Teigland <teigland@redhat.com>
Wed, 2 Sep 2020 19:21:17 +0000 (14:21 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 2 Sep 2020 19:21:17 +0000 (14:21 -0500)
repairing a pv can cause the hint file to become incorrect

test/shell/hints.sh
tools/pvck.c

index f95505a20990006d1c9af2be1d8f919338a68bad..176ee2176ca4298465ecf576def250d6fd7c4532 100644 (file)
@@ -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
index 302c746216d1b806883c601ffbb2d04d07c23a03..39449af68f237c7e6a8cca74a6d9bad8c4961107 100644 (file)
@@ -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;
This page took 0.043903 seconds and 5 git commands to generate.