Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/filecorefs pull up rev 1.8 from trunk (requested by...



details:   https://anonhg.NetBSD.org/src/rev/9c48b0e98bb2
branches:  netbsd-1-4
changeset: 469591:9c48b0e98bb2
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Oct 18 05:05:00 1999 +0000

description:
pull up rev 1.8 from trunk (requested by wrstuden):
  In spec_close(), call the device's close routine with the vnode
  unlocked if the call might block. Force a non-blocking close if
  VXLOCK is set.  This eliminates a potential deadlock situation, and
  should eliminate the dirty buffers on reboot issue.

diffstat:

 sys/filecorefs/filecore_vfsops.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 226fcea2a7da -r 9c48b0e98bb2 sys/filecorefs/filecore_vfsops.c
--- a/sys/filecorefs/filecore_vfsops.c  Mon Oct 18 05:04:48 1999 +0000
+++ b/sys/filecorefs/filecore_vfsops.c  Mon Oct 18 05:05:00 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filecore_vfsops.c,v 1.6 1999/02/26 23:44:44 wrstuden Exp $     */
+/*     $NetBSD: filecore_vfsops.c,v 1.6.2.1 1999/10/18 05:05:00 cgd Exp $      */
 
 /*-
  * Copyright (c) 1998 Andrew McMurry
@@ -345,7 +345,9 @@
 #endif
                brelse(bp);
        }
+       vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
        (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
+       VOP_UNLOCK(devvp, 0);
        if (fcmp) {
                free((caddr_t)fcmp, M_FILECOREMNT);
                mp->mnt_data = (qaddr_t)0;
@@ -392,8 +394,9 @@
        fcmp = VFSTOFILECORE(mp);
 
        fcmp->fc_devvp->v_specflags &= ~SI_MOUNTEDON;
+       vn_lock(fcmp->fc_devvp, LK_EXCLUSIVE | LK_RETRY);
        error = VOP_CLOSE(fcmp->fc_devvp, FREAD, NOCRED, p);
-       vrele(fcmp->fc_devvp);
+       vput(fcmp->fc_devvp);
        free((caddr_t)fcmp, M_FILECOREMNT);
        mp->mnt_data = (qaddr_t)0;
        mp->mnt_flag &= ~MNT_LOCAL;



Home | Main Index | Thread Index | Old Index