Bug 740341

Summary: inconsistent output of dmsetup table
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: agk, bmarzins, bmr, dwysocha, heinzm, jonathan, lvm-team, mbroz, msnitzer, prajnoha, prockai, pvrabec, zkabelac
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.86-6.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-11 22:02:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 718271    

Description Dan Horák 2011-09-21 17:22:45 UTC
Description of problem:
The output of "dmsetup table" differs when used with device name and with  major/minor pair. This breaks bootloader installation on s390x.

bash-4.2# dmsetup table /dev/dm-1
0 1048576 linear 94:5 2048

bash-4.2# dmsetup table -j 253 -m 1
vg_devel4-lv_boot: 0 1048576 linear 94:5 2048

bash-4.2# dmsetup table            
vg_devel4-lv_boot: 0 1048576 linear 94:5 2048
vg_devel4-lv_swap: 0 983040 linear 94:5 1050624
vg_devel4-lv_root: 0 4784128 linear 94:9 2048
vg_devel4-lv_root: 4784128 4784128 linear 94:13 2048
vg_devel4-lv_root: 9568256 4784128 linear 94:17 2048
vg_devel4-lv_root: 14352384 4784128 linear 94:21 2048
vg_devel4-lv_root: 19136512 4784128 linear 94:25 2048
vg_devel4-lv_root: 23920640 4784128 linear 94:29 2048
vg_devel4-lv_root: 28704768 2752512 linear 94:5 2033664
live-rw: 0 4194304 snapshot 7:1 7:2 P 8


Version-Release number of selected component (if applicable):
lvm2-2.02.86-5.fc16.s390x

Additional information:
same commands on F-15 return following

[root@devel1 ~]# dmsetup table
vg_devel1-lv_swap: 0 3735552 linear 94:2 2048
vg_devel1-lv_swap: 3735552 393216 linear 94:5 4392960
vg_devel1-lv_root: 0 4784128 linear 94:13 2048
vg_devel1-lv_root: 4784128 4784128 linear 94:17 2048
vg_devel1-lv_root: 9568256 4784128 linear 94:21 2048
vg_devel1-lv_root: 14352384 4784128 linear 94:25 2048
vg_devel1-lv_root: 19136512 4784128 linear 94:9 2048
vg_devel1-lv_root: 23920640 4784128 linear 94:29 2048
vg_devel1-lv_root: 28704768 4390912 linear 94:5 2048

[root@devel1 ~]# dmsetup table /dev/dm-1
0 3735552 linear 94:2 2048
3735552 393216 linear 94:5 4392960

[root@devel1 ~]# dmsetup table -j 253 -m 1
0 3735552 linear 94:2 2048
3735552 393216 linear 94:5 4392960

[root@devel1 ~]# rpm -q lvm2
lvm2-2.02.84-3.fc15.s390x

Comment 1 Milan Broz 2011-09-21 17:32:20 UTC
Shoold be just one line fix. 

--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
 -3478,7 +3478,8 @@ int main(int argc, char **argv)
        #endif
 
       doit:
-       multiple_devices = (argc != 2 && cmd->repeatable_cmd);
+       multiple_devices = (cmd->repeatable_cmd && argc != 2 &&
+                        (argc != 1 || (!_switches[UUID_ARG] && !_switches[MAJOR_ARG])));
        do {

Comment 2 Dan Horák 2011-09-21 18:09:04 UTC
(In reply to comment #1)
> Shoold be just one line fix. 
> 
> --- a/tools/dmsetup.c
> +++ b/tools/dmsetup.c
>  -3478,7 +3478,8 @@ int main(int argc, char **argv)
>         #endif
> 
>        doit:
> -       multiple_devices = (argc != 2 && cmd->repeatable_cmd);
> +       multiple_devices = (cmd->repeatable_cmd && argc != 2 &&
> +                        (argc != 1 || (!_switches[UUID_ARG] &&
> !_switches[MAJOR_ARG])));
>         do {

yes, this patch fixes my problem

Comment 3 Milan Broz 2012-01-26 21:08:19 UTC
Fixed in lvm2-2.02.86-6.fc16.

Comment 4 Fedora Update System 2012-01-26 21:10:20 UTC
lvm2-2.02.86-6.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/lvm2-2.02.86-6.fc16

Comment 5 Fedora Update System 2012-01-28 03:30:04 UTC
Package lvm2-2.02.86-6.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing lvm2-2.02.86-6.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0984/lvm2-2.02.86-6.fc16
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-02-11 22:02:37 UTC
lvm2-2.02.86-6.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.