On Tue, Nov 26, 2013 at 4:29 PM, Tejun Heo <tj@xxxxxxxxxx> wrote: > Hello, > > On Tue, Nov 26, 2013 at 04:12:41PM -0600, Josh Hunt wrote: >> I should have clarified that I'm not using dm/md in my setup. I know >> the modules are getting loaded in the log I attached, but root is not >> a md/dm device. > > Can you please still try it? The init script is broken and we're now > just trying to restore just enough of the old behavior so that the > issue is not exposed. The boot script in use seems to load md/dm > modules after storage drivers and use their termination as the signal > for "storage ready", so it could be a good enough bandaid even if > you're not using dm/md. > > Thanks. > > -- > tejun Tejun You're right. Thanks for pointing this out. I did not realize there was a bug in the init script. The version of initramfs-tools I was using had the following bug: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1215911 Updating to 0.99ubuntu13.4 of initramfs-tools resolved my boot hangs. I did try using the workaround as suggested by Linus. In my setup the dm_init() code was hit, however it still appeared to be too late at times. I also tried moving the call to async_synchronize_full() above the for loop and it still had the same issue (patch attached.) Out of around 10 reboot tests it failed to find root 1 or 2 times. The ubuntu scripts don't ever actually call do_mount() if it can't find the device. It seems to rely on some udev functionality to tell it when the device is present, and if that fails it just bails out. This change has introduced a regression. However, I only noticed it b/c my init script had a bug which caused it not to wait around for the device to appear. -- Josh
Index: linux-3.10/drivers/md/dm.c =================================================================== --- linux-3.10.orig/drivers/md/dm.c +++ linux-3.10/drivers/md/dm.c @@ -16,12 +16,13 @@ #include <linux/bio.h> #include <linux/mempool.h> #include <linux/slab.h> #include <linux/idr.h> #include <linux/hdreg.h> #include <linux/delay.h> +#include <linux/async.h> #include <trace/events/block.h> #define DM_MSG_PREFIX "core" #ifdef CONFIG_PRINTK @@ -275,12 +276,15 @@ static void (*_exits[])(void) = { static int __init dm_init(void) { const int count = ARRAY_SIZE(_inits); int r, i; + printk(KERN_CRIT "DBG: %s: Calling async_synchronize_full();\n", __func__); + async_synchronize_full(); + for (i = 0; i < count; i++) { r = _inits[i](); if (r) goto bad; } Index: linux-3.10/drivers/md/md.c =================================================================== --- linux-3.10.orig/drivers/md/md.c +++ linux-3.10/drivers/md/md.c @@ -48,12 +48,13 @@ #include <linux/file.h> #include <linux/compat.h> #include <linux/delay.h> #include <linux/raid/md_p.h> #include <linux/raid/md_u.h> #include <linux/slab.h> +#include <linux/async.h> #include "md.h" #include "bitmap.h" #ifndef MODULE static void autostart_arrays(int part); #endif @@ -8573,12 +8574,14 @@ static void autostart_arrays(int part) dev_t dev; int i_scanned, i_passed; i_scanned = 0; i_passed = 0; + printk(KERN_CRIT "DBG: %s: Calling async_synchronize_full()\n", __func__); + async_synchronize_full(); printk(KERN_INFO "md: Autodetecting RAID arrays.\n"); while (!list_empty(&all_detected_devices) && i_scanned < INT_MAX) { i_scanned++; node_detected_dev = list_entry(all_detected_devices.next, struct detected_devices_node, list);