Subject: Re: 1.6R panic with MFS /tmp
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: current-users
Date: 04/22/2003 13:49:42
Martti Kuparinen <martti.kuparinen@iki.fi> writes:

> I just rebuilt my host and it panics after trying to mount the MFS /tmp.

Try attached patch.  It fixes similar panic for my co-worker.

enami.
Index: vfs_subr.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_subr.c,v
retrieving revision 1.193
diff -u -r1.193 vfs_subr.c
--- vfs_subr.c	2003/04/18 22:44:45	1.193
+++ vfs_subr.c	2003/04/22 02:30:10
@@ -2837,7 +2758,7 @@
 
 			if (len < sizeof(sfs->f_mntonname) - 1) {
 				error = (*fun)(onp, &sfs->f_mntonname[len],
-				    len - sizeof(sfs->f_mntonname) - 1, &size);
+				    sizeof(sfs->f_mntonname) - len - 1, &size);
 				if (error)
 					return error;
 				size += len;
Index: mfs_vfsops.c
===================================================================
RCS file: /cvsroot/src/sys/ufs/mfs/mfs_vfsops.c,v
retrieving revision 1.46
diff -u -r1.46 mfs_vfsops.c
--- mfs_vfsops.c	2003/04/16 21:44:28	1.46
+++ mfs_vfsops.c	2003/04/22 03:34:14
@@ -321,7 +321,7 @@
 	error = set_statfs_info(path, UIO_USERSPACE, args.fspec,
 	    UIO_USERSPACE, mp, p);
 	(void)memcpy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname,
-	    sizeof(fs->fs_fsmnt));
+	    sizeof(mp->mnt_stat.f_mntonname));
 	return error;
 }