Module Name: src
Committed By: rmind
Date: Wed May 12 03:40:38 UTC 2010
Modified Files:
src/sys/kern: kern_exec.c
Log Message:
execve1: move few PNBUF_PUT() outside the lock paths.
To generate a diff of this commit:
cvs rdiff -u -r1.296 -r1.297 src/sys/kern/kern_exec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.296 src/sys/kern/kern_exec.c:1.297
--- src/sys/kern/kern_exec.c:1.296 Sun May 2 23:22:51 2010
+++ src/sys/kern/kern_exec.c Wed May 12 03:40:38 2010
@@ -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,9 +1209,10 @@
lwp_lock(l);
l->l_flag |= oldlwpflags;
lwp_unlock(l);
- PNBUF_PUT(pathbuf);
rw_exit(&p->p_reflock);
+ PNBUF_PUT(pathbuf);
+
if (modgen != module_gen && error == ENOEXEC) {
modgen = module_gen;
exec_autoload();
@@ -1223,11 +1224,12 @@
exec_abort:
SDT_PROBE(proc,,,exec_failure, error, 0, 0, 0, 0);
- PNBUF_PUT(pathbuf);
- PNBUF_PUT(resolvedpathbuf);
rw_exit(&p->p_reflock);
rw_exit(&exec_lock);
+ PNBUF_PUT(pathbuf);
+ PNBUF_PUT(resolvedpathbuf);
+
/*
* the old process doesn't exist anymore. exit gracefully.
* get rid of the (new) address space we have created, if any, get rid