Bug 2188718 - 'pvck --dump -f <file>' should give a better error when the file already exists
Summary: 'pvck --dump -f <file>' should give a better error when the file already exists
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: lvm2
Version: 9.3
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: LVM Team
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-21 20:40 UTC by Corey Marthaler
Modified: 2023-08-10 15:40 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.03.21-2.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-6673 0 None None None 2023-05-02 16:13:45 UTC
Red Hat Issue Tracker RHELPLAN-155432 0 None None None 2023-04-21 20:41:49 UTC

Description Corey Marthaler 2023-04-21 20:40:45 UTC
Description of problem:
[root@virt-506 ~]# ls -l /tmp/meta.txt
-rw-------. 1 root root 15189 Apr 21 22:36 /tmp/meta.txt

[root@virt-506 ~]# pvck --dump metadata_search --settings metadata_offset=3870720 -f /tmp/meta.txt /dev/sdb
  Searching for metadata at offset 4096 size 4190208
  Failed to create file /tmp/meta.txt

[root@virt-506 ~]# pvck --dump metadata_search --settings metadata_offset=3870720 -f /tmp/meta2.txt /dev/sdb
  Searching for metadata at offset 4096 size 4190208
  metadata at 3870720 length 15190 crc 6afa48cc vg resize_matrix seqno 281 id VwYvXu-zDWf-M6FO-szLS-Z47u-zQlV-2FrQ2W



Version-Release number of selected component (if applicable):
lvm2-2.03.20-2.el9    BUILT: Thu Apr  6 01:40:29 PM CEST 2023
lvm2-libs-2.03.20-2.el9    BUILT: Thu Apr  6 01:40:29 PM CEST 2023

Comment 1 David Teigland 2023-04-28 18:35:16 UTC
fix in main
https://sourceware.org/git/?p=lvm2.git;a=commit;h=c4440b5b495a2d11ff541dd7e7791e2a83c83609

$ touch foo
$ pvck --dump metadata -f foo /dev/sdb 
  File already exists.
$ echo $?
5

Comment 3 Corey Marthaler 2023-05-30 18:22:12 UTC
Marking Verified:Tested in the latest rpms.

# before fix (lvm2-2.03.17-7.el9)
[root@virt-030 ~]# pvck --dump metadata /dev/sda -f /tmp/pvck_meta.459.1767298
  metadata text at 4608 crc 0xc6449eab # vgname df seqno 1
[root@virt-030 ~]# pvck --dump metadata /dev/sda -f /tmp/pvck_meta.459.1767298
  metadata text at 4608 crc 0xc6449eab # vgname df seqno 1
  Failed to create file /tmp/pvck_meta.459.1767298
[root@virt-030 ~]# echo $?
0


# after fix (lvm2-2.03.21-2.el9)
[root@virt-521 ~]# pvck --dump metadata /dev/sda -f /tmp/pvck_meta.459.1767298
  metadata text at 4608 crc 0x71775faf # vgname df seqno 1
[root@virt-521 ~]# pvck --dump metadata /dev/sda -f /tmp/pvck_meta.459.1767298
  File already exists.
[root@virt-521 ~]# echo $?
5


Note You need to log in before you can comment on or make changes to this bug.