Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ext2fs ext2fs_reload(), ext2fs_mountfs(): do devvp l...



details:   https://anonhg.NetBSD.org/src/rev/75d33245ed8e
branches:  trunk
changeset: 495124:75d33245ed8e
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Jul 22 14:49:17 2000 +0000

description:
ext2fs_reload(), ext2fs_mountfs(): do devvp locking same way as ffs
this has not shown any good or bad effect, but might help narrow
some problems people seen with ext2fs reload (hi Soren!)

diffstat:

 sys/ufs/ext2fs/ext2fs_vfsops.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r f206b307f62d -r 75d33245ed8e sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c    Sat Jul 22 08:53:33 2000 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c    Sat Jul 22 14:49:17 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vfsops.c,v 1.37 2000/06/30 20:45:38 fvdl Exp $  */
+/*     $NetBSD: ext2fs_vfsops.c,v 1.38 2000/07/22 14:49:17 jdolecek Exp $      */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -373,7 +373,10 @@
         * Step 1: invalidate all cached meta-data.
         */
        devvp = VFSTOUFS(mountp)->um_devvp;
-       if (vinvalbuf(devvp, 0, cred, p, 0, 0))
+       vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
+       error = vinvalbuf(devvp, 0, cred, p, 0, 0);
+       VOP_UNLOCK(devvp, 0);
+       if (error)
                panic("ext2fs_reload: dirty1");
        /*
         * Step 2: re-read superblock from disk.
@@ -505,7 +508,10 @@
                return (error);
        if (vcount(devvp) > 1 && devvp != rootvp)
                return (EBUSY);
-       if ((error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0)) != 0)
+       vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
+       error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0);
+       VOP_UNLOCK(devvp, 0);
+       if (error)
                return (error);
 
        ronly = (mp->mnt_flag & MNT_RDONLY) != 0;



Home | Main Index | Thread Index | Old Index