DragonFly bugs List (threaded) for 2007-10
DragonFly BSD
DragonFly bugs List (threaded) for 2007-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: umount/ls panic


From: "Nicolas Thery" <nthery@xxxxxxxxx>
Date: Mon, 22 Oct 2007 11:39:43 +0200

2007/10/21, Matthew Dillon <dillon@apollo.backplane.com>:
>     In our case we want the forced unmount to succeed, though personally
>     speaking Linux is probably more correct simply because when we override
>     vnodes in a forced unmount there is always the possibility of a race
>     against something.  For now though I want forced unmounts to succeed.

What about the following patch?

It fixes the assertion failure for the various cases listed in this
thread.  When running ls from an unmounted /proc, cache_resolve()
complains but I reckon this is expected:

EXDEV case 1 0xcaba70c8
EXDEV case 1 0xcaba70c8
EXDEV case 1 0xcaba70c8
ls: .: cross-device link

===================================================================
RCS file: /home/dcvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.106
diff -u -p -r1.106 vfs_subr.c
--- vfs_subr.c  31 Jul 2007 01:14:50 -0000      1.106
+++ vfs_subr.c  22 Oct 2007 09:33:59 -0000
@@ -1108,7 +1108,7 @@ vclean_vxlocked(struct vnode *vp, int fl
        }

        /*
-        * If the vnode has not be deactivated, deactivated it.  Deactivation
+        * If the vnode has not been deactivated, deactivate it.  Deactivation
         * can create new buffers and VM pages so we have to call vinvalbuf()
         * again to make sure they all get flushed.
         *
@@ -1148,6 +1148,17 @@ vclean_vxlocked(struct vnode *vp, int fl
        vp->v_ops = &dead_vnode_vops_p;
        vn_pollgone(vp);
        vp->v_tag = VT_NON;
+
+       /*
+        * If the vnode was force-closed, it is still referenced and may be
+        * vref()'ed again.  vref() calls are allowed for active vnodes only so
+        * do as if this vnode is active in the "dead vnode" fs.  When its last
+        * reference goes away, it will be inactivated and reclaimed again in
+        * this dummy fs.
+        */
+       if (active && (flags & DOCLOSE)) {
+               vp->v_flag &= ~(VINACTIVE|VRECLAIMED);
+       }
 }

 /*



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