Bug 2058176

Summary: losetup Retry LOOP_SET_STATUS64 on EAGAIN
Product: Red Hat Enterprise Linux 8 Reporter: Colin Walters <walters>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Radka Brychtova <rskvaril>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.6CC: bgilbert, hhei, jlebon, kzak, lmiksik, miabbott, pgm-rhel-tools, smilner
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: util-linux-2.32.1-35.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2059212 2060388 (view as bug list) Environment:
Last Closed: 2022-05-10 15:30:52 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:
Bug Depends On:    
Bug Blocks: 2059212, 2060388    

Description Colin Walters 2022-02-24 12:38:15 UTC
See https://github.com/openshift/os/issues/666#issuecomment-1049494630

TL;DR For FCOS/RHCOS we mount the rootfs with a non-zero offset, and that change is needed in order to make it not racy.

Comment 1 Micah Abbott 2022-02-28 14:22:13 UTC
Setting this to high severity as it is blocking the ability to properly test some ISO scenarios for RHCOS

Comment 3 Colin Walters 2022-03-01 16:50:04 UTC
It's worth considering if we can create a short-term workaround.  Which...I guess would be patching the code around here
https://github.com/coreos/fedora-coreos-config/commit/18a2c5182c8824021f246064cabf2fb665496df1#diff-45806cf5421d0e6b4fdf69598906a85020d1be4bf1fe430eae3eb040e097f8c4R117
to detect if util-linux is too old, and if so fall back to regenerating via e.g. dd if=rootfs.cpio skip=N ... ?

Or I guess we could just do the backport ourselves and ship an updated util-linux just in the AOS repo temporarily.

Comment 4 Karel Zak 2022-03-02 09:53:47 UTC
I have also extended this functionality in the upstream tree (commit http://github.com/util-linux/util-linux/commit/0ae7bb11c29aa11c8ef25b1ef2f82ee4701b856d).

I have no problem backporting it to 8.6 and 9.0, but the final result depends on QA capacity.

Comment 16 HuijingHei 2022-03-14 08:08:18 UTC
Build rchos 4.11(based on rhel8.6 latest repo with util-linux-2.32.1-35.el8.x86_64), test steps are according to Comment 10, mount command is not failed after running for 2 minutes.

@Karel, see logs like "loop_set_status: loop0 () has still dirty pages (nrpages=2)" in dmesg, could you help to confirm is this expected? Thanks!

Comment 17 Karel Zak 2022-03-14 08:55:19 UTC
(In reply to HuijingHei from comment #16)
> @Karel, see logs like "loop_set_status: loop0 () has still dirty pages
> (nrpages=2)" in dmesg, could you help to confirm is this expected? Thanks!

I guess yes, it's expected. This kernel message is used by the kernel on EAGAIN, and that's the situation
we try to address the patch (repeat the ioctl).

Comment 18 HuijingHei 2022-03-14 11:28:25 UTC
Thanks Karel for the confirmation

Comment 22 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

Comment 23 Karel Zak 2022-08-23 18:18:42 UTC
*** Bug 2060388 has been marked as a duplicate of this bug. ***