Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs In lfs_mknod, don't release dvp until done with ...



details:   https://anonhg.NetBSD.org/src/rev/a32949d83e79
branches:  trunk
changeset: 816168:a32949d83e79
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Jun 20 03:55:34 2016 +0000

description:
In lfs_mknod, don't release dvp until done with it. This was exposed a
while back when I removed a sketchy preprocessor macro scheme, but I'd
left it the way it was at the time and marked it for later. Now I
guess it's later.

Also don't randomly use both dvp and ap->a_dvp; they're the same, so
pick one and stick to it.

diffstat:

 sys/ufs/lfs/lfs_vnops.c |  18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diffs (54 lines):

diff -r 3a7ae1f8959c -r a32949d83e79 sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Mon Jun 20 03:36:09 2016 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Mon Jun 20 03:55:34 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.302 2016/06/20 03:36:09 dholland Exp $ */
+/*     $NetBSD: lfs_vnops.c,v 1.303 2016/06/20 03:55:34 dholland Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.302 2016/06/20 03:36:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.303 2016/06/20 03:55:34 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -806,22 +806,17 @@
        if (error)
                return error;
 
-       fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED);
+       fstrans_start(dvp->v_mount, FSTRANS_SHARED);
        error = lfs_makeinode(vap, dvp, ulr, vpp, ap->a_cnp);
 
        /* Either way we're done with the dirop at this point */
        UNMARK_VNODE(dvp);
        UNMARK_VNODE(*vpp);
        lfs_unset_dirop(fs, dvp, "mknod");
-       /*
-        * XXX this is where this used to be (though inside some evil
-        * macros) but it clearly should be moved further down.
-        * - dholland 20140515
-        */
-       vrele(dvp);
 
        if (error) {
-               fstrans_done(ap->a_dvp->v_mount);
+               fstrans_done(dvp->v_mount);
+               vrele(dvp);
                *vpp = NULL;
                return (error);
        }
@@ -845,7 +840,8 @@
                /* return (error); */
        }
 
-       fstrans_done(ap->a_dvp->v_mount);
+       fstrans_done(dvp->v_mount);
+       vrele(dvp);
        KASSERT(error == 0);
        VOP_UNLOCK(*vpp);
        return (0);



Home | Main Index | Thread Index | Old Index