From owner-freebsd-bugs Wed Feb 18 22:50:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA18531 for freebsd-bugs-outgoing; Wed, 18 Feb 1998 22:50:06 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA18524; Wed, 18 Feb 1998 22:50:03 -0800 (PST) (envelope-from gnats) Received: from secom-sis.co.jp (spiral.secom-sis.co.jp [202.218.246.72]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA18354 for ; Wed, 18 Feb 1998 22:47:07 -0800 (PST) (envelope-from tetsuya@secom-sis.co.jp) Received: by spiral.secom-sis.co.jp id <27791>; Thu, 19 Feb 1998 15:47:08 +0900 Message-Id: <98Feb19.154708jst.27791@spiral.secom-sis.co.jp> Date: Thu, 19 Feb 1998 15:46:28 +0900 From: tetsuya@secom-sis.co.jp Reply-To: tetsuya@secom-sis.co.jp To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/5787: Failure of unmounting asyncronous file system causes it to be non-asyncronous Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 5787 >Category: kern >Synopsis: Failure of unmounting asyncronous file system causes it to be non-asyncronous >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 18 22:50:02 PST 1998 >Last-Modified: >Originator: Tetsuya Furukawa >Organization: SECOM Information System Co.,Ltd. >Release: FreeBSD 3.0-CURRENT i386 >Environment: 3.0-CURRENT on Dec 8 1997 >Description: After unmounting a file system which has been mounted with the flag MNT_ASYNC fails for it is busy, the flag will be lost. >How-To-Repeat: # /sbin/mount /dev/sd0a on / (local) /dev/sd0s2e on /var (local) /dev/sd0s2f on /usr (local) /dev/sd0s2g on /async (asynchronous, local) procfs on /proc (local) # /sbin/umount /async umount: /async: Device busy # /sbin/mount /dev/sd0a on / (local) /dev/sd0s2e on /var (local) /dev/sd0s2f on /usr (local) /dev/sd0s2g on /async (local) procfs on /proc (local) >Fix: --- kern/vfs_syscalls.c.orig Thu Feb 19 14:56:16 1998 +++ kern/vfs_syscalls.c Thu Feb 19 14:58:59 1998 @@ -416,6 +416,7 @@ { struct vnode *coveredvp; int error; + int asyncflag; simple_lock(&mountlist_slock); mp->mnt_kern_flag |= MNTK_UNMOUNT; @@ -424,6 +425,7 @@ if (mp->mnt_flag & MNT_EXPUBLIC) vfs_setpublicfs(NULL, NULL, NULL); + asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &=~ MNT_ASYNC; vfs_msync(mp, MNT_NOWAIT); vnode_pager_umount(mp); /* release cached vnodes */ @@ -434,6 +436,8 @@ error = VFS_UNMOUNT(mp, flags, p); simple_lock(&mountlist_slock); if (error) { + if (asyncflag) + mp->mnt_flag |= MNT_ASYNC; mp->mnt_kern_flag &= ~MNTK_UNMOUNT; lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK | LK_REENABLE, &mountlist_slock, p); >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message