VAX 750/4.2 BSD disk trashing

mwm%ucbopal at ucbvax.berkeley.edu mwm%ucbopal at ucbvax.berkeley.edu
Mon Jan 20 19:51:34 AEST 1986


You've just tripped over a known bug in 4.2 BSD. It's a symptom of a more
general problem: the mount system call is *stupid*. This has been fixed in
4.3.

I found the solution to your specific problem a while back, and mailed it
to the 4bsd-bugs list. You need to move a couple of lines about 1/2 dozen
lines in the mount call. The diffs follow.

	<mike
*** mount.fs.old	Wed Feb  6 17:07:11 1985
--- ufs_mount.c	Wed Feb  6 16:12:28 1985
***************
*** 87,92
  	mp->m_bufp = tp;	/* just to reserve this slot */
  	mp->m_dev = NODEV;
  	fs = tp->b_un.b_fs;
  	bp = geteblk((int)fs->fs_sbsize);
  	mp->m_bufp = bp;
  	bcopy((caddr_t)tp->b_un.b_addr, (caddr_t)bp->b_un.b_addr,

--- 87,94 -----
  	mp->m_bufp = tp;	/* just to reserve this slot */
  	mp->m_dev = NODEV;
  	fs = tp->b_un.b_fs;
+ 	if (fs->fs_magic != FS_MAGIC || fs->fs_bsize > MAXBSIZE)
+ 		goto out;
  	bp = geteblk((int)fs->fs_sbsize);
  	mp->m_bufp = bp;
  	bcopy((caddr_t)tp->b_un.b_addr, (caddr_t)bp->b_un.b_addr,
***************
*** 94,101
  	brelse(tp);
  	tp = 0;
  	fs = bp->b_un.b_fs;
- 	if (fs->fs_magic != FS_MAGIC || fs->fs_bsize > MAXBSIZE)
- 		goto out;
  	fs->fs_ronly = (ronly != 0);
  	if (ronly == 0)
  		fs->fs_fmod = 1;

--- 96,101 -----
  	brelse(tp);
  	tp = 0;
  	fs = bp->b_un.b_fs;
  	fs->fs_ronly = (ronly != 0);
  	if (ronly == 0)
  		fs->fs_fmod = 1;



More information about the Comp.unix.wizards mailing list