The following reply was made to PR kern/144824; it has been noted by GNATS.
From: Daniel Hartmeier <dan...@benzedrine.cx> To: bug-follo...@freebsd.org Cc: gbl...@linagora.com Subject: Re: kern/144824: [boot] [patch] boot problem on USB (root partition mounting) Date: Fri, 16 Jul 2010 12:56:05 +0200 You have to move the ma initialization inside the retry loop, because kernel_mount() frees it, otherwise I get a kernel panic. With that changed, the patch solves the issue with an Intel S5000PAL board booting from USB, where da0 attaches slightly too late. Possibly related to the RMM2 (remote management module), which attaches multiple (virtual) CD-ROM drives to USB, which produce CAM/SCSI status errors. Daniel --- vfs_mount.c 30 Jan 2010 12:11:21 -0000 1.312.2.3 +++ vfs_mount.c 16 Jul 2010 10:38:46 -0000 @@ -1798,6 +1798,8 @@ int error; char patt[32]; char errmsg[255]; + char nbtry; + int rootmounttrymax; vfsname = NULL; path = NULL; @@ -1805,6 +1807,8 @@ ma = NULL; error = EINVAL; bzero(errmsg, sizeof(errmsg)); + nbtry = 0; + rootmounttrymax = 3; if (mountfrom == NULL) return (error); /* don't complain */ @@ -1821,13 +1825,23 @@ if (path[0] == '\0') strcpy(path, ROOTNAME); - ma = mount_arg(ma, "fstype", vfsname, -1); - ma = mount_arg(ma, "fspath", "/", -1); - ma = mount_arg(ma, "from", path, -1); - ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); - ma = mount_arg(ma, "ro", NULL, 0); - ma = parse_mountroot_options(ma, options); - error = kernel_mount(ma, MNT_ROOTFS); + while (1) { + ma = NULL; + ma = mount_arg(ma, "fstype", vfsname, -1); + ma = mount_arg(ma, "fspath", "/", -1); + ma = mount_arg(ma, "from", path, -1); + ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); + ma = mount_arg(ma, "ro", NULL, 0); + ma = parse_mountroot_options(ma, options); + error = kernel_mount(ma, MNT_ROOTFS); + if (nbtry < rootmounttrymax && error != 0) { + printf("Mount failed, retrying mount root from %s\n", + mountfrom); + tsleep(&rootmounttrymax, PZERO | PDROP, "mount", hz); + nbtry++; + } else + break; + } if (error == 0) { /* _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"