Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 1998 14:54:26 -0700 (MST)
From:      Stephen Clawson <sclawson@cs.utah.edu>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   kern/8965: missing wakeup in vfs_syscalls.c:dounmount
Message-ID:  <199812042154.OAA10654@moab.cs.utah.edu>

next in thread | raw e-mail | index | archive | help

>Number:         8965
>Category:       kern
>Synopsis:       missing wakeup in vfs_syscalls.c:dounmount
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec  4 14:00:00 PST 1998
>Last-Modified:
>Originator:     Stephen Clawson
>Organization:
University of Utah
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

I'm running on a dual Pentium II/350 using the SMP kernel.

102 2:37pm ibapah: ~> uname -a
FreeBSD ibapah.cs.utah.edu 3.0-CURRENT FreeBSD 3.0-CURRENT #7: Fri Dec  4 14:03:40 MST 1998     sclawson@ibapah.cs.utah.edu:/usr/src/sys/compile/SMP  i386

>Description:

A process tries to unmount a filesystem (in my case this is amd and
it's an nfsv2 filesystem) and manages to get far enough into dounmount
that it sets the MNTK_UNMOUNT flag in the mountpoint's mnt_kern_flag
field.  Another process (in my case netscape) tries to stat a file
that's on that filesystem.  Netscape blocks in vfs_busy because
MNTK_UNMOUNT is set.  However when amd runs again it gets an error and
exits dounmount prematurely.  It clears the MNTK_UNMOUNT flag and
generally cleaning up, but dosen't call wakeup on the mountpoint,
causing netscape to hang since it's in an un-interruptable sleep. =(

Having a hung netscape isn't so bad until other things start hanging
because of the locks that it still holds. =)

>How-To-Repeat:

Leave a netscape running while a hyperactive amd tries to continually
unmount and remount the filesystem that your netscape cache is on.  At
least that's what does it for me.

The timing is weird on this one, since it'll only happen if you're
trying to stat a file on a filesystem that's being unmounted in which
both the VFS_SYNC and VFS_UNMOUNT calls fail in dounmount.

>Fix:
	
Add in the missing wakeup. =)

diff -c -r1.110 vfs_syscalls.c
*** vfs_syscalls.c      1998/11/03 14:29:09     1.110
--- vfs_syscalls.c      1998/12/04 21:03:25
***************
*** 494,499 ****
--- 494,501 ----
                mp->mnt_flag |= async_flag;
                lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK | LK_REENABLE,
                    &mountlist_slock, p);
+               if (mp->mnt_kern_flag & MNTK_MWAIT)
+                         wakeup((caddr_t)mp);
                return (error);
        }
        CIRCLEQ_REMOVE(&mountlist, mp, mnt_list);


>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812042154.OAA10654>