NetBSD Problem Report #10122

Received: (qmail 9986 invoked from network); 15 May 2000 18:14:55 -0000
Message-Id: <200005151348.WAA00579@tsuneko.local>
Date: Mon, 15 May 2000 22:48:24 +0900 (JST)
From: matsunaw@ja2.so-net.ne.jp
Reply-To: matsunaw@ja2.so-net.ne.jp
To: gnats-bugs@gnats.netbsd.org
Subject: /var/run as mount_mfs
X-Send-Pr-Version: 3.95

>Number:         10122
>Category:       kern
>Synopsis:       /var/run as mount_mfs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 15 18:15:00 +0000 2000
>Closed-Date:    Fri Oct 13 17:00:59 +0000 2000
>Last-Modified:  Fri Oct 13 17:00:59 +0000 2000
>Originator:     Hitoshi Matsunawa
>Release:        1.4.2
>Organization:

>Environment:

System: NetBSD 1.4.2 i386
Running daemons: syslogd, named, update, cron, apmd, inetd
Mounted (mfs) filesystem: /tmp and /var/run mounted as mfs

>Description:

If ``halt''-ed immediately after creating some number of dirty buffer,
system will fail to shutdown.

>How-To-Repeat:

  % mknmz -a ~/src/linux-2.3.51/Documentation/
  % super halt

>Fix:

If I changed mfs_start() (in src/ufs/mfs/mfs_vfops.c) as follows, the
problem disappear (at least for me).

----
	while(mounted) {
		while(bio_request exist)
			doio (...);
		if(signaled)
			dounmount (...);
		signaled = tsleep (...);
	}
----

It may still potentially problematic, since mfs i/o is only served by
a mfs process. When a mfs process enters into doumount(), mfs i/o
won't be served for other processes (other than mfs process itself).
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: thorpej 
State-Changed-When: Tue May 16 10:20:43 PDT 2000 
State-Changed-Why:  
Fix committed to -current.  I will back-port to 1.4.2.  Please verify 
that your problem is fixed. 


Responsible-Changed-From-To: kern-bug-people->thorpej 
Responsible-Changed-By: thorpej 
Responsible-Changed-When: Tue May 16 10:20:43 PDT 2000 
Responsible-Changed-Why:  
I've committed a fix, and will take care of finalizing this PR. 

From: Jason R Thorpe <thorpej@zembu.com>
To: matsunaw@ja2.so-net.ne.jp
Cc: releng@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: kern/10122
Date: Tue, 16 May 2000 22:28:35 -0700

 The patch below is what I committed to -current, back-ported to
 NetBSD 1.4.2.  It fixes the problem completely.  Here is the
 commit message:

  ----------------------------
 Redo the way MFS does I/O to the server's address space.  Instead of
 queueing up buffers and awakening the MFS server process to do the I/O,
 we do the I/O to the server process's address space directly using
 facilities provided by UVM.

 This makes it possible for buffers attempting to flush out while the
 MFS is being unmounted to actually do the I/O, where before it would
 fail if the server process wasn't in the MFS idle loop (i.e. had been
 signaled and was attempting to exit).

 Should fix kern/10122 (I can no longer reproduce the problem described
 in the PR when running with these changes), and any number of other
 MFS-related complaints made by people over time.
  ----------------------------

 A good way to test this is to:

 	cd /tmp
 	shutdown -h now

 assuming /tmp is an MFS.

 I cannot test this myself on 1.4.2, so I would appreciate it if
 you could test this on your 1.4.2 system for me, and report back
 ASAP.

 RELENG: assuming the report comes back positive, consider this a
 pullup request, log message as above, with the following revisions:

 mfs_extern.h 1.9 -> 1.10
 mfs_vfsops.c 1.25 -> 1.27
 mfs_vnops.c 1.20 -> 1.22
 mfsnode.h 1.7 -> 1.9

 Thanks!

 -- 
         -- Jason R. Thorpe <thorpej@zembu.com>

 Index: mfs_extern.h
 ===================================================================
 RCS file: /cvsroot/syssrc/sys/ufs/mfs/mfs_extern.h,v
 retrieving revision 1.8
 diff -c -r1.8 mfs_extern.h
 *** mfs_extern.h	1998/08/10 08:11:13	1.8
 --- mfs_extern.h	2000/05/17 05:19:54
 ***************
 *** 61,67 ****
   /* mfs_vnops.c */
   int	mfs_open	__P((void *));
   int	mfs_strategy	__P((void *));
 - void	mfs_doio	__P((struct buf *, caddr_t));
   int	mfs_bmap	__P((void *));
   int	mfs_close	__P((void *));
   int	mfs_inactive	__P((void *));
 --- 61,66 ----
 Index: mfs_vfsops.c
 ===================================================================
 RCS file: /cvsroot/syssrc/sys/ufs/mfs/mfs_vfsops.c,v
 retrieving revision 1.19
 diff -c -r1.19 mfs_vfsops.c
 *** mfs_vfsops.c	1999/02/26 23:44:50	1.19
 --- mfs_vfsops.c	2000/05/17 05:19:55
 ***************
 *** 140,148 ****
   	mfsp->mfs_baseoff = mfs_rootbase;
   	mfsp->mfs_size = mfs_rootsize;
   	mfsp->mfs_vnode = rootvp;
 ! 	mfsp->mfs_pid = p->p_pid;
 ! 	mfsp->mfs_buflist = (struct buf *)0;
   	if ((error = ffs_mountfs(rootvp, mp, p)) != 0) {
   		mp->mnt_op->vfs_refcount--;
   		vfs_unbusy(mp);
   		free(mp, M_MOUNT);
 --- 140,151 ----
   	mfsp->mfs_baseoff = mfs_rootbase;
   	mfsp->mfs_size = mfs_rootsize;
   	mfsp->mfs_vnode = rootvp;
 ! 	mfsp->mfs_proc = NULL;		/* indicate kernel space */
 ! 	mfsp->mfs_alive = 1;
 ! 	mfsp->mfs_buflist.b_actf = NULL;
 ! 	mfsp->mfs_buflist.b_actb = &mfsp->mfs_buflist.b_actf;
   	if ((error = ffs_mountfs(rootvp, mp, p)) != 0) {
 + 		mfsp->mfs_alive = 0;
   		mp->mnt_op->vfs_refcount--;
   		vfs_unbusy(mp);
   		free(mp, M_MOUNT);
 ***************
 *** 244,253 ****
   	mfsp->mfs_baseoff = args.base;
   	mfsp->mfs_size = args.size;
   	mfsp->mfs_vnode = devvp;
 ! 	mfsp->mfs_pid = p->p_pid;
 ! 	mfsp->mfs_buflist = (struct buf *)0;
   	if ((error = ffs_mountfs(devvp, mp, p)) != 0) {
 ! 		mfsp->mfs_buflist = (struct buf *)-1;
   		vrele(devvp);
   		return (error);
   	}
 --- 247,258 ----
   	mfsp->mfs_baseoff = args.base;
   	mfsp->mfs_size = args.size;
   	mfsp->mfs_vnode = devvp;
 ! 	mfsp->mfs_proc = p;
 ! 	mfsp->mfs_alive = 1;
 ! 	mfsp->mfs_buflist.b_actf = NULL;
 ! 	mfsp->mfs_buflist.b_actb = &mfsp->mfs_buflist.b_actf;
   	if ((error = ffs_mountfs(devvp, mp, p)) != 0) {
 ! 		mfsp->mfs_alive = 0;
   		vrele(devvp);
   		return (error);
   	}
 ***************
 *** 268,276 ****
    * Used to grab the process and keep it in the kernel to service
    * memory filesystem I/O requests.
    *
 !  * Loop servicing I/O requests.
 !  * Copy the requested data into or out of the memory filesystem
 !  * address space.
    */
   /* ARGSUSED */
   int
 --- 273,280 ----
    * Used to grab the process and keep it in the kernel to service
    * memory filesystem I/O requests.
    *
 !  * What we actually do is just wait until we're told to go away.
 !  * mfs_strategy() does I/O directly to the process's address space.
    */
   /* ARGSUSED */
   int
 ***************
 *** 281,292 ****
   {
   	register struct vnode *vp = VFSTOUFS(mp)->um_devvp;
   	register struct mfsnode *mfsp = VTOMFS(vp);
 - 	register struct buf *bp;
 - 	register caddr_t base;
   	int sleepreturn = 0;

 ! 	base = mfsp->mfs_baseoff;
 ! 	while (mfsp->mfs_buflist != (struct buf *)-1) {
   		/*
   		 * If a non-ignored signal is received, try to unmount.
   		 * If that fails, or the filesystem is already in the
 --- 285,293 ----
   {
   	register struct vnode *vp = VFSTOUFS(mp)->um_devvp;
   	register struct mfsnode *mfsp = VTOMFS(vp);
   	int sleepreturn = 0;

 ! 	while (mfsp->mfs_alive) {
   		/*
   		 * If a non-ignored signal is received, try to unmount.
   		 * If that fails, or the filesystem is already in the
 ***************
 *** 301,313 ****
   			sleepreturn = 0;
   			continue;
   		}
 ! 
 ! 		while ((bp = mfsp->mfs_buflist) != NULL) {
 ! 			mfsp->mfs_buflist = bp->b_actf;
 ! 			mfs_doio(bp, base);
 ! 			wakeup((caddr_t)bp);
 ! 		}
 ! 		sleepreturn = tsleep(vp, mfs_pri, "mfsidl", 0);
   	}
   	return (sleepreturn);
   }
 --- 302,309 ----
   			sleepreturn = 0;
   			continue;
   		}
 ! 		sleepreturn = tsleep((void *)&mfsp->mfs_alive, mfs_pri,
 ! 		    "mfsidl", 0);
   	}
   	return (sleepreturn);
   }
 Index: mfs_vnops.c
 ===================================================================
 RCS file: /cvsroot/syssrc/sys/ufs/mfs/mfs_vnops.c,v
 retrieving revision 1.16.2.1
 diff -c -r1.16.2.1 mfs_vnops.c
 *** mfs_vnops.c	1999/10/10 20:51:58	1.16.2.1
 --- mfs_vnops.c	2000/05/17 05:19:55
 ***************
 *** 1,5 ****
 --- 1,41 ----
   /*	$NetBSD: mfs_vnops.c,v 1.16.2.1 1999/10/10 20:51:58 cgd Exp $	*/

 + /*-
 +  * Copyright (c) 2000 The NetBSD Foundation, Inc.
 +  * All rights reserved.
 +  *
 +  * This code is derived from software contributed to The NetBSD Foundation
 +  * by Jason R. Thorpe of Zembu Labs, Inc.
 +  *
 +  * Redistribution and use in source and binary forms, with or without
 +  * modification, are permitted provided that the following conditions
 +  * are met:
 +  * 1. Redistributions of source code must retain the above copyright
 +  *    notice, this list of conditions and the following disclaimer.
 +  * 2. Redistributions in binary form must reproduce the above copyright
 +  *    notice, this list of conditions and the following disclaimer in the
 +  *    documentation and/or other materials provided with the distribution.
 +  * 3. All advertising materials mentioning features or use of this software
 +  *    must display the following acknowledgement:
 +  *	This product includes software developed by the NetBSD
 +  *	Foundation, Inc. and its contributors.
 +  * 4. Neither the name of The NetBSD Foundation nor the names of its
 +  *    contributors may be used to endorse or promote products derived
 +  *    from this software without specific prior written permission.
 +  *
 +  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 +  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 +  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 +  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 +  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 +  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 +  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 +  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 +  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 +  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 +  * POSSIBILITY OF SUCH DAMAGE.
 +  */
 + 
   /*
    * Copyright (c) 1989, 1993
    *	The Regents of the University of California.  All rights reserved.
 ***************
 *** 44,55 ****
   #include <sys/map.h>
   #include <sys/vnode.h>
   #include <sys/malloc.h>

   #include <miscfs/genfs/genfs.h>
   #include <miscfs/specfs/specdev.h>

 - #include <machine/vmparam.h>
 - 
   #include <ufs/mfs/mfsnode.h>
   #include <ufs/mfs/mfsiom.h>
   #include <ufs/mfs/mfs_extern.h>
 --- 80,93 ----
   #include <sys/map.h>
   #include <sys/vnode.h>
   #include <sys/malloc.h>
 + #include <sys/uio.h>
 + 
 + #include <vm/vm.h>
 + #include <uvm/uvm_extern.h>

   #include <miscfs/genfs/genfs.h>
   #include <miscfs/specfs/specdev.h>

   #include <ufs/mfs/mfsnode.h>
   #include <ufs/mfs/mfsiom.h>
   #include <ufs/mfs/mfs_extern.h>
 ***************
 *** 143,195 ****
   		struct buf *a_bp;
   	} */ *ap = v;
   	register struct buf *bp = ap->a_bp;
   	register struct mfsnode *mfsp;
   	struct vnode *vp;
 ! 	struct proc *p = curproc;		/* XXX */

   	if (!vfinddev(bp->b_dev, VBLK, &vp) || vp->v_usecount == 0)
   		panic("mfs_strategy: bad dev");
   	mfsp = VTOMFS(vp);
 ! 	/* check for mini-root access */
 ! 	if (mfsp->mfs_pid == 0) {
 ! 		caddr_t base;

 ! 		base = mfsp->mfs_baseoff + (bp->b_blkno << DEV_BSHIFT);
   		if (bp->b_flags & B_READ)
   			memcpy(bp->b_data, base, bp->b_bcount);
   		else
   			memcpy(base, bp->b_data, bp->b_bcount);
 ! 		biodone(bp);
 ! 	} else if (mfsp->mfs_pid == p->p_pid) {
 ! 		mfs_doio(bp, mfsp->mfs_baseoff);
   	} else {
 ! 		bp->b_actf = mfsp->mfs_buflist;
 ! 		mfsp->mfs_buflist = bp;
 ! 		wakeup((caddr_t)vp);
 ! 	}
 ! 	return (0);
 ! }

 ! /*
 !  * Memory file system I/O.
 !  *
 !  * Trivial on the HP since buffer has already been mapping into KVA space.
 !  */
 ! void
 ! mfs_doio(bp, base)
 ! 	register struct buf *bp;
 ! 	caddr_t base;
 ! {
 ! 	base += (bp->b_blkno << DEV_BSHIFT);
 ! 	if (bp->b_flags & B_READ)
 ! 		bp->b_error = copyin(base, bp->b_data, bp->b_bcount);
 ! 	else
 ! 		bp->b_error = copyout(bp->b_data, base, bp->b_bcount);
 ! 	if (bp->b_error)
   		bp->b_flags |= B_ERROR;
   	else
   		bp->b_resid = 0;
   	biodone(bp);
   }

   /*
 --- 181,293 ----
   		struct buf *a_bp;
   	} */ *ap = v;
   	register struct buf *bp = ap->a_bp;
 + 	register struct buf *dp;
   	register struct mfsnode *mfsp;
   	struct vnode *vp;
 ! 	struct proc *p;
 ! 	struct uio auio;
 ! 	struct iovec aiov;
 ! 	caddr_t base;

   	if (!vfinddev(bp->b_dev, VBLK, &vp) || vp->v_usecount == 0)
   		panic("mfs_strategy: bad dev");
 + 
   	mfsp = VTOMFS(vp);
 ! 	p = mfsp->mfs_proc;
 ! 
 ! 	bp->b_error = 0;

 ! 	base = mfsp->mfs_baseoff + (bp->b_blkno << DEV_BSHIFT);
 ! 
 ! 	/*
 ! 	 * We have to preserve order, so what we do here is put
 ! 	 * ourselves on the end of the queue and then wait for
 ! 	 * our buffer to bubble to the front.  This is necessary
 ! 	 * in case we sleep faulting in the pages for the I/O
 ! 	 * and another process comes in to do I/O while we're
 ! 	 * sleeping.
 ! 	 *
 ! 	 * The fact that our buffer is still at the front of
 ! 	 * the queue while we process the I/O serves as a
 ! 	 * mutex.
 ! 	 */
 ! 	dp = &mfsp->mfs_buflist;
 ! 	bp->b_actf = NULL;
 ! 	bp->b_actb = dp->b_actb;
 ! 	*(dp->b_actb) = bp;
 ! 	dp->b_actb = &bp->b_actf;
 ! 
 ! 	while (mfsp->mfs_buflist.b_actf != bp)
 ! 		(void) tsleep(&mfsp->mfs_buflist, PRIBIO,
 ! 		    "mfsio", 0);
 ! 
 ! 	if (mfsp->mfs_proc == NULL) {
 ! 		/*
 ! 		 * Access to kernel-space miniroot.
 ! 		 */
   		if (bp->b_flags & B_READ)
   			memcpy(bp->b_data, base, bp->b_bcount);
   		else
   			memcpy(base, bp->b_data, bp->b_bcount);
 ! 	} else if (mfsp->mfs_proc == curproc) {
 ! 		/*
 ! 		 * The MFS server process is doing the I/O itself
 ! 		 * (possibly unmounting the file system).  Do the
 ! 		 * I/O to the address space directly.
 ! 		 */
 ! 		if (bp->b_flags & B_READ)
 ! 			bp->b_error = copyin(base, bp->b_data, bp->b_bcount);
 ! 		else
 ! 			bp->b_error = copyout(bp->b_data, base, bp->b_bcount);
   	} else {
 ! 		aiov.iov_base = bp->b_data;
 ! 		aiov.iov_len = bp->b_bcount;

 ! 		auio.uio_iov = &aiov;
 ! 		auio.uio_iovcnt = 1;
 ! 		auio.uio_offset = (vaddr_t)base;
 ! 		auio.uio_resid = bp->b_bcount;
 ! 		auio.uio_segflg = UIO_SYSSPACE;
 ! 		auio.uio_rw = (bp->b_flags & B_READ) ? UIO_READ : UIO_WRITE;
 ! 		auio.uio_procp = p;
 ! 
 ! 		/* XXXCDC: how should locking work here? */
 ! 		if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1)) {
 ! 			bp->b_error = EFAULT;
 ! 			goto out;
 ! 		}
 ! 
 ! 		/*
 ! 		 * XXX I don't think PHOLD()/PRELE() is really necessary
 ! 		 * XXX here.  --thorpej
 ! 		 */
 ! 		
 ! 		PHOLD(p);			/* XXX */
 ! 		p->p_vmspace->vm_refcnt++;	/* XXX */
 ! 		bp->b_error = uvm_io(&p->p_vmspace->vm_map, &auio);
 ! 		PRELE(p);			/* XXX */
 ! 		p->p_vmspace->vm_refcnt--;
 ! 	}
 !  out:
 ! 	if (bp->b_error != 0)
   		bp->b_flags |= B_ERROR;
   	else
   		bp->b_resid = 0;
 + 
 + 	/*
 + 	 * Pull our buffer off the front of the queue, thereby releasing
 + 	 * the mutex, and awaken any threads waiting to do I/O.
 + 	 */
 + 	if ((dp = bp->b_actf) != NULL)
 + 		dp->b_actb = bp->b_actb;
 + 	else
 + 		mfsp->mfs_buflist.b_actb = bp->b_actb;
 + 	*bp->b_actb = dp;
 + 	if (mfsp->mfs_buflist.b_actf != NULL)
 + 		wakeup(&mfsp->mfs_buflist);
 + 
   	biodone(bp);
 + 	return (0);
   }

   /*
 ***************
 *** 232,249 ****
   	} */ *ap = v;
   	register struct vnode *vp = ap->a_vp;
   	register struct mfsnode *mfsp = VTOMFS(vp);
 - 	register struct buf *bp;
   	int error;

   	/*
 - 	 * Finish any pending I/O requests.
 - 	 */
 - 	while ((bp = mfsp->mfs_buflist) != NULL) {
 - 		mfsp->mfs_buflist = bp->b_actf;
 - 		mfs_doio(bp, mfsp->mfs_baseoff);
 - 		wakeup((caddr_t)bp);
 - 	}
 - 	/*
   	 * On last close of a memory filesystem
   	 * we must invalidate any in core blocks, so that
   	 * we can, free up its vnode.
 --- 330,338 ----
 ***************
 *** 256,268 ****
   	 */
   	if (vp->v_usecount > 1)
   		printf("mfs_close: ref count %ld > 1\n", vp->v_usecount);
 ! 	if (vp->v_usecount > 1 || mfsp->mfs_buflist)
   		panic("mfs_close");
   	/*
   	 * Send a request to the filesystem server to exit.
   	 */
 ! 	mfsp->mfs_buflist = (struct buf *)(-1);
 ! 	wakeup((caddr_t)vp);
   	return (0);
   }

 --- 345,357 ----
   	 */
   	if (vp->v_usecount > 1)
   		printf("mfs_close: ref count %ld > 1\n", vp->v_usecount);
 ! 	if (vp->v_usecount > 1 || mfsp->mfs_buflist.b_actf != NULL)
   		panic("mfs_close");
   	/*
   	 * Send a request to the filesystem server to exit.
   	 */
 ! 	mfsp->mfs_alive = 0;
 ! 	wakeup((void *)&mfsp->mfs_alive);
   	return (0);
   }

 ***************
 *** 281,289 ****
   	struct vnode *vp = ap->a_vp;
   	struct mfsnode *mfsp = VTOMFS(vp);

 ! 	if (mfsp->mfs_buflist && mfsp->mfs_buflist != (struct buf *)(-1))
   		panic("mfs_inactive: not inactive (mfs_buflist %p)",
 ! 			mfsp->mfs_buflist);
   	VOP_UNLOCK(vp, 0);
   	return (0);
   }
 --- 370,378 ----
   	struct vnode *vp = ap->a_vp;
   	struct mfsnode *mfsp = VTOMFS(vp);

 ! 	if (mfsp->mfs_buflist.b_actf != NULL)
   		panic("mfs_inactive: not inactive (mfs_buflist %p)",
 ! 		    mfsp->mfs_buflist.b_actf);
   	VOP_UNLOCK(vp, 0);
   	return (0);
   }
 ***************
 *** 317,323 ****
   	} */ *ap = v;
   	register struct mfsnode *mfsp = VTOMFS(ap->a_vp);

 ! 	printf("tag VT_MFS, pid %d, base %p, size %ld\n", mfsp->mfs_pid,
   	    mfsp->mfs_baseoff, mfsp->mfs_size);
   	return (0);
   }
 --- 406,413 ----
   	} */ *ap = v;
   	register struct mfsnode *mfsp = VTOMFS(ap->a_vp);

 ! 	printf("tag VT_MFS, pid %d, base %p, size %ld\n",
 ! 	    (mfsp->mfs_proc != NULL) ? mfsp->mfs_proc->p_pid : 0,
   	    mfsp->mfs_baseoff, mfsp->mfs_size);
   	return (0);
   }
 Index: mfsnode.h
 ===================================================================
 RCS file: /cvsroot/syssrc/sys/ufs/mfs/mfsnode.h,v
 retrieving revision 1.6
 diff -c -r1.6 mfsnode.h
 *** mfsnode.h	1998/03/01 02:23:30	1.6
 --- mfsnode.h	2000/05/17 05:19:55
 ***************
 *** 43,51 ****
   	struct	vnode *mfs_vnode;	/* vnode associated with this mfsnode */
   	caddr_t	mfs_baseoff;		/* base of file system in memory */
   	long	mfs_size;		/* size of memory file system */
 ! 	pid_t	mfs_pid;		/* supporting process pid */
 ! 	struct	buf *mfs_buflist;	/* list of I/O requests */
 ! 	long	mfs_spare[4];
   };

   /*
 --- 43,51 ----
   	struct	vnode *mfs_vnode;	/* vnode associated with this mfsnode */
   	caddr_t	mfs_baseoff;		/* base of file system in memory */
   	long	mfs_size;		/* size of memory file system */
 ! 	struct	proc *mfs_proc;		/* supported process */
 ! 	struct	buf mfs_buflist;	/* list of I/O requests */
 ! 	__volatile int mfs_alive;	/* MFS is alive */
   };

   /*

From: Hitoshi Matsunawa <matsunaw@ja2.so-net.ne.jp>
To: thorpej@netbsd.org
Cc: releng@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: kern/10122
Date: Fri, 19 May 2000 00:46:43 +0900

 > A good way to test this is to:
 > 
 > 	cd /tmp
 > 	shutdown -h now
 > 
 > assuming /tmp is an MFS.

 I did this on plain 1.4.2.  I can tell the differences (between
 normal, i.e. the case w/o "cd /tmp") only because I'm focused on this
 problem now. It just take a little longer time to complete job. And
 this also makes me wonder, login (as root) shell grab /tmp locked (I
 mean reference count incremented) then kill-ed by /sbin/halt (w/
 SIGKILL) but never release that lock?  Otherwise shutdown should done
 the job w/o difference.
 # 1.4.2 w/ patch applied acts exactly same.

 > I cannot test this myself on 1.4.2, so I would appreciate it if
 > you could test this on your 1.4.2 system for me, and report back
 > ASAP.

 It also works well for me (using NetBSD 1.4.2 i386).




 BTW,

 I did work around in two way. One is reported in my PR, the other is
 to find another schedulable entity to callout dounmount() there. Only
 usable function I could found was kthread_create(). I tried this one,
 and works for me, but, it makes me feel somewhat dirty way to go (this
 is because I did't mention it in PR). If netbsd had real kernel thread
 supported... :-).

 cheers,
 matsunaw
 --
 H.Matsunawa	matsunaw@ja2.so-net.ne.jp

From: Jason R Thorpe <thorpej@zembu.com>
To: Hitoshi Matsunawa <matsunaw@ja2.so-net.ne.jp>
Cc: releng@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: kern/10122
Date: Thu, 18 May 2000 11:21:23 -0700

 On Fri, May 19, 2000 at 12:46:43AM +0900, Hitoshi Matsunawa wrote:

  > > I cannot test this myself on 1.4.2, so I would appreciate it if
  > > you could test this on your 1.4.2 system for me, and report back
  > > ASAP.
  > 
  > It also works well for me (using NetBSD 1.4.2 i386).

 Great.

 RELENG: Please hold-off committing my patch to the release branch
 until we figure out what's up with the SPARC lossage.

 -- 
         -- Jason R. Thorpe <thorpej@zembu.com>
State-Changed-From-To: feedback->open 
State-Changed-By: thorpej 
State-Changed-When: Fri May 19 13:44:22 PDT 2000 
State-Changed-Why:  
My previous changes had something Seriously Wrong with them... open 
again while I figure out what the problem is. 
State-Changed-From-To: open->closed 
State-Changed-By: simonb 
State-Changed-When: Fri Oct 13 09:57:18 PDT 2000 
State-Changed-Why:  
Committed change pretty much as suggested, after coming to the same solution 
without reading all of your PR(!). 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.