diff options
author | luigi <luigi@FreeBSD.org> | 2004-03-31 21:48:02 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-03-31 21:48:02 +0000 |
commit | f1e67ce243be5a22142dbe20d35dd7c1711d70a8 (patch) | |
tree | f981a4c0eb93ac2ff2fe046a914035143df2c7a7 /sys/dev/md | |
parent | 38842c29ce85dd8e507a574595ab60bb847ca662 (diff) | |
download | FreeBSD-src-f1e67ce243be5a22142dbe20d35dd7c1711d70a8.zip FreeBSD-src-f1e67ce243be5a22142dbe20d35dd7c1711d70a8.tar.gz |
Fix a bug with preloaded image -- for some reason [that i don't
completely understand], md_takeroot() runs before md_preloaded(),
rendering both useless.
As a fix, move the body (effectively one line!) of md_takeroot()
into md_preloaded(), and get rid of the stuff that has become useless.
Bug and fix reported 10 days ago on -current, no reply.
Diffstat (limited to 'sys/dev/md')
-rw-r--r-- | sys/dev/md/md.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 443eb1e..985de26 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -110,7 +110,6 @@ static u_char end_mfs_root[] __unused = "MFS Filesystem had better STOP here"; static g_init_t md_drvinit; -static int mdrootready; static int mdunits; static dev_t status_dev = 0; @@ -1180,8 +1179,10 @@ md_preloaded(u_char *image, unsigned length) sc->nsect = length / DEV_BSIZE; sc->pl_ptr = image; sc->pl_len = length; +#ifdef MD_ROOT if (sc->unit == 0) - mdrootready = 1; + rootdevnames[0] = "ufs:/dev/md0"; +#endif mdinit(sc); } @@ -1253,15 +1254,3 @@ static moduledata_t md_mod = { }; DECLARE_MODULE(md, md_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_VERSION(md, MD_MODVER); - - -#ifdef MD_ROOT -static void -md_takeroot(void *junk) -{ - if (mdrootready) - rootdevnames[0] = "ufs:/dev/md0"; -} - -SYSINIT(md_root, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, md_takeroot, NULL); -#endif /* MD_ROOT */ |