ext2fs - Clear CNP_PDIRUNLOCK flag after a lookup.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Mon, 19 Nov 2012 22:32:16 +0000 (23:32 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Mon, 19 Nov 2012 22:42:09 +0000 (23:42 +0100)
vop_compat_nresolve() unlocks the vnode when flag CNP_PDIRUNLOCK
is set, so either we clear the flag or avoid unlocking the vnode
after an ext2_lookup().

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2454

Reported by: Skylar Hawk

sys/gnu/vfs/ext2fs/ext2_lookup.c

index 0f69e3e..1dd68e1 100644 (file)
@@ -658,8 +658,10 @@ found:
        } else {
                if ((error = VFS_VGET(vdp->v_mount, NULL, dp->i_ino, &tdp)) != 0)
                        return (error);
        } else {
                if ((error = VFS_VGET(vdp->v_mount, NULL, dp->i_ino, &tdp)) != 0)
                        return (error);
-               if (!lockparent)
+               if (!lockparent) {
                        vn_unlock(pdp);
                        vn_unlock(pdp);
+                       cnp->cn_flags |= CNP_PDIRUNLOCK;
+               }
                *vpp = tdp;
        }
        return (0);
                *vpp = tdp;
        }
        return (0);