Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!solace!nntp.uio.no!www.nntp.primenet.com!nntp.primenet.com!newspump.sol.net!howland.erols.net!EU.net!Ireland.EU.net!maths.tcd.ie!not-for-mail From: dwmalone@maths.tcd.ie (David Malone) Newsgroups: comp.unix.bsd.freebsd.misc Subject: Background mounts occuring in the wrong order. Date: 6 Nov 1996 22:47:31 -0000 Organization: Dept. of Maths, Trinity College, Dublin, Ireland. Lines: 68 Message-ID: <55r4i3$be1@synge.maths.tcd.ie> NNTP-Posting-Host: synge.maths.tcd.ie We've been having some problems where when machines reboot they background their nfs mounts. After that the background mounts occur out of the order they are in fstab. So for our news stuff ( for instance ) we mount : /news /news/spool /news/var If the mount for either /news/var or /news spool is "sucessful" before /news they then fail because they don't have a directory to mount on. I had a look at the source code for mount_nfs in 2.1.5-STABLE. I can think of two possible fixes : 1) Once the rpc call to the server goes OK retry for retrycnt times to do the mount call. 2) Do some sort of "build a tree of dependancies" and use this to determine the order in which mount calls are done. The first solution is easy to code, but a bit of a hack. The second would be clever -- probably too. Has anyone any suggestions ? I've tagged on some crude diffs for the first solution. David. 182d181 < int mount_retrycnt; 370,387c369,370 < if( opflags & ISBGRND ) < { < mount_retrycnt = retrycnt ; < while( mount_retrycnt > 0 ) < { < if (mount(vfc ? vfc->vfc_index : MOUNT_NFS, name, mntflags, nfsargsp)) < err(1, "%s", name); < else < mount_retrycnt = 0; < if( mount_retrycnt-- > 0 ) < sleep(120); < } < } < else < { < if (mount(vfc ? vfc->vfc_index : MOUNT_NFS, name, mntflags, nfsargsp)) < err(1, "%s", name); < } --- > if (mount(vfc ? vfc->vfc_index : MOUNT_NFS, name, mntflags, nfsargsp)) > err(1, "%s", name); 463d445 < int rpc_retrycnt = retrycnt; 539c521 < while (rpc_retrycnt > 0) { --- > while (retrycnt > 0) { 571c553 < rpc_retrycnt = 0; --- > retrycnt = 0; 575c557 < if (--rpc_retrycnt > 0) { --- > if (--retrycnt > 0) {