Bug 1441175

Summary: lsblk -sl has unexpected output ordering
Product: [Fedora] Fedora Reporter: Marius Vollmer <mvollmer>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: jonathan, kzak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-20 12:33:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marius Vollmer 2017-04-11 11:59:28 UTC
Description of problem:

lsblk -ls used to output the child first, then the parent, but now it outputs the parent first, then the child.

Consider a block disk with a single partition on it.  Lsblk lists the disk before the partition both as a tree and as a list:

# lsblk /dev/sda
NAME                          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                             8:0    0  100M  0 disk 
└─sda1                          8:1    0  100M  0 part 

# lsblk -l /dev/sda
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0  100M  0 disk 
sda1                        8:1    0  100M  0 part 

However, when using inverse order (-s), the tree and list show different output order:

# lsblk -s /dev/sda1
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda1    8:1    0  100M  0 part 
└─sda   8:0    0  100M  0 disk 

# lsblk -sl /dev/sda1
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda    8:0    0  100M  0 disk 
sda1   8:1    0  100M  0 part 

Now the parent comes first with -sl, but last with just -s.  The parent used to always come last.

We use lsblk in a script to walk up the dependency tree of a block device and used to assume that -sl orders its output from children to parent.

If this isn't a regression in lsblk, it would be nice to document how -l orders its output.

Version-Release number of selected component (if applicable):
util-linux-2.29.1-2.fc26.x86_64

How reproducible:
Always

Steps to Reproduce: See above

Comment 1 Karel Zak 2017-04-11 12:41:12 UTC
Seems like a real unwanted regression.

Comment 4 Marius Vollmer 2017-04-18 07:13:02 UTC
Thanks!

Comment 5 Marius Vollmer 2017-06-07 10:42:19 UTC
> Fedora rpms will be updated ASAP. Thanks!

I don't see the updated rpms anywhere.  Am I missing something?

Comment 6 Fedora Update System 2017-06-22 10:07:43 UTC
util-linux-2.30-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0d905dbef8

Comment 7 Karel Zak 2017-06-22 10:12:50 UTC
It was too late to push a new upstream release to f26. Now the package is between updates for f26 and in rawhide (f27). 

Sorry, for the delay.

Comment 8 Fedora Update System 2017-06-23 06:26:38 UTC
util-linux-2.30-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-0d905dbef8

Comment 9 Fedora Update System 2017-07-07 22:57:05 UTC
util-linux-2.30-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.