RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2026511 - blkid fails to complete when targeting non-block devices
Summary: blkid fails to complete when targeting non-block devices
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: util-linux
Version: 8.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-24 22:05 UTC by Nathaniel Weddle
Modified: 2022-05-10 16:55 UTC (History)
3 users (show)

Fixed In Version: util-linux-2.32.1-31.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:30:52 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-103893 0 None None None 2021-11-24 22:08:10 UTC
Red Hat Knowledge Base (Solution) 6538161 0 None None None 2021-11-24 22:08:54 UTC
Red Hat Product Errata RHBA-2022:2100 0 None None None 2022-05-10 15:31:05 UTC

Description Nathaniel Weddle 2021-11-24 22:05:08 UTC
Description of problem:

Running blkid and tareting non-block device fails to complete (no RC).  I've specifically noted this failure against /dev/hipraw devices.  I've not reproduced against any other devices I've tried but it's possible I've missed some.

Per man page:
~~~
RETURN CODE
       If the specified device or device addressed by specified token (option --match-token) was found and it's possible to gather
       any information about the device, an exit code 0 is returned.  Note the option --match-tag filters output tags, but it does
       not affect return code.

       If  the  specified  token  was  not found, or no (specified) devices could be identified, or it is impossible to gather any
       information about the device identifiers or device content an exit code of 2 is returned.

       For usage or other errors, an exit code of 4 is returned.

       If an ambivalent probing result was detected by low-level probing mode (-p), an exit code of 8 is returned.
~~~


Version-Release number of selected component (if applicable):

util-linux-2.32.1-24.el8.x86_64  and earlier

How reproducible:

# blkid /dev/hipraw*

Actual results:

Have to interrupt (ctrl+c) to return to command prompt

Expected results:

exit code of 2 is returned (if I'm readin the man page correctly) and drops to command prompt.

Additional info:

Initial issue was found because CU ran:
  # blkid /dev/*

Comment 1 Nathaniel Weddle 2021-11-24 22:19:11 UTC
I'd like to amend my initial expectation here as the RC's are probably only specific to block devices.  There is no way for blkid to force a device to issue and RC.  Maybe adding a timeout so that if blkid ioctl goes without a response from kernel for some time, it prints a timeout failure on the device and drops to command prompt or continues with the next device if multiple devices are being queried.

Comment 2 loberman 2021-11-24 23:46:53 UTC
How this presented here was this.

The customer ran blkid /dev/* and hit the non block device, /dev/port file.
This crashes a VMware guest so we told them its not a good idea to run this the way they did.

Nathan was able to also show that /dev/hidraw0 hangs when touched.

The idea here is to maybe change blkid such that if a wildcard is presented, its only block devices that get probed and the others are
ignored.

Seem like a simple change as we already have the file names and check the file type to see if its a block device.

Regards
Laurence

Comment 3 Karel Zak 2021-11-25 11:06:19 UTC
blkid (libblkid) supports block devices, regular files, and char devices (UBI devices). 

I have added (in the upstream tree) patches to libblkid and blkid(8) to be more careful with devices before it starts to read it.

https://github.com/util-linux/util-linux/commit/ab5304a7a34bfa45d9bee205ca4e26f03db6e79d
https://github.com/util-linux/util-linux/commit/7eb6d9ce4526b968e30f7e538cbbbdf9938e5891
https://github.com/util-linux/util-linux/commit/64cfe6ac37631a6347bd4005c72dd2d37e737f5e

but I'm not sure if this is so important that we need to backport it to RHEL-8. What do you think?

Comment 10 errata-xmlrpc 2022-05-10 15:30:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (util-linux bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2100


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