Bug 193206 - nash's stabilized command doesn't sleep as long as intended
nash's stabilized command doesn't sleep as long as intended
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-25 21:40 EDT by Alexandre Oliva
Modified: 2009-05-09 10:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-15 15:02:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch that fixes the bug (3.22 KB, patch)
2006-07-29 22:35 EDT, Alexandre Oliva
no flags Details | Diff

  None (edit)
Description Alexandre Oliva 2006-05-25 21:40:47 EDT
Description of problem:
The sleep 8 that mkinitrd used to emit after usb-storage is no longer there,
which makes USB disks unusable for raid, lvm and others.  While putting it back
in, it might be nice to introduce it in such a way that it applies to both
usb-storage and sbp2, but the sleep is added after the last of the two if
they're both present.

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

How reproducible:
Every time

Steps to Reproduce:
1.Add alias scsi_hostadapter usb-storage to /etc/modprobe.conf
2.Re-run mkinitrd
3.Reboot

Actual results:
Note that it no longer waits 8 seconds for the USB bus to stabilize before it
brings up raid devices, volume groups et al

Expected results:
It should

Additional info:
Comment 1 Alexandre Oliva 2006-06-05 07:42:58 EDT
FWIW, this is not fixed yet in mkinitrd-5.0.41-3.  It looks like the delays in
stabilize are too short.  Adding an explicit --interval 1500 next to the
stabilize calls, then rebuilding mkinitrd, fixes it for me.
Comment 2 Chris Tyler 2006-06-06 17:11:09 EDT
I noticed today that having USB PVs in the VG that contains the root filesystem
... results in a system that won't boot (FC5). I presume that this bug report
covers that situation as well (?) but haven't make a custom initrd to verify.

Using an external USB drive as a PV in a pinch is a reasonable use case, but
this does not appear to be possible with the standard initrd.
Comment 3 Alexandre Oliva 2006-06-17 14:11:56 EDT
I still need --interval 1500 in the `stabilized' command lines for my external
disks to be brought up in time :-(
Comment 4 Alexandre Oliva 2006-07-03 19:06:32 EDT
It keeps getting worse :-(

I'm no longer sure the --interval is needed with mkinitrd-5.0.46-1, because the
multipath configuration now brought up by default stops raid auto-detection from
finding the raid 1 members in the USB disk, even if it is detected in time :-(
Comment 5 Alexandre Oliva 2006-07-16 12:50:25 EDT
stabilized is utterly broken on mkinitrd-5.0.47-1, it sleeps for hundreds of
seconds!  Just try:
echo stabilized / | strace nash 
Comment 6 Alexandre Oliva 2006-07-27 00:26:10 EDT
Still broken in 5.1.1-1 :-(
Comment 7 Alexandre Oliva 2006-07-28 16:51:13 EDT
<broken_record>Still broken in mkinitrd-5.1.2-1</broken_record> :-(

This small patch serves as a temporary work-around, but I can't even
install-test these systems with this feature broken :-(

--- /sbin/mkinitrd~     2006-07-26 15:43:41.000000000 -0300
+++ /sbin/mkinitrd      2006-07-28 17:45:50.000000000 -0300
@@ -1201 +1201 @@
-        emit "stabilized /proc/bus/usb/devices"
+        emit "stabilized --iterations 3 --interval 2 /proc/bus/usb/devices"
@@ -1205 +1205 @@
-        emit "stabilized /sys/bus/ieee1394/drivers/sbp2"
+        emit "stabilized --iterations 3 --interval 2
/sys/bus/ieee1394/drivers/sbp2"
Comment 8 Alexandre Oliva 2006-07-29 22:35:01 EDT
Created attachment 133287 [details]
Patch that fixes the bug

The conversion from nanoseconds to microseconds was missing a division by 1000
in udelayspec().  It didn't make sense to convert to usecs just to have it
converted back to timespec in udelay(), and udelay() was doing too much work to
handle EINTR, so I just implemented udelayspec() as a simple loop and
re-implemented udelay() in terms of it, simplifying (and fixing the
off-by-one-usec/sec) the conversion to timespec while at that.

I fixed stabilizedCommand() similarly, and had to also fix stabilizedMtime to
actually use mtime consistently, instead of setting last to the atime and then
comparing it partially with mtime, partially with atime.  Without a limit on
iterations, that would never finish.

With this patch, stabilized appears to work.
Comment 9 Peter Jones 2006-08-15 15:02:17 EDT
Thanks, will be in 5.1.7 .

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