Bug 88594

Summary: mkinitrd-3.4.43-1 incompatible with gawk-3.1.2-1 -- fails to detect RAID devices
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: gawkAssignee: Florian La Roche <laroche>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: high Docs Contact:
Priority: medium    
Version: 1.0CC: katzj
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-15 08:42:11 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:
Attachments:
Description Flags
feed /proc/mdstat into awk with cat none

Description Jonathan Kamens 2003-04-11 06:50:30 UTC
/sbin/mkinitrd in mkinitrd-3.4.43-1 contains code that looks like this:

  awk '/^md[0-9][0-9]*[ 	]*:/ { print $4 }' /proc/mdstat

Unfortunately, it appears that the version of awk in gawk-3.1.2-1 refuses to
read any data from a file if stat on the file returns a size of 0:

  $ awk '/^md[0-9][0-9]*[       ]*:/ { print $4 }' /proc/mdstat
  $ cat /proc/mdstat | awk '/^md[0-9][0-9]*[    ]*:/ { print $4 }'  
  raid1
  raid1
  raid1
  raid1
  $ 

Now, it could be argued that this is a bug in gawk, and indeed, I think I'll
file a bug report about it, but still, I think it would be best for mkinitrd to
be resilient in the face of this problem by using the "cat" technique shown
above.  I'll attach a patch.

Comment 1 Jonathan Kamens 2003-04-11 06:51:05 UTC
Created attachment 91071 [details]
feed /proc/mdstat into awk with cat

Comment 2 Jeremy Katz 2003-04-11 18:22:26 UTC
No, this is gawk being busted and needing to be fixed, not something that should
be worked around in mkinitrd

Comment 3 Florian La Roche 2003-04-15 08:42:11 UTC
3.1.2-2 has a fix in it. Please reopen if that does not work for you.

Thanks a lot for this bug-report,

Florian La Roche