lvm-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Ranjith ML <rmadhuso@redhat.com>
To: lvm-devel@lists.linux.dev
Subject: VG metadata file names appear twice while executing "vgcfgrestore"
Date: Mon, 18 Dec 2023 17:25:31 +0530	[thread overview]
Message-ID: <CAGEzBDznnrBNrVKeLNEZrb6TQ-SvrJDAdRRQ1FDatcsX8bf4MA@mail.gmail.com> (raw)

Hi,

VG metadata file names appear twice while executing "vgcfgrestore" and
this patch fixes it by removing duplicate file name.

The modification in this patch updates the logging VG metadata file
name in the _display_archive function to print only the file path
(path) without including the additional file name (af->name).

---
$ cat 0118-vgcfgrestore.patch
diff -Nurp LVM2.2.03.14.org/lib/format_text/archive.c
LVM2.2.03.14/lib/format_text/archive.c
--- LVM2.2.03.14.org/lib/format_text/archive.c  2021-10-20
15:55:05.000000000 +0530
+++ LVM2.2.03.14/lib/format_text/archive.c  2023-12-14 00:56:16.108721142 +0530
@@ -313,7 +313,7 @@ static void _display_archive(struct cmd_
  }

  log_print(" ");
- log_print("File:\t\t%s/%s", path, af->name);
+ log_print("File:\t\t%s", path);
  tc.path_live = path;

  fic.type = FMT_INSTANCE_PRIVATE_MDAS;
---

Without the fix, vgcfgrestore incorrectly prints the VG metadata file path.

---
# vgcfgrestore -l rhel

  File:   /etc/lvm/archive/rhel_00000-1376411295.vg/rhel_00000-1376411295.vg
  <====
  VG name:      rhel
  Description:  Created *before* executing 'pvscan --cache --activate ay 252:2'
  Backup Time:  Wed Jul 19 15:44:51 2023


  File:   /etc/lvm/backup/rhel/rhel
  VG name:      rhel
  Description:  Created *after* executing 'pvscan --cache --activate ay 252:2'
  Backup Time:  Wed Jul 19 15:44:51 2023
---

With this fix, it prints correctly.

---
# vgcfgrestore -l rhel

  File:   /etc/lvm/archive/rhel_00000-1376411295.vg
  VG name:      rhel
  Description:  Created *before* executing 'pvscan --cache --activate ay 252:2'
  Backup Time:  Wed Jul 19 15:44:51 2023


  File:   /etc/lvm/backup/rhel
  VG name:      rhel
  Description:  Created *after* executing 'pvscan --cache --activate ay 252:2'
  Backup Time:  Wed Jul 19 15:44:51 2023
---

Regards,
Ranjith


                 reply	other threads:[~2023-12-18 11:55 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=CAGEzBDznnrBNrVKeLNEZrb6TQ-SvrJDAdRRQ1FDatcsX8bf4MA@mail.gmail.com \
    --to=rmadhuso@redhat.com \
    --cc=lvm-devel@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).