Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Copying info from a mail thread:
Trying to reproduce in RHEL6 it seems losetup is behaving better there. I am not able to get the race condition - if there is a conflict, losetup does retry to find another device as indicated with its output:
ioctl LOOP_SET_FD failed: Device or resource busy stolen loop=/dev/loop5...trying again ioctl LOOP_SET_FD failed: Device or resource busy stolen loop=/dev/loop6...trying again Loop device is /dev/loop7
The thing is that parsing this output we assign wrong value ("Device") to $loop variable and fail (silently?) later
https://github.com/rhinstaller/anaconda/blob/rhel6-branch/scripts/mk-images.efi#L34
This problem would not occur if we called losetup same as in rhel7, instead of:
local loop=$(losetup -v -f $diskimg | awk '{ print $4 }')
(where the parsing fails on the ioctl message while the losetup actually succeeds)
using:
local loop=$(losetup --show -f $diskimg)
(or, we could fix the -v call to look for the last item in the message:
local loop=$(echo $msg | awk '{ print $NF }')
)
So my theory is maybe there is no problem in losetup racing on rhel6 but in buildinstall mis-parsing losetup resolving race and failing silently and I believe it would be fixed by modifying the call.
To be safer, we can also add checking of return value of losetup (or presence of the device with losetup -j) and making buildinstall fail (by returning 1) in this case. This might be handy when number of losetup devices provided by kernel is exceeded (8 by default).
Adding retries (as in RHLE7 patch) is something I'd try to do only as a next step (if actually needed).