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

(-)vfs_mount.c (-1 / +16 lines)
Lines 1798-1803 Link Here
1798
	int		error;
1806
	int		error;
1799
	char		patt[32];
1807
	char		patt[32];
1800
	char		errmsg[255];
1808
	char		errmsg[255];
1809
	char		nbtry;
1810
	int		rootmounttrymax;
1801
1811
1802
	vfsname = NULL;
1812
	vfsname = NULL;
1803
	path    = NULL;
1813
	path    = NULL;
Lines 1805-1810 Link Here
1805
	ma	= NULL;
1815
	ma	= NULL;
1806
	error   = EINVAL;
1816
	error   = EINVAL;
1807
	bzero(errmsg, sizeof(errmsg));
1817
	bzero(errmsg, sizeof(errmsg));
1818
	nbtry	= 0;
1819
	rootmounttrymax = 3;
1808
1820
1809
	if (mountfrom == NULL)
1821
	if (mountfrom == NULL)
1810
		return (error);		/* don't complain */
1822
		return (error);		/* don't complain */
Lines 1827-1833 Link Here
1827
	ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg));
1839
	ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg));
1828
	ma = mount_arg(ma, "ro", NULL, 0);
1840
	ma = mount_arg(ma, "ro", NULL, 0);
1829
	ma = parse_mountroot_options(ma, options);
1841
	ma = parse_mountroot_options(ma, options);
1830
	error = kernel_mount(ma, MNT_ROOTFS);
1842
1843
	TUNABLE_INT_FETCH("vfs.root.mounttrymax", &rootmounttrymax);
1844
	while (1) {
1845
		error = kernel_mount(ma, MNT_ROOTFS);
1846
		if (nbtry < rootmounttrymax && error != 0) {
1847
			printf("Mount failed, retrying mount root from %s\n", mountfrom);
1848
			tsleep(&rootmounttrymax, PZERO | PDROP, "mount", hz);
1849
			nbtry++;
1850
		}
1851
		else
1852
			break;
1853
	}
1831
1854
1832
	if (error == 0) {
1855
	if (error == 0) {
1833
		/*
1856
		/*

Return to bug 144824