View | Details | Raw Unified | Return to bug 208882
Collapse All | Expand All

(-)b/sys/kern/vfs_mountroot.c (-13 / +29 lines)
Lines 707-713 parse_mount(char **conf) Link Here
707
	char *errmsg;
707
	char *errmsg;
708
	struct mntarg *ma;
708
	struct mntarg *ma;
709
	char *dev, *fs, *opts, *tok;
709
	char *dev, *fs, *opts, *tok;
710
	int error;
710
	int delay, error, timeout;
711
711
712
	error = parse_token(conf, &tok);
712
	error = parse_token(conf, &tok);
713
	if (error)
713
	if (error)
Lines 748-762 parse_mount(char **conf) Link Here
748
	if (error != 0)
748
	if (error != 0)
749
		goto out;
749
		goto out;
750
750
751
	ma = NULL;
751
	delay = hz / 10;
752
	ma = mount_arg(ma, "fstype", fs, -1);
752
	timeout = root_mount_timeout * hz;
753
	ma = mount_arg(ma, "fspath", "/", -1);
754
	ma = mount_arg(ma, "from", dev, -1);
755
	ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL);
756
	ma = mount_arg(ma, "ro", NULL, 0);
757
	ma = parse_mountroot_options(ma, opts);
758
	error = kernel_mount(ma, MNT_ROOTFS);
759
753
754
	do {
755
		ma = NULL;
756
		ma = mount_arg(ma, "fstype", fs, -1);
757
		ma = mount_arg(ma, "fspath", "/", -1);
758
		ma = mount_arg(ma, "from", dev, -1);
759
		ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL);
760
		ma = mount_arg(ma, "ro", NULL, 0);
761
		ma = parse_mountroot_options(ma, opts);
762
763
		error = kernel_mount(ma, MNT_ROOTFS);
764
		if (strcmp(fs, "zfs") != 0)
765
			break;
766
		timeout -= delay;
767
		if (timeout > 0 && error) {
768
			pause("rmdev", delay);
769
			printf("Mounting from %s:%s failed with error %d. "
770
			    "%d seconds left. Retrying.\n", fs, dev, error,
771
			    timeout / hz);
772
		}
773
	} while (timeout > 0 && error);
760
 out:
774
 out:
761
	if (error) {
775
	if (error) {
762
		printf("Mounting from %s:%s failed with error %d",
776
		printf("Mounting from %s:%s failed with error %d",
Lines 960-967 vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev) Link Here
960
	int delay, timeout;
974
	int delay, timeout;
961
975
962
	/*
976
	/*
963
	 * In case of ZFS and NFS we don't have a way to wait for
977
	 * For ZFS we can't simply wait for a specific device
964
	 * specific device.
978
	 * as we only know the pool name. To work around this,
979
	 * parse_mount() will retry the mount later on.
980
	 *
981
	 * While retrying for NFS could be implemented similarly
982
	 * it is currently not supported.
965
	 */
983
	 */
966
	if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL ||
984
	if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL ||
967
	    dev[0] == '\0') {
985
	    dev[0] == '\0') {
968
- 
969
well
986
well
970
--
971
sys/kern/vfs_mountroot.c | 7 ++-----
987
sys/kern/vfs_mountroot.c | 7 ++-----
972
1 file changed, 2 insertions(+), 5 deletions(-)
988
1 file changed, 2 insertions(+), 5 deletions(-)
(-)b/sys/kern/vfs_mountroot.c (-6 / +2 lines)
Lines 761-767 parse_mount(char **conf) Link Here
761
		ma = parse_mountroot_options(ma, opts);
761
		ma = parse_mountroot_options(ma, opts);
762
762
763
		error = kernel_mount(ma, MNT_ROOTFS);
763
		error = kernel_mount(ma, MNT_ROOTFS);
764
		if (strcmp(fs, "zfs") != 0)
764
		if (strcmp(fs, "zfs") != 0 || strstr(fs, "nfs") != NULL)
765
			break;
765
			break;
766
		timeout -= delay;
766
		timeout -= delay;
767
		if (timeout > 0 && error) {
767
		if (timeout > 0 && error) {
Lines 974-985 vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev) Link Here
974
	int delay, timeout;
974
	int delay, timeout;
975
975
976
	/*
976
	/*
977
	 * For ZFS we can't simply wait for a specific device
977
	 * For ZFS and NFS we can't simply wait for a specific device
978
	 * as we only know the pool name. To work around this,
978
	 * as we only know the pool name. To work around this,
979
	 * parse_mount() will retry the mount later on.
979
	 * parse_mount() will retry the mount later on.
980
	 *
981
	 * While retrying for NFS could be implemented similarly
982
	 * it is currently not supported.
983
	 */
980
	 */
984
	if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL ||
981
	if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL ||
985
	    dev[0] == '\0') {
982
	    dev[0] == '\0') {
986
- 

Return to bug 208882