Source-Changes-HG archive

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

[src/trunk]: src/sys/kern execve1: move few PNBUF_PUT() outside the lock paths.



details:   https://anonhg.NetBSD.org/src/rev/aff3ee4e3825
branches:  trunk
changeset: 754768:aff3ee4e3825
user:      rmind <rmind%NetBSD.org@localhost>
date:      Wed May 12 03:40:38 2010 +0000

description:
execve1: move few PNBUF_PUT() outside the lock paths.

diffstat:

 sys/kern/kern_exec.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r e5ccb422b06b -r aff3ee4e3825 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Wed May 12 01:58:22 2010 +0000
+++ b/sys/kern/kern_exec.c      Wed May 12 03:40:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.296 2010/05/02 23:22:51 dholland Exp $ */
+/*     $NetBSD: kern_exec.c,v 1.297 2010/05/12 03:40:38 rmind Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.296 2010/05/02 23:22:51 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.297 2010/05/12 03:40:38 rmind Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_modular.h"
@@ -1209,8 +1209,9 @@
        lwp_lock(l);
        l->l_flag |= oldlwpflags;
        lwp_unlock(l);
+       rw_exit(&p->p_reflock);
+
        PNBUF_PUT(pathbuf);
-       rw_exit(&p->p_reflock);
 
        if (modgen != module_gen && error == ENOEXEC) {
                modgen = module_gen;
@@ -1223,10 +1224,11 @@
 
  exec_abort:
        SDT_PROBE(proc,,,exec_failure, error, 0, 0, 0, 0);
+       rw_exit(&p->p_reflock);
+       rw_exit(&exec_lock);
+
        PNBUF_PUT(pathbuf);
        PNBUF_PUT(resolvedpathbuf);
-       rw_exit(&p->p_reflock);
-       rw_exit(&exec_lock);
 
        /*
         * the old process doesn't exist anymore.  exit gracefully.



Home | Main Index | Thread Index | Old Index