From owner-freebsd-stable Fri Nov 8 15:27:05 1996 Return-Path: owner-stable Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA18179 for stable-outgoing; Fri, 8 Nov 1996 15:27:05 -0800 (PST) Received: from salmon.maths.tcd.ie (mmdf@salmon.maths.tcd.ie [134.226.81.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA18170 for ; Fri, 8 Nov 1996 15:27:00 -0800 (PST) Received: from hamilton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id aa29259; 8 Nov 96 23:26 +0000 To: freebsd-stable@freebsd.org Subject: Background mounts occuring in the wrong order. Date: Fri, 08 Nov 1996 23:26:34 GMT From: David Malone Message-ID: <9611082326.aa29259@salmon.maths.tcd.ie> Sender: owner-stable@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. Somehow our SunOS 4.1.3 machines seem to handel this OK. 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, they're a patch for mount_nfs.c ( I've had a look at one of the 2.2 snapshots and its no better ) 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) {