From 141a257f53d67efb1b0318352ce31673498af155 Mon Sep 17 00:00:00 2001 From: dillon Date: Tue, 9 Feb 1999 17:19:19 +0000 Subject: Fix bug in mount_mfs whereby mount_mfs would sometimes return before the mount is completely active, causing the next few commands attempting to manipulate data on the mount to fail. mount_mfs's parent now tries to wait for the mount point st_dev to change before returning, indicating that the mount has gone active. --- sbin/newfs/newfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sbin/newfs/newfs.c') diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 84bae0b..299ab4f 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95"; #endif static const char rcsid[] = - "$Id: newfs.c,v 1.26 1998/10/17 04:19:29 jkh Exp $"; + "$Id: newfs.c,v 1.27 1998/10/17 08:03:52 bde Exp $"; #endif /* not lint */ /* @@ -168,6 +168,8 @@ void fatal(); #define NSECTORS 4096 /* number of sectors */ int mfs; /* run as the memory based filesystem */ +char *mfs_mtpt; /* mount point for mfs */ +struct stat mfs_mtstat; /* stat prior to mount */ int Nflag; /* run without writing file system */ int Oflag; /* format as an 4.3BSD file system */ int fssize; /* file system size */ @@ -593,6 +595,15 @@ havelabel: pp->p_size *= secperblk; } #endif + if (mfs) { + mfs_mtpt = argv[1]; + if ( + stat(mfs_mtpt, &mfs_mtstat) < 0 || + !S_ISDIR(mfs_mtstat.st_mode) + ) { + fatal("mount point not dir: %s", mfs_mtpt); + } + } mkfs(pp, special, fsi, fso); #ifdef tahoe if (realsectorsize != DEV_BSIZE) -- cgit v1.1