CVS commit: src
Module Name:src Committed By: ozaki-r Date: Wed Oct 7 05:24:41 UTC 2015 Modified Files: src/distrib/sets/lists/tests: mi src/tests/net/net: Makefile Added Files: src/tests/net/net: t_ipaddress.sh Log Message: Add tests for assigining/deleting IP addresses The tests help to find defects related to creation/deletion of routes/llentries and assigning/deleting of IP addresses. To generate a diff of this commit: cvs rdiff -u -r1.648 -r1.649 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.12 -r1.13 src/tests/net/net/Makefile cvs rdiff -u -r0 -r1.1 src/tests/net/net/t_ipaddress.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.648 src/distrib/sets/lists/tests/mi:1.649 --- src/distrib/sets/lists/tests/mi:1.648 Fri Sep 25 09:55:49 2015 +++ src/distrib/sets/lists/tests/mi Wed Oct 7 05:24:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.648 2015/09/25 09:55:49 martin Exp $ +# $NetBSD: mi,v 1.649 2015/10/07 05:24:41 ozaki-r Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3186,6 +3186,7 @@ ./usr/tests/net/net/Atffile tests-net-tests compattestfile,atf ./usr/tests/net/net/Kyuafile tests-net-tests compattestfile,atf,kyua ./usr/tests/net/net/t_forwarding tests-net-tests atf,rump +./usr/tests/net/net/t_ipaddress tests-net-tests atf,rump ./usr/tests/net/net/t_ipv6_lifetime tests-net-tests atf,rump ./usr/tests/net/net/t_pktinfo tests-net-tests compattestfile,atf ./usr/tests/net/net/t_raw tests-net-tests atf,rump Index: src/tests/net/net/Makefile diff -u src/tests/net/net/Makefile:1.12 src/tests/net/net/Makefile:1.13 --- src/tests/net/net/Makefile:1.12 Thu Aug 6 08:23:14 2015 +++ src/tests/net/net/Makefile Wed Oct 7 05:24:41 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2015/08/06 08:23:14 ozaki-r Exp $ +# $NetBSD: Makefile,v 1.13 2015/10/07 05:24:41 ozaki-r Exp $ # .include @@ -12,6 +12,7 @@ TESTS_C+= t_pktinfo .if (${MKRUMP} != "no") && !defined(BSD_MK_COMPAT_FILE) TESTS_C+= t_raw TESTS_SH= t_forwarding +TESTS_SH+= t_ipaddress TESTS_SH+= t_ipv6_lifetime .endif Added files: Index: src/tests/net/net/t_ipaddress.sh diff -u /dev/null src/tests/net/net/t_ipaddress.sh:1.1 --- /dev/null Wed Oct 7 05:24:41 2015 +++ src/tests/net/net/t_ipaddress.sh Wed Oct 7 05:24:41 2015 @@ -0,0 +1,196 @@ +# $NetBSD: t_ipaddress.sh,v 1.1 2015/10/07 05:24:41 ozaki-r Exp $ +# +# Copyright (c) 2015 Internet Initiative Japan Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +SERVER="rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif" +SERVER6="$SERVER -lrumpnet_netinet6" +SOCK_LOCAL=unix://commsock1 +BUS=bus + +DEBUG=false + +check_entry() +{ + local ip=$(echo $1 |sed 's/\./\\./g') + local word=$2 + + atf_check -s exit:0 -o match:"$word" -e ignore -x \ + "rump.netstat -rn | grep ^'$ip'" +} + +check_entry_fail() +{ + local ip=$(echo $1 |sed 's/\./\\./g') + local flags=$2 # Not used currently + + atf_check -s not-exit:0 -e ignore -x \ + "rump.netstat -rn | grep ^'$ip'" +} + +test_same_address() +{ + local ip=10.0.0.1 + local net=10.0.0/24 + local macaddr= + + atf_check -s exit:0 ${SERVER} ${SOCK_LOCAL} + export RUMP_SERVER=$SOCK_LOCAL + + atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create + atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr ${BUS} + atf_check -s exit:0 -o ignore rump.ifconfig shmif0 $ip/24 + atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up + atf_check -s exit:0 -o ignore rump.ifconfig -w 10 + + $DEBUG && rump.netstat -nr -f inet + +
CVS commit: src/external/cddl/dtracetoolkit/dist
Module Name:src Committed By: christos Date: Wed Oct 7 02:22:29 UTC 2015 Modified Files: src/external/cddl/dtracetoolkit/dist: statsnoop Log Message: make this kind of work. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/cddl/dtracetoolkit/dist/statsnoop Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/dtracetoolkit/dist/statsnoop diff -u src/external/cddl/dtracetoolkit/dist/statsnoop:1.1.1.1 src/external/cddl/dtracetoolkit/dist/statsnoop:1.2 --- src/external/cddl/dtracetoolkit/dist/statsnoop:1.1.1.1 Wed Sep 30 18:01:06 2015 +++ src/external/cddl/dtracetoolkit/dist/statsnoop Tue Oct 6 22:22:29 2015 @@ -1,9 +1,9 @@ -#!/usr/bin/sh +#!/bin/sh # # statsnoop - snoop file stats as they occur. # Written using DTrace (Solaris 10 3/05). # -# $Id: statsnoop,v 1.1.1.1 2015/09/30 22:01:06 christos Exp $ +# $Id: statsnoop,v 1.2 2015/10/07 02:22:29 christos Exp $ # # USAGE: statsnoop [-a|-A|-ceghlsvxZ] [-f pathname] [-t syscall] # [-n name] [-p PID] @@ -191,9 +191,9 @@ fi /* * Print stat event */ - syscall::stat:entry, syscall::stat64:entry, syscall::xstat:entry, - syscall::lstat:entry, syscall::lstat64:entry, syscall::lxstat:entry, - syscall::fstat:entry, syscall::fstat64:entry, syscall::fxstat:entry + syscall::stat:entry, + syscall::lstat:entry, + syscall::fstat:entry { /* default is to trace unless filtering */ self->ok = FILTER ? 0 : 1; @@ -204,45 +204,30 @@ fi (OPT_trace == 1 && TRACE == probefunc) ? self->ok = 1 : 1; } - syscall::stat:entry, syscall::stat64:entry, - syscall::lstat:entry, syscall::lstat64:entry, syscall::lxstat:entry + syscall::stat:entry, + syscall::lstat:entry /self->ok/ { self->pathp = arg0; } - syscall::xstat:entry - /self->ok/ - { - self->pathp = arg1; - } - - syscall::stat:return, syscall::stat64:return, syscall::xstat:return, - syscall::lstat:return, syscall::lstat64:return, syscall::lxstat:return + syscall::stat:return + syscall::lstat:return /self->ok/ { self->path = copyinstr(self->pathp); - self->pathp = 0; - } - - syscall::fstat:return, syscall::fstat64:entry, syscall::fxstat:entry - /self->ok/ - { - self->filep = curthread->t_procp->p_user.u_finfo.fi_list[arg0].uf_file; } - syscall::fstat:return, syscall::fstat64:return, syscall::fxstat:return + syscall::fstat:return /self->ok/ { -this->vnodep = self->filep != 0 ? self->filep->f_vnode : 0; -self->path = this->vnodep ? (this->vnodep->v_path != 0 ? -cleanpath(this->vnodep->v_path) : "") : ""; - self->filep = 0; + self->path = strjoin("fd=", lltostr(arg0)); + /* curthread->l_proc->p_fd->fd_dt->dt_ff[arg0]; */ } - syscall::stat:return, syscall::stat64:return, syscall::xstat:return, - syscall::lstat:return, syscall::lstat64:return, syscall::lxstat:return, - syscall::fstat:return, syscall::fstat64:return, syscall::fxstat:return + syscall::stat:return, + syscall::lstat:return, + syscall::fstat:return /self->ok && (! OPT_failonly || (int)arg0 < 0) && ((OPT_file == 0) || (OPT_file == 1 && PATHNAME == copyinstr(self->pathp)))/ { @@ -264,7 +249,7 @@ fi OPT_cwd ? printf("%-20s ", cwd) : 1; OPT_type ? printf("%-8s ", probefunc) : 1; OPT_dump == 0 ? printf("%-20s ", self->path) : 1; - OPT_args == 1 ? printf("%S", curpsinfo->pr_psargs) : 1; +/* OPT_args == 1 ? printf("%S", curpsinfo->pr_psargs) : 1; */ printf("\n"); /* cleanup */ @@ -275,9 +260,11 @@ fi /* * Cleanup */ - syscall::stat:return, syscall::stat64:return, syscall::xstat:return, - syscall::lstat:return, syscall::lstat64:return, syscall::lxstat:return, - syscall::fstat:return, syscall::fstat64:return, syscall::fxstat:return + syscall::stat:return, + syscall::lstat:return +/* + syscall::fstat:return +*/ /self->ok/ { self->path = 0;
CVS commit: src/share/man/man4
Module Name:src Committed By: snj Date: Wed Oct 7 00:44:25 UTC 2015 Modified Files: src/share/man/man4: malo.4 Log Message: fix formatting To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/malo.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/malo.4 diff -u src/share/man/man4/malo.4:1.6 src/share/man/man4/malo.4:1.7 --- src/share/man/man4/malo.4:1.6 Tue Aug 6 20:18:31 2013 +++ src/share/man/man4/malo.4 Wed Oct 7 00:44:25 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: malo.4,v 1.6 2013/08/06 20:18:31 wiz Exp $ +.\" $NetBSD: malo.4,v 1.7 2015/10/07 00:44:25 snj Exp $ .\" $OpenBSD: malo.4,v 1.35 2010/11/01 17:59:09 jmc Exp $ .\" .\" Copyright (c) 2006 Theo de Raadt. @@ -154,8 +154,8 @@ Join an existing BSS network, .Ed .Sh NOTES Contrary to the driver on -.Ox -, this driver currently does not work on PCMCIA/CARDBUS. +.Ox , +this driver currently does not work on PCMCIA/CARDBUS. .Sh SEE ALSO .Xr arp 4 , .Xr ifmedia 4 ,
CVS commit: src/external/cddl/osnet/lib/libdtrace
Module Name:src Committed By: christos Date: Wed Oct 7 00:35:23 UTC 2015 Modified Files: src/external/cddl/osnet/lib/libdtrace: psinfo.d Log Message: fix the remaining problem with pcinfo; the dtracetoolkit execsnoop script works. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/lib/libdtrace/psinfo.d Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libdtrace/psinfo.d diff -u src/external/cddl/osnet/lib/libdtrace/psinfo.d:1.4 src/external/cddl/osnet/lib/libdtrace/psinfo.d:1.5 --- src/external/cddl/osnet/lib/libdtrace/psinfo.d:1.4 Tue Oct 6 18:12:09 2015 +++ src/external/cddl/osnet/lib/libdtrace/psinfo.d Tue Oct 6 20:35:23 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: psinfo.d,v 1.4 2015/10/06 22:12:09 christos Exp $ */ +/* $NetBSD: psinfo.d,v 1.5 2015/10/07 00:35:23 christos Exp $ */ /* * CDDL HEADER START @@ -87,13 +87,10 @@ translator lwpsinfo_t < struct lwp *T > pr_wchan = (uintptr_t)T->l_wchan; }; -/* XXX: does not work with multprocessor, since it needs curcpu() */ -/* -inline psinfo_t *curpsinfo = xlate (curlwp->l_proc); +inline psinfo_t *curpsinfo = xlate (curthread->l_proc); #pragma D attributes Stable/Stable/Common curpsinfo #pragma D binding "1.0" curpsinfo -inline lwpsinfo_t *curlwpsinfo = xlate (curlwp); +inline lwpsinfo_t *curlwpsinfo = xlate (curthread); #pragma D attributes Stable/Stable/Common curlwpsinfo #pragma D binding "1.0" curlwpsinfo -*/
CVS commit: src/external/cddl/osnet/dist/lib/libdtrace/common
Module Name:src Committed By: christos Date: Wed Oct 7 00:34:37 UTC 2015 Modified Files: src/external/cddl/osnet/dist/lib/libdtrace/common: dt_open.c Log Message: Adjust for NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 \ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.7 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.8 --- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.7 Mon Oct 5 13:47:37 2015 +++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c Tue Oct 6 20:34:37 2015 @@ -1309,9 +1309,23 @@ alloc: char *p; size_t len = sizeof(bootfile); +#ifdef __FreeBSD__ +#define DEFKERNEL "kernel" +#define BOOTFILE "kern.bootfile" +#define THREAD "struct thread" +#define MUTEX "struct mtx" +#define RWLOCK "struct rwlock" +#endif +#ifdef __NetBSD__ +#define DEFKERNEL "netbsd" +#define BOOTFILE "machdep.booted_kernel" +#define THREAD "struct lwp" +#define MUTEX "struct kmutex" +#define RWLOCK "struct krwlock" +#endif /* This call shouldn't fail, but use a default just in case. */ - if (sysctlbyname("kern.bootfile", bootfile, &len, NULL, 0) != 0) - strlcpy(bootfile, "kernel", sizeof(bootfile)); + if (sysctlbyname(BOOTFILE, bootfile, &len, NULL, 0) != 0) + strlcpy(bootfile, DEFKERNEL, sizeof(bootfile)); if ((p = strrchr(bootfile, '/')) != NULL) p++; @@ -1321,10 +1335,11 @@ alloc: /* * Format the global variables based on the kernel module name. */ - snprintf(curthread_str, sizeof(curthread_str), "%s`struct thread *",p); - snprintf(intmtx_str, sizeof(intmtx_str), "int(%s`struct mtx *)",p); - snprintf(threadmtx_str, sizeof(threadmtx_str), "struct thread *(%s`struct mtx *)",p); - snprintf(rwlock_str, sizeof(rwlock_str), "int(%s`struct rwlock *)",p); + snprintf(curthread_str, sizeof(curthread_str), "%s`%s *", p, THREAD); + snprintf(intmtx_str, sizeof(intmtx_str), "int(%s`%s *)", p, MUTEX); + snprintf(threadmtx_str, sizeof(threadmtx_str), "%s *(%s`%s *)", + THREAD, p, MUTEX); + snprintf(rwlock_str, sizeof(rwlock_str), "int(%s`%s *)", p, RWLOCK); snprintf(sxlock_str, sizeof(sxlock_str), "int(%s`struct sxlock *)",p); } #endif
CVS commit: src/sys/netinet
Module Name:src Committed By: ozaki-r Date: Wed Oct 7 00:33:28 UTC 2015 Modified Files: src/sys/netinet: if_arp.c Log Message: Create an llentry after fixing an interface to store In case of RTF_LOCAL routes, we change an output interface of a route from original one to lo0ifp. An llentry also has to be stored to lo0ifp in such cases. Problem reported by roy@ To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/netinet/if_arp.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/netinet/if_arp.c diff -u src/sys/netinet/if_arp.c:1.182 src/sys/netinet/if_arp.c:1.183 --- src/sys/netinet/if_arp.c:1.182 Mon Oct 5 08:17:31 2015 +++ src/sys/netinet/if_arp.c Wed Oct 7 00:33:27 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_arp.c,v 1.182 2015/10/05 08:17:31 ozaki-r Exp $ */ +/* $NetBSD: if_arp.c,v 1.183 2015/10/07 00:33:27 ozaki-r Exp $ */ /*- * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.182 2015/10/05 08:17:31 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.183 2015/10/07 00:33:27 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -576,43 +576,6 @@ arp_rtrequest(int req, struct rtentry *r if (rt->rt_flags & RTF_BROADCAST) break; - /* - * Case 2: This route may come from cloning, or a manual route - * add with a LL address. - */ - flags = LLE_EXCLUSIVE; - if ((rt->rt_flags & RTF_CLONED) == 0) - flags |= LLE_IFADDR; - - IF_AFDATA_WLOCK(ifp); - la = lla_create(LLTABLE(ifp), flags, rt_getkey(rt)); - IF_AFDATA_WUNLOCK(ifp); - - if (la == NULL) { - log(LOG_DEBUG, "%s: lla_create failed\n", - __func__); - rt->rt_llinfo = NULL; - break; - } - rt->rt_llinfo = la; - switch (ifp->if_type) { -#if NTOKEN > 0 - case IFT_ISO88025: - la->la_opaque = kmem_alloc(sizeof(struct token_rif), - KM_SLEEP); - break; -#endif /* NTOKEN > 0 */ - default: - break; - } - la->la_rt = rt; - rt->rt_refcnt++; - rt->rt_flags |= RTF_LLINFO; - arp_inuse++, arp_allocated++; - - LLE_WUNLOCK(la); - la = NULL; - INADDR_TO_IA(satocsin(rt_getkey(rt))->sin_addr, ia); while (ia && ia->ia_ifp != ifp) NEXT_IA_WITH_SAME_ADDR(ia); @@ -655,6 +618,44 @@ arp_rtrequest(int req, struct rtentry *r if (ifa != rt->rt_ifa) rt_replace_ifa(rt, ifa); } + + /* + * Case 2: This route may come from cloning, or a manual route + * add with a LL address. + */ + flags = LLE_EXCLUSIVE; + if ((rt->rt_flags & RTF_CLONED) == 0) + flags |= LLE_IFADDR; + + IF_AFDATA_WLOCK(ifp); + la = lla_create(LLTABLE(ifp), flags, rt_getkey(rt)); + IF_AFDATA_WUNLOCK(ifp); + + if (la == NULL) { + log(LOG_DEBUG, "%s: lla_create failed\n", + __func__); + rt->rt_llinfo = NULL; + break; + } + rt->rt_llinfo = la; + switch (ifp->if_type) { +#if NTOKEN > 0 + case IFT_ISO88025: + la->la_opaque = kmem_alloc(sizeof(struct token_rif), + KM_SLEEP); + break; +#endif /* NTOKEN > 0 */ + default: + break; + } + la->la_rt = rt; + rt->rt_refcnt++; + rt->rt_flags |= RTF_LLINFO; + arp_inuse++, arp_allocated++; + + LLE_WUNLOCK(la); + la = NULL; + break; case RTM_DELETE:
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Wed Oct 7 00:32:34 UTC 2015 Modified Files: src/sys/kern: kern_runq.c Log Message: provide curthread for dtrace To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/kern/kern_runq.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_runq.c diff -u src/sys/kern/kern_runq.c:1.43 src/sys/kern/kern_runq.c:1.44 --- src/sys/kern/kern_runq.c:1.43 Sun Aug 3 15:14:24 2014 +++ src/sys/kern/kern_runq.c Tue Oct 6 20:32:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_runq.c,v 1.43 2014/08/03 19:14:24 wiz Exp $ */ +/* $NetBSD: kern_runq.c,v 1.44 2015/10/07 00:32:34 christos Exp $ */ /* * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius @@ -27,7 +27,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.43 2014/08/03 19:14:24 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.44 2015/10/07 00:32:34 christos Exp $"); + +#include "opt_dtrace.h" #include #include @@ -121,6 +123,10 @@ static struct cpu_info *worker_ci; /* Vi static struct callout balance_ch; /* Callout of balancer */ #endif +#ifdef KDTRACE_HOOKS +struct lwp *curthread; +#endif + void runq_init(void) { @@ -712,6 +718,9 @@ sched_lwp_stats(struct lwp *l) /* Scheduler-specific hook */ sched_pstats_hook(l, batch); +#ifdef KDTRACE_HOOKS + curthread = l; +#endif } /*
CVS commit: src/sys
Module Name:src Committed By: christos Date: Tue Oct 6 22:13:39 UTC 2015 Modified Files: src/sys/conf: debugsyms.c src/sys/kern: kern_auth.c src/sys/sys: kauth.h Log Message: Expose struct kauth_cred for the benefit of the debugger. I can't convince gcc to produce debug info for the structure if it does not appear in more than one source file. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/conf/debugsyms.c cvs rdiff -u -r1.74 -r1.75 src/sys/kern/kern_auth.c cvs rdiff -u -r1.72 -r1.73 src/sys/sys/kauth.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/debugsyms.c diff -u src/sys/conf/debugsyms.c:1.3 src/sys/conf/debugsyms.c:1.4 --- src/sys/conf/debugsyms.c:1.3 Sun Nov 22 21:13:45 2009 +++ src/sys/conf/debugsyms.c Tue Oct 6 18:13:39 2015 @@ -1,13 +1,14 @@ -/* $NetBSD: debugsyms.c,v 1.3 2009/11/23 02:13:45 rmind Exp $ */ +/* $NetBSD: debugsyms.c,v 1.4 2015/10/06 22:13:39 christos Exp $ */ /* * This file is in the public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: debugsyms.c,v 1.3 2009/11/23 02:13:45 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: debugsyms.c,v 1.4 2015/10/06 22:13:39 christos Exp $"); #define _CALLOUT_PRIVATE #define __MUTEX_PRIVATE +#define __KAUTH_PRIVATE #include #include @@ -22,6 +23,8 @@ __KERNEL_RCSID(0, "$NetBSD: debugsyms.c, #include #include #include +#include +#include /* * Without a dummy function referencing some of the types, gcc will @@ -32,6 +35,7 @@ proc_t *_debugsym_dummyfunc(vnode_t *vp) proc_t * _debugsym_dummyfunc(vnode_t *vp) { + struct kauth_cred *cr = (kauth_cred_t)vp; - return ((lwp_t *)vp->v_mount)->l_proc; + return cr->cr_uid ? ((lwp_t *)vp->v_mount)->l_proc : NULL; } Index: src/sys/kern/kern_auth.c diff -u src/sys/kern/kern_auth.c:1.74 src/sys/kern/kern_auth.c:1.75 --- src/sys/kern/kern_auth.c:1.74 Sat Aug 8 03:53:51 2015 +++ src/sys/kern/kern_auth.c Tue Oct 6 18:13:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_auth.c,v 1.74 2015/08/08 07:53:51 mlelstv Exp $ */ +/* $NetBSD: kern_auth.c,v 1.75 2015/10/06 22:13:39 christos Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_auth.c,v 1.74 2015/08/08 07:53:51 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_auth.c,v 1.75 2015/10/06 22:13:39 christos Exp $"); #include #include @@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_auth.c, #include #include #include +#define __KAUTH_PRIVATE #include #include #include @@ -54,35 +55,6 @@ struct kauth_key { specificdata_key_t ks_key; /* key */ }; -/* - * Credentials. - * - * A subset of this structure is used in kvm(3) (src/lib/libkvm/kvm_proc.c) - * and should be synchronized with this structure when the update is - * relevant. - */ -struct kauth_cred { - /* - * Ensure that the first part of the credential resides in its own - * cache line. Due to sharing there aren't many kauth_creds in a - * typical system, but the reference counts change very often. - * Keeping it separate from the rest of the data prevents false - * sharing between CPUs. - */ - u_int cr_refcnt; /* reference count */ -#if COHERENCY_UNIT > 4 - uint8_t cr_pad[COHERENCY_UNIT - 4]; -#endif - uid_t cr_uid; /* user id */ - uid_t cr_euid; /* effective user id */ - uid_t cr_svuid; /* saved effective user id */ - gid_t cr_gid; /* group id */ - gid_t cr_egid; /* effective group id */ - gid_t cr_svgid; /* saved effective group id */ - u_int cr_ngroups; /* number of groups */ - gid_t cr_groups[NGROUPS]; /* group memberships */ - specificdata_reference cr_sd; /* specific data */ -}; /* * Listener. Index: src/sys/sys/kauth.h diff -u src/sys/sys/kauth.h:1.72 src/sys/sys/kauth.h:1.73 --- src/sys/sys/kauth.h:1.72 Mon Aug 17 02:16:03 2015 +++ src/sys/sys/kauth.h Tue Oct 6 18:13:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kauth.h,v 1.72 2015/08/17 06:16:03 knakahara Exp $ */ +/* $NetBSD: kauth.h,v 1.73 2015/10/06 22:13:39 christos Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat @@ -54,6 +54,38 @@ typedef int (*kauth_scope_callback_t)(ka void *, void *, void *, void *, void *); typedef struct kauth_key *kauth_key_t; +#ifdef __KAUTH_PRIVATE /* For the debugger */ +/* + * Credentials. + * + * A subset of this structure is used in kvm(3) (src/lib/libkvm/kvm_proc.c) + * and should be synchronized with this structure when the update is + * relevant. + */ +struct kauth_cred { + /* + * Ensure that the first part of the credential resides in its own + * cache line. Due to sharing there aren't many kauth_creds in a + * typical system, but the reference counts change very often. + * Keeping it separate from the rest of the data prevents false + * sharing between CPUs. + */ + u_int cr_refcnt; /* reference count */ +#if COHERENCY_UNIT > 4 + uint8_t cr_pad[COHERENCY_UNIT - 4];
CVS commit: src/external/cddl/osnet/lib/libdtrace
Module Name:src Committed By: christos Date: Tue Oct 6 22:12:09 UTC 2015 Modified Files: src/external/cddl/osnet/lib/libdtrace: psinfo.d Log Message: almost fixed... Need to figure out what to do with curlwp. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libdtrace/psinfo.d Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libdtrace/psinfo.d diff -u src/external/cddl/osnet/lib/libdtrace/psinfo.d:1.3 src/external/cddl/osnet/lib/libdtrace/psinfo.d:1.4 --- src/external/cddl/osnet/lib/libdtrace/psinfo.d:1.3 Mon Oct 5 13:49:40 2015 +++ src/external/cddl/osnet/lib/libdtrace/psinfo.d Tue Oct 6 18:12:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: psinfo.d,v 1.3 2015/10/05 17:49:40 christos Exp $ */ +/* $NetBSD: psinfo.d,v 1.4 2015/10/06 22:12:09 christos Exp $ */ /* * CDDL HEADER START @@ -53,15 +53,13 @@ translator psinfo_t < struct proc *T > { pr_ppid = (T->p_pptr == 0) ? 0 : T->p_pptr->p_pid; pr_pgid = (T->p_pgrp->pg_session->s_leader == 0) ? 0 : T->p_pgrp->pg_session->s_leader->p_pid; pr_sid = (T->p_pgrp == 0) ? 0 : ((T->p_pgrp->pg_session == 0) ? 0 : T->p_pgrp->pg_session->s_sid); -/* XXX: struct kauth_cred is not public - pr_uid = T->p_cred->cr_ruid; - pr_euid = T->p_cred->cr_uid; - pr_gid = T->p_cred->cr_rgid; - pr_egid = T->p_cred->cr_groups[0]; - */ + pr_uid = T->p_cred->cr_uid; + pr_euid = T->p_cred->cr_euid; + pr_gid = T->p_cred->cr_gid; + pr_egid = T->p_cred->cr_egid; pr_addr = 0; - pr_psargs = stringof(T->p_args->ar_args); - pr_arglen = T->p_args->ar_length; + pr_psargs = stringof(T->p_comm); + pr_arglen = strlen(T->p_comm); }; typedef struct lwpsinfo { @@ -78,22 +76,24 @@ typedef struct lwpsinfo { } lwpsinfo_t; #pragma D binding "1.0" translator -translator lwpsinfo_t < struct thread *T > { - pr_lwpid = T->td_tid; - pr_pri = T->td_priority; - pr_flag = T->td_flags; - pr_state = 0; /* XXX */ - pr_sname = '?'; /* XXX */ +translator lwpsinfo_t < struct lwp *T > { + pr_lwpid = T->l_lid; + pr_pri = T->l_priority; + pr_flag = T->l_flag; + pr_state = T->l_stat; + pr_sname = '?'; /* XXX */ pr_syscall = 0; /* XXX */ pr_addr = (uintptr_t)T; - pr_wchan = (uintptr_t)T->td_wchan; + pr_wchan = (uintptr_t)T->l_wchan; }; -inline psinfo_t *curpsinfo = xlate (curthread->td_proc); +/* XXX: does not work with multprocessor, since it needs curcpu() */ +/* +inline psinfo_t *curpsinfo = xlate (curlwp->l_proc); #pragma D attributes Stable/Stable/Common curpsinfo #pragma D binding "1.0" curpsinfo -inline lwpsinfo_t *curlwpsinfo = xlate (curthread); +inline lwpsinfo_t *curlwpsinfo = xlate (curlwp); #pragma D attributes Stable/Stable/Common curlwpsinfo #pragma D binding "1.0" curlwpsinfo - +*/
CVS commit: src/sys/arch/sparc/include
Module Name:src Committed By: martin Date: Tue Oct 6 20:03:06 UTC 2015 Modified Files: src/sys/arch/sparc/include: frame.h openfirm.h types.h Log Message: Do not use #ifdef SUN4U when testing for cpu features of post-v8 CPUs, it is not good for SUN4V-only kernels. Instead use __sparc_v9__ (which is also defined by the sparc compiler when called with cpu=ultrasparc). ok: mrg@ To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc/include/frame.h \ src/sys/arch/sparc/include/openfirm.h cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc/include/frame.h diff -u src/sys/arch/sparc/include/frame.h:1.8 src/sys/arch/sparc/include/frame.h:1.9 --- src/sys/arch/sparc/include/frame.h:1.8 Tue Apr 12 07:54:16 2011 +++ src/sys/arch/sparc/include/frame.h Tue Oct 6 20:03:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: frame.h,v 1.8 2011/04/12 07:54:16 mrg Exp $ */ +/* $NetBSD: frame.h,v 1.9 2015/10/06 20:03:05 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -56,7 +56,7 @@ * windows to the stack. */ #ifndef _LOCORE -#ifndef SUN4U +#ifndef __sparc_v9__ struct frame { int32_t fr_local[8]; /* space to save locals (%l0..%l7) */ int32_t fr_arg[6]; /* space to save arguments (%i0..%i5) */ Index: src/sys/arch/sparc/include/openfirm.h diff -u src/sys/arch/sparc/include/openfirm.h:1.8 src/sys/arch/sparc/include/openfirm.h:1.9 --- src/sys/arch/sparc/include/openfirm.h:1.8 Fri Mar 27 06:10:25 2015 +++ src/sys/arch/sparc/include/openfirm.h Tue Oct 6 20:03:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.h,v 1.8 2015/03/27 06:10:25 nakayama Exp $ */ +/* $NetBSD: openfirm.h,v 1.9 2015/10/06 20:03:05 martin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -39,7 +39,7 @@ #include -#ifdef SUN4U +#ifdef __sparc_v9__ /* All cells are 8 byte slots */ typedef uint64_t cell_t; #ifdef __arch64__ @@ -52,14 +52,14 @@ typedef uint64_t cell_t; #define HDQ2CELL_HI(x) (cell_t)(0) #define HDQ2CELL_LO(x) (cell_t)(x) #define CELL2HDQ(hi,lo) (lo) -#else /* SUN4U */ +#else /* __sparc_v9__ */ /* All cells are 4 byte slots */ typedef uint32_t cell_t; #define HDL2CELL(x) (cell_t)(x) #define ADR2CELL(x) (cell_t)(x) #define HDQ2CELL_HI(x) (cell_t)((x) >> 32) #define HDQ2CELL_LO(x) (cell_t)(x) -#endif /* SUN4U */ +#endif /* __sparc_v9__ */ int OF_test(const char *); int OF_test_method(int, const char *); Index: src/sys/arch/sparc/include/types.h diff -u src/sys/arch/sparc/include/types.h:1.63 src/sys/arch/sparc/include/types.h:1.64 --- src/sys/arch/sparc/include/types.h:1.63 Thu Aug 27 12:30:51 2015 +++ src/sys/arch/sparc/include/types.h Tue Oct 6 20:03:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.63 2015/08/27 12:30:51 pooka Exp $ */ +/* $NetBSD: types.h,v 1.64 2015/10/06 20:03:05 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -73,7 +73,7 @@ typedef unsigned long long int register6 #if defined(_KERNEL) typedef struct label_t { -#ifdef SUN4U +#ifdef __sparc_v9__ register64_t val[2]; #else register_t val[3]; @@ -87,7 +87,7 @@ typedef vaddr_t vsize_t; #define PRIxVADDR "lx" #define PRIxVSIZE "lx" #define PRIuVSIZE "lu" -#ifdef SUN4U +#ifdef __sparc_v9__ #ifdef __arch64__ typedef unsigned long int paddr_t; #define PRIxPADDR "lx" @@ -102,7 +102,7 @@ typedef unsigned long long int paddr_t; typedef unsigned long int paddr_t; #define PRIxPADDR "lx" #define PRIuPSIZE "lu" -#endif /* SUN4U */ +#endif /* __sparc_v9__ */ typedef paddr_t psize_t; #define PRIxPSIZE PRIxPADDR #endif @@ -124,7 +124,7 @@ typedef unsigned char __cpu_simple_lock #define __HAVE_CPU_VMSPACE_EXEC #define __HAVE_RAS -#ifdef SUN4U +#ifdef __sparc_v9__ #define __HAVE_DEVICE_REGISTER_POSTCONFIG #define __HAVE_ATOMIC64_OPS #define __HAVE_CPU_COUNTER /* sparc v9 CPUs have %tick */
CVS commit: src/usr.bin/make
Module Name:src Committed By: christos Date: Tue Oct 6 17:36:25 UTC 2015 Modified Files: src/usr.bin/make: var.c Log Message: don't check for NULL before free() (Tilman Sauerbeck) To generate a diff of this commit: cvs rdiff -u -r1.195 -r1.196 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.195 src/usr.bin/make/var.c:1.196 --- src/usr.bin/make/var.c:1.195 Fri Jun 19 10:25:16 2015 +++ src/usr.bin/make/var.c Tue Oct 6 13:36:25 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.195 2015/06/19 14:25:16 christos Exp $ */ +/* $NetBSD: var.c,v 1.196 2015/10/06 17:36:25 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.195 2015/06/19 14:25:16 christos Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.196 2015/10/06 17:36:25 christos Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.195 2015/06/19 14:25:16 christos Exp $"); +__RCSID("$NetBSD: var.c,v 1.196 2015/10/06 17:36:25 christos Exp $"); #endif #endif /* not lint */ #endif @@ -982,8 +982,7 @@ Var_Set(const char *name, const char *va } out: -if (expanded_name != NULL) - free(expanded_name); +free(expanded_name); if (v != NULL) VarFreeEnv(v, TRUE); } @@ -1061,8 +1060,7 @@ Var_Append(const char *name, const char Hash_SetValue(h, v); } } -if (expanded_name != NULL) - free(expanded_name); +free(expanded_name); } /*- @@ -1092,9 +1090,7 @@ Var_Exists(const char *name, GNode *ctxt cp = Var_Subst(NULL, name, ctxt, FALSE); } v = VarFind(cp ? cp : name, ctxt, FIND_CMD|FIND_GLOBAL|FIND_ENV); -if (cp != NULL) { - free(cp); -} +free(cp); if (v == NULL) { return(FALSE); } else { @@ -2192,8 +2188,7 @@ VarGetPattern(GNode *ctxt, Var_Parse_Sta */ cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt); Buf_AddBytes(&buf, strlen(cp2), cp2); - if (freeIt) - free(freeIt); + free(freeIt); cp += len - 1; } else { const char *cp2 = &cp[1]; @@ -2505,8 +2500,7 @@ ApplyModifiers(char *nstr, const char *t (c = tstr[rlen]) != '\0' && c != ':' && c != endc) { - if (freeIt) - free(freeIt); + free(freeIt); goto apply_mods; } @@ -2526,13 +2520,11 @@ ApplyModifiers(char *nstr, const char *t if (nstr == var_Error || (nstr == varNoError && errnum == 0) || strlen(rval) != (size_t) used) { - if (freeIt) - free(freeIt); + free(freeIt); goto out; /* error already reported */ } } - if (freeIt) - free(freeIt); + free(freeIt); if (*tstr == ':') tstr++; else if (!*tstr && endc) { @@ -2621,8 +2613,7 @@ ApplyModifiers(char *nstr, const char *t Error(emsg, nstr); else Var_Set(v->name, newStr, v_ctxt, 0); - if (newStr) - free(newStr); + free(newStr); break; case '?': if ((v->flags & VAR_JUNK) == 0) @@ -2704,8 +2695,7 @@ ApplyModifiers(char *nstr, const char *t cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt); Buf_AddBytes(&buf, strlen(cp2), cp2); - if (freeIt) -free(freeIt); + free(freeIt); cp += len - 1; } else { Buf_AddByte(&buf, *cp); @@ -3543,10 +3533,8 @@ ApplyModifiers(char *nstr, const char *t if (delim != '\0') Error("Unclosed substitution for %s (%c missing)", v->name, delim); -if (*freePtr) { - free(*freePtr); - *freePtr = NULL; -} +free(*freePtr); +*freePtr = NULL; return (var_Error); } @@ -3689,8 +3677,7 @@ Var_Parse(const char *str, GNode *ctxt, if (rval != NULL) { Buf_AddBytes(&buf, strlen(rval), rval); } - if (freeIt) - free(freeIt); + free(freeIt); tstr += rlen - 1; } else @@ -3856,9 +3843,7 @@ Var_Parse(const char *str, GNode *ctxt, nstr = ApplyModifiers(nstr, tstr, startc, endc, v, ctxt, errnum, &used, freePtr); tstr += used; - if (extraFree) { - free(extraFree); - } + free(extraFree); } else { *freePtr = extraFree; } @@ -4075,10 +4060,8 @@ Var_Subst(const char *var, const char *s Buf_AddBytes(&buf, length, val); trailingBslash = length > 0 && val[length - 1] == '\\'; } - if (freeIt) { - free(freeIt); - freeIt = NULL; - } + free(freeIt); + freeIt = NULL; } }
CVS commit: src/sys/arch/sparc64
Module Name:src Committed By: martin Date: Tue Oct 6 16:40:37 UTC 2015 Modified Files: src/sys/arch/sparc64/conf: files.sparc64 src/sys/arch/sparc64/dev: auxio.c auxiovar.h Added Files: src/sys/arch/sparc64/dev: auxio_ebus.c auxio_sbus.c Log Message: Split auxio at ebus and auxio at sbus properly, so we can build kernels without sbus support. To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/arch/sparc64/conf/files.sparc64 cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc64/dev/auxio.c cvs rdiff -u -r0 -r1.6 src/sys/arch/sparc64/dev/auxio_ebus.c cvs rdiff -u -r0 -r1.1 src/sys/arch/sparc64/dev/auxio_sbus.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc64/dev/auxiovar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/conf/files.sparc64 diff -u src/sys/arch/sparc64/conf/files.sparc64:1.148 src/sys/arch/sparc64/conf/files.sparc64:1.149 --- src/sys/arch/sparc64/conf/files.sparc64:1.148 Sun Feb 15 01:43:11 2015 +++ src/sys/arch/sparc64/conf/files.sparc64 Tue Oct 6 16:40:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: files.sparc64,v 1.148 2015/02/15 01:43:11 nakayama Exp $ +# $NetBSD: files.sparc64,v 1.149 2015/10/06 16:40:36 martin Exp $ # @(#)files.sparc64 8.1 (Berkeley) 7/19/93 # sparc64-specific configuration info @@ -114,6 +114,8 @@ device auxio attach auxio at ebus with auxio_ebus attach auxio at sbus with auxio_sbus file arch/sparc64/dev/auxio.c auxio +file arch/sparc64/dev/auxio_sbus.c auxio_sbus +file arch/sparc64/dev/auxio_ebus.c auxio_ebus defflag opt_auxio.h BLINK Index: src/sys/arch/sparc64/dev/auxio.c diff -u src/sys/arch/sparc64/dev/auxio.c:1.24 src/sys/arch/sparc64/dev/auxio.c:1.25 --- src/sys/arch/sparc64/dev/auxio.c:1.24 Mon Aug 24 23:32:07 2015 +++ src/sys/arch/sparc64/dev/auxio.c Tue Oct 6 16:40:36 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: auxio.c,v 1.24 2015/08/24 23:32:07 mrg Exp $ */ +/* $NetBSD: auxio.c,v 1.25 2015/10/06 16:40:36 martin Exp $ */ /* * Copyright (c) 2000, 2001, 2015 Matthew R. Green @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: auxio.c,v 1.24 2015/08/24 23:32:07 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: auxio.c,v 1.25 2015/10/06 16:40:36 martin Exp $"); #include "opt_auxio.h" @@ -53,48 +53,9 @@ __KERNEL_RCSID(0, "$NetBSD: auxio.c,v 1. #include #include -/* - * on sun4u, auxio exists with one register (LED) on the sbus, and 5 - * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI - * OSCILLATOR, and TEMP SENSE. - */ - -struct auxio_softc { - device_t sc_dev; - - kmutex_t sc_lock; - - /* parent's tag */ - bus_space_tag_t sc_tag; - - /* handles to the various auxio register sets */ - bus_space_handle_t sc_led; - bus_space_handle_t sc_pci; - bus_space_handle_t sc_freq; - bus_space_handle_t sc_scsi; - bus_space_handle_t sc_temp; - - int sc_flags; -#define AUXIO_LEDONLY 0x1 // only sc_led is valid -#define AUXIO_EBUS 0x2 -}; - -#define AUXIO_ROM_NAME "auxio" - - static uint32_t auxio_read_led(struct auxio_softc *); static void auxio_write_led(struct auxio_softc *, uint32_t); -static void auxio_attach_common(struct auxio_softc *); -static int auxio_ebus_match(device_t, cfdata_t, void *); -static void auxio_ebus_attach(device_t, device_t, void *); -static int auxio_sbus_match(device_t, cfdata_t, void *); -static void auxio_sbus_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(auxio_ebus, sizeof(struct auxio_softc), -auxio_ebus_match, auxio_ebus_attach, NULL, NULL); - -CFATTACH_DECL_NEW(auxio_sbus, sizeof(struct auxio_softc), -auxio_sbus_match, auxio_sbus_attach, NULL, NULL); +void auxio_attach_common(struct auxio_softc *); extern struct cfdriver auxio_cd; @@ -156,7 +117,7 @@ auxio_blink(void *x) } #endif -static void +void auxio_attach_common(struct auxio_softc *sc) { #ifdef BLINK @@ -173,105 +134,6 @@ auxio_attach_common(struct auxio_softc * printf("\n"); } -static int -auxio_ebus_match(device_t parent, cfdata_t cf, void *aux) -{ - struct ebus_attach_args *ea = aux; - - return (strcmp(AUXIO_ROM_NAME, ea->ea_name) == 0); -} - -static void -auxio_ebus_attach(device_t parent, device_t self, void *aux) -{ - struct auxio_softc *sc = device_private(self); - struct ebus_attach_args *ea = aux; - - sc->sc_dev = self; - sc->sc_tag = ea->ea_bustag; - - if (ea->ea_nreg < 1) { - printf(": no registers??\n"); - return; - } - - sc->sc_flags = AUXIO_EBUS; - if (ea->ea_nreg != 5) { - printf(": not 5 (%d) registers, only setting led", - ea->ea_nreg); - sc->sc_flags |= AUXIO_LEDONLY; - } else if (ea->ea_nvaddr == 5) { - sparc_promaddr_to_handle(sc->sc_tag, - ea->ea_vaddr[1], &sc->sc_pci); - sparc_promaddr_to_handle(sc->sc_tag, - ea->ea_vaddr[2], &sc->sc_freq); - sparc_promaddr_to_handle(sc->sc_tag, - ea->ea_vaddr[3], &sc->sc_scsi); - sparc_promaddr_to_handle(sc->sc_tag, - ea->ea_vaddr[4], &sc->sc_temp); - } else { - bus_spa
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Tue Oct 6 15:03:34 UTC 2015 Modified Files: src/sys/kern: kern_time.c Log Message: CID/1325753: remove extra return. To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/sys/kern/kern_time.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_time.c diff -u src/sys/kern/kern_time.c:1.181 src/sys/kern/kern_time.c:1.182 --- src/sys/kern/kern_time.c:1.181 Fri Oct 2 15:47:08 2015 +++ src/sys/kern/kern_time.c Tue Oct 6 11:03:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_time.c,v 1.181 2015/10/02 19:47:08 christos Exp $ */ +/* $NetBSD: kern_time.c,v 1.182 2015/10/06 15:03:34 christos Exp $ */ /*- * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.181 2015/10/02 19:47:08 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.182 2015/10/06 15:03:34 christos Exp $"); #include #include @@ -316,7 +316,6 @@ sys_clock_nanosleep(struct lwp *l, const SCARG(uap, rmtp) ? &rmt : NULL); if (SCARG(uap, rmtp) == NULL || (error != 0 && error != EINTR)) goto out; - return error; if ((error1 = copyout(&rmt, SCARG(uap, rmtp), sizeof(rmt))) != 0) error = error1;
CVS commit: src/sys/arch/x86/acpi
Module Name:src Committed By: christos Date: Tue Oct 6 15:06:05 UTC 2015 Modified Files: src/sys/arch/x86/acpi: acpi_machdep.c Log Message: CID/1325751: Avoid possible 32 bit overflow. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/acpi/acpi_machdep.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/arch/x86/acpi/acpi_machdep.c diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.9 src/sys/arch/x86/acpi/acpi_machdep.c:1.10 --- src/sys/arch/x86/acpi/acpi_machdep.c:1.9 Fri Oct 2 01:22:52 2015 +++ src/sys/arch/x86/acpi/acpi_machdep.c Tue Oct 6 11:06:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_machdep.c,v 1.9 2015/10/02 05:22:52 msaitoh Exp $ */ +/* $NetBSD: acpi_machdep.c,v 1.10 2015/10/06 15:06:05 christos Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.9 2015/10/02 05:22:52 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2015/10/06 15:06:05 christos Exp $"); #include #include @@ -352,7 +352,8 @@ acpi_md_mcfg_validate(uint64_t addr, int if (bim == NULL) return false; - size = (*bus_end - bus_start + 1) * ACPIMCFG_SIZE_PER_BUS; + size = *bus_end - bus_start + 1; + size *= ACPIMCFG_SIZE_PER_BUS; for (i = 0; i < bim->num; i++) { mapaddr = bim->entry[i].addr; mapsize = bim->entry[i].size;
CVS commit: src/sys/dev/sdmmc
Module Name:src Committed By: mlelstv Date: Tue Oct 6 14:32:51 UTC 2015 Modified Files: src/sys/dev/sdmmc: sdhc.c sdmmc_io.c sdmmc_mem.c sdmmcvar.h Log Message: support hiding command timeout messages with a new command flag and use this when probing for cards. Should fix PR 50302. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/dev/sdmmc/sdhc.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/sdmmc/sdmmc_io.c cvs rdiff -u -r1.46 -r1.47 src/sys/dev/sdmmc/sdmmc_mem.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/sdmmc/sdmmcvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/sdmmc/sdhc.c diff -u src/sys/dev/sdmmc/sdhc.c:1.87 src/sys/dev/sdmmc/sdhc.c:1.88 --- src/sys/dev/sdmmc/sdhc.c:1.87 Wed Sep 9 08:09:28 2015 +++ src/sys/dev/sdmmc/sdhc.c Tue Oct 6 14:32:51 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sdhc.c,v 1.87 2015/09/09 08:09:28 mlelstv Exp $ */ +/* $NetBSD: sdhc.c,v 1.88 2015/10/06 14:32:51 mlelstv Exp $ */ /* $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $ */ /* @@ -23,7 +23,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.87 2015/09/09 08:09:28 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.88 2015/10/06 14:32:51 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_sdmmc.h" @@ -195,7 +195,7 @@ static void sdhc_tuning_timer(void *); static int sdhc_start_command(struct sdhc_host *, struct sdmmc_command *); static int sdhc_wait_state(struct sdhc_host *, uint32_t, uint32_t); static int sdhc_soft_reset(struct sdhc_host *, int); -static int sdhc_wait_intr(struct sdhc_host *, int, int); +static int sdhc_wait_intr(struct sdhc_host *, int, int, bool); static void sdhc_transfer_data(struct sdhc_host *, struct sdmmc_command *); static int sdhc_transfer_data_dma(struct sdhc_host *, struct sdmmc_command *); static int sdhc_transfer_data_pio(struct sdhc_host *, struct sdmmc_command *); @@ -1331,7 +1331,7 @@ sdhc_execute_tuning1(struct sdhc_host *h break; if (!sdhc_wait_intr(hp, SDHC_BUFFER_READ_READY, - SDHC_TUNING_TIMEOUT)) { + SDHC_TUNING_TIMEOUT, false)) { break; } @@ -1409,6 +1409,7 @@ sdhc_exec_command(sdmmc_chipset_handle_t { struct sdhc_host *hp = (struct sdhc_host *)sch; int error; + bool probing; mutex_enter(&hp->intr_lock); @@ -1451,7 +1452,8 @@ sdhc_exec_command(sdmmc_chipset_handle_t * Wait until the command phase is done, or until the command * is marked done for any other reason. */ - if (!sdhc_wait_intr(hp, SDHC_COMMAND_COMPLETE, SDHC_COMMAND_TIMEOUT)) { + probing = (cmd->c_flags & SCF_TOUT_OK) != 0; + if (!sdhc_wait_intr(hp, SDHC_COMMAND_COMPLETE, SDHC_COMMAND_TIMEOUT, probing)) { DPRINTF(1,("%s: timeout for command\n", __func__)); cmd->c_error = ETIMEDOUT; goto out; @@ -1488,7 +1490,7 @@ sdhc_exec_command(sdmmc_chipset_handle_t if (cmd->c_error == 0 && cmd->c_data != NULL) sdhc_transfer_data(hp, cmd); else if (ISSET(cmd->c_flags, SCF_RSP_BSY)) { - if (!sdhc_wait_intr(hp, SDHC_TRANSFER_COMPLETE, hz * 10)) { + if (!sdhc_wait_intr(hp, SDHC_TRANSFER_COMPLETE, hz * 10, false)) { DPRINTF(1,("%s: sdhc_exec_command: RSP_BSY\n", HDEVNAME(hp))); cmd->c_error = ETIMEDOUT; @@ -1707,7 +1709,7 @@ sdhc_transfer_data(struct sdhc_host *hp, if (hp->sc->sc_vendor_transfer_data_dma != NULL) { error = hp->sc->sc_vendor_transfer_data_dma(sc, cmd); if (error == 0 && !sdhc_wait_intr(hp, - SDHC_TRANSFER_COMPLETE, SDHC_DMA_TIMEOUT)) { + SDHC_TRANSFER_COMPLETE, SDHC_DMA_TIMEOUT, false)) { DPRINTF(1,("%s: timeout\n", __func__)); error = ETIMEDOUT; } @@ -1744,7 +1746,7 @@ sdhc_transfer_data_dma(struct sdhc_host for (;;) { status = sdhc_wait_intr(hp, SDHC_DMA_INTERRUPT|SDHC_TRANSFER_COMPLETE, - SDHC_DMA_TIMEOUT); + SDHC_DMA_TIMEOUT, false); if (status & SDHC_TRANSFER_COMPLETE) { break; @@ -1830,7 +1832,7 @@ sdhc_transfer_data_pio(struct sdhc_host } else { HSET2(hp, SDHC_NINTR_SIGNAL_EN, imask); } - if (!sdhc_wait_intr(hp, imask, SDHC_BUFFER_TIMEOUT)) { + if (!sdhc_wait_intr(hp, imask, SDHC_BUFFER_TIMEOUT, false)) { DPRINTF(1,("%s: timeout\n", __func__)); error = ETIMEDOUT; break; @@ -1851,7 +1853,7 @@ sdhc_transfer_data_pio(struct sdhc_host } if (error == 0 && !sdhc_wait_intr(hp, SDHC_TRANSFER_COMPLETE, - SDHC_TRANSFER_TIMEOUT)) { + SDHC_TRANSFER_TIMEOUT, false)) { DPRINTF(1,("%s: timeout for transfer\n", __func__)); error = ETIMEDOUT; } @@ -2063,7 +2065,7 @@ sdhc_soft_reset(struct sdhc_host *hp, in } static int -sdhc_wait_intr(struct sdhc_host *hp, int mask, int timo) +sdhc_wait_intr(struct sdhc_host *hp, int mask, int timo, bool probing) { int status, error, nointr; @@ -2110,8 +2112,14 @@ sdhc_wait_intr(struct sdhc_host *hp, int device_printf(hp->sc->sc_dev,"cmd end bit error\n"); if (ISSET(error, SDHC_CMD_CRC_ERROR)) device_print
CVS commit: src/sys/dev/dkwedge
Module Name:src Committed By: jmcneill Date: Tue Oct 6 11:22:40 UTC 2015 Modified Files: src/sys/dev/dkwedge: dk.c Log Message: print wedge announcement in one line instead of two To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/dev/dkwedge/dk.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/dev/dkwedge/dk.c diff -u src/sys/dev/dkwedge/dk.c:1.83 src/sys/dev/dkwedge/dk.c:1.84 --- src/sys/dev/dkwedge/dk.c:1.83 Tue Aug 25 11:08:59 2015 +++ src/sys/dev/dkwedge/dk.c Tue Oct 6 11:22:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dk.c,v 1.83 2015/08/25 11:08:59 pooka Exp $ */ +/* $NetBSD: dk.c,v 1.84 2015/10/06 11:22:40 jmcneill Exp $ */ /*- * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.83 2015/08/25 11:08:59 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.84 2015/10/06 11:22:40 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_dkwedge.h" @@ -464,10 +464,12 @@ dkwedge_add(struct dkwedge_info *dkw) sc->sc_state = DKW_STATE_RUNNING; /* Announce our arrival. */ - aprint_normal("%s at %s: %s\n", device_xname(sc->sc_dev), pdk->dk_name, - sc->sc_wname); /* XXX Unicode */ - aprint_normal("%s: %"PRIu64" blocks at %"PRId64", type: %s\n", - device_xname(sc->sc_dev), sc->sc_size, sc->sc_offset, sc->sc_ptype); + aprint_normal( + "%s at %s: \"%s\", %"PRIu64" blocks at %"PRId64", type: %s\n", + device_xname(sc->sc_dev), pdk->dk_name, + sc->sc_wname, /* XXX Unicode */ + sc->sc_size, sc->sc_offset, + sc->sc_ptype[0] == '\0' ? "" : sc->sc_ptype); return (0); }
CVS commit: src/sys/external/bsd/ipf/netinet
Module Name:src Committed By: prlw1 Date: Tue Oct 6 10:21:08 UTC 2015 Modified Files: src/sys/external/bsd/ipf/netinet: ip_nat.c ip_nat6.c Log Message: Update comments to match previous change (avoid panic in SIOCGNATL) To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/ipf/netinet/ip_nat.c cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/ipf/netinet/ip_nat6.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/external/bsd/ipf/netinet/ip_nat.c diff -u src/sys/external/bsd/ipf/netinet/ip_nat.c:1.14 src/sys/external/bsd/ipf/netinet/ip_nat.c:1.15 --- src/sys/external/bsd/ipf/netinet/ip_nat.c:1.14 Fri Aug 7 17:31:12 2015 +++ src/sys/external/bsd/ipf/netinet/ip_nat.c Tue Oct 6 10:21:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_nat.c,v 1.14 2015/08/07 17:31:12 prlw1 Exp $ */ +/* $NetBSD: ip_nat.c,v 1.15 2015/10/06 10:21:08 prlw1 Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -113,7 +113,7 @@ extern struct ifnet vpnif; #if !defined(lint) #if defined(__NetBSD__) #include -__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.14 2015/08/07 17:31:12 prlw1 Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.15 2015/10/06 10:21:08 prlw1 Exp $"); #else static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed"; static const char rcsid[] = "@(#)Id: ip_nat.c,v 1.1.1.2 2012/07/22 13:45:27 darrenr Exp"; @@ -4558,8 +4558,9 @@ find_out_wild_ports: /* Function:ipf_nat_lookupredir */ /* Returns: nat_t* - NULL == no match, */ /* else pointer to matching NAT entry */ -/* Parameters: np(I) - pointer to description of packet to find NAT table */ -/* entry for. */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* np(I)- pointer to description of packet to find NAT */ +/* table entry for. */ /* */ /* Lookup the NAT tables to search for a matching redirect */ /* The contents of natlookup_t should imitate those found in a packet that */ Index: src/sys/external/bsd/ipf/netinet/ip_nat6.c diff -u src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.8 src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.9 --- src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.8 Fri Aug 7 17:31:12 2015 +++ src/sys/external/bsd/ipf/netinet/ip_nat6.c Tue Oct 6 10:21:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_nat6.c,v 1.8 2015/08/07 17:31:12 prlw1 Exp $ */ +/* $NetBSD: ip_nat6.c,v 1.9 2015/10/06 10:21:08 prlw1 Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -2398,8 +2398,9 @@ find_out_wild_ports: /* Function:ipf_nat6_lookupredir*/ /* Returns: nat6_t* - NULL == no match, */ /* else pointer to matching NAT entry */ -/* Parameters: np(I) - pointer to description of packet to find NAT table */ -/* entry for. */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* np(I)- pointer to description of packet to find NAT */ +/* table entry for. */ /* */ /* Lookup the NAT tables to search for a matching redirect */ /* The contents of natlookup_t should imitate those found in a packet that */
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: knakahara Date: Tue Oct 6 09:44:31 UTC 2015 Modified Files: src/sys/arch/x86/x86: intr.c Log Message: quick hack for shared IRQ issue. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/x86/x86/intr.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/arch/x86/x86/intr.c diff -u src/sys/arch/x86/x86/intr.c:1.87 src/sys/arch/x86/x86/intr.c:1.88 --- src/sys/arch/x86/x86/intr.c:1.87 Mon Aug 17 06:16:03 2015 +++ src/sys/arch/x86/x86/intr.c Tue Oct 6 09:44:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.87 2015/08/17 06:16:03 knakahara Exp $ */ +/* $NetBSD: intr.c,v 1.88 2015/10/06 09:44:31 knakahara Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.87 2015/08/17 06:16:03 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.88 2015/10/06 09:44:31 knakahara Exp $"); #include "opt_intrdebug.h" #include "opt_multiprocessor.h" @@ -1954,6 +1954,10 @@ intr_is_affinity_intrsource(struct intrs KASSERT(mutex_owned(&cpu_lock)); + /* XXX avoid shared IRQ issue. */ + if (isp->is_handlers == NULL) + return false; + ci = isp->is_handlers->ih_cpu; KASSERT(ci != NULL);
CVS commit: src/sys/fs/udf
Module Name:src Committed By: hannken Date: Tue Oct 6 08:57:34 UTC 2015 Modified Files: src/sys/fs/udf: udf_strat_direct.c udf_strat_rmw.c udf_strat_sequential.c Log Message: Remove dubious vhold()/holdrele() from write_logvol_dscr strategies. The udf_node already gets locked with UDF_LOCK_NODE() and udf_reclaim() will wait for the lock to clear. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/fs/udf/udf_strat_direct.c cvs rdiff -u -r1.26 -r1.27 src/sys/fs/udf/udf_strat_rmw.c cvs rdiff -u -r1.13 -r1.14 src/sys/fs/udf/udf_strat_sequential.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/fs/udf/udf_strat_direct.c diff -u src/sys/fs/udf/udf_strat_direct.c:1.12 src/sys/fs/udf/udf_strat_direct.c:1.13 --- src/sys/fs/udf/udf_strat_direct.c:1.12 Wed Oct 30 08:41:38 2013 +++ src/sys/fs/udf/udf_strat_direct.c Tue Oct 6 08:57:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_direct.c,v 1.12 2013/10/30 08:41:38 mrg Exp $ */ +/* $NetBSD: udf_strat_direct.c,v 1.13 2015/10/06 08:57:34 hannken Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.12 2013/10/30 08:41:38 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.13 2015/10/06 08:57:34 hannken Exp $"); #endif /* not lint */ @@ -118,8 +118,6 @@ udf_wr_nodedscr_callback(struct buf *buf UDF_UNLOCK_NODE(udf_node, 0); wakeup(&udf_node->outstanding_nodedscr); } - /* unreference the vnode so it can be recycled */ - holdrele(udf_node->vnode); putiobuf(buf); } @@ -208,9 +206,6 @@ udf_write_nodedscr_direct(struct udf_str if (error) goto out; - /* add reference to the vnode to prevent recycling */ - vhold(udf_node->vnode); - if (waitfor) { DPRINTF(WRITE, ("udf_write_nodedscr: sync write\n")); @@ -224,8 +219,6 @@ udf_write_nodedscr_direct(struct udf_str /* will be UNLOCKED in call back */ return error; } - - holdrele(udf_node->vnode); out: udf_node->outstanding_nodedscr--; if (udf_node->outstanding_nodedscr == 0) { Index: src/sys/fs/udf/udf_strat_rmw.c diff -u src/sys/fs/udf/udf_strat_rmw.c:1.26 src/sys/fs/udf/udf_strat_rmw.c:1.27 --- src/sys/fs/udf/udf_strat_rmw.c:1.26 Sat Sep 12 19:50:08 2015 +++ src/sys/fs/udf/udf_strat_rmw.c Tue Oct 6 08:57:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_rmw.c,v 1.26 2015/09/12 19:50:08 christos Exp $ */ +/* $NetBSD: udf_strat_rmw.c,v 1.27 2015/10/06 08:57:34 hannken Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.26 2015/09/12 19:50:08 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.27 2015/10/06 08:57:34 hannken Exp $"); #endif /* not lint */ @@ -719,9 +719,6 @@ udf_write_nodedscr_rmw(struct udf_strat_ if (error) return error; - /* paranoia: add reference to the vnode to prevent recycling */ - vhold(udf_node->vnode); - /* get our eccline */ eccline = udf_geteccline(ump, sectornr, 0); eccsect = sectornr - eccline->start_sector; @@ -761,7 +758,6 @@ udf_write_nodedscr_rmw(struct udf_strat_ UDF_UNLOCK_NODE(udf_node, 0); wakeup(&udf_node->outstanding_nodedscr); } - holdrele(udf_node->vnode); udf_puteccline(eccline); /* XXX waitfor not used */ Index: src/sys/fs/udf/udf_strat_sequential.c diff -u src/sys/fs/udf/udf_strat_sequential.c:1.13 src/sys/fs/udf/udf_strat_sequential.c:1.14 --- src/sys/fs/udf/udf_strat_sequential.c:1.13 Sun Mar 23 09:34:42 2014 +++ src/sys/fs/udf/udf_strat_sequential.c Tue Oct 6 08:57:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_sequential.c,v 1.13 2014/03/23 09:34:42 christos Exp $ */ +/* $NetBSD: udf_strat_sequential.c,v 1.14 2015/10/06 08:57:34 hannken Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.13 2014/03/23 09:34:42 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.14 2015/10/06 08:57:34 hannken Exp $"); #endif /* not lint */ @@ -129,9 +129,6 @@ udf_wr_nodedscr_callback(struct buf *buf wakeup(&udf_node->outstanding_nodedscr); } - /* unreference the vnode so it can be recycled */ - holdrele(udf_node->vnode); - putiobuf(buf); } @@ -219,9 +216,6 @@ udf_write_logvol_dscr_seq(struct udf_str goto out; } - /* add reference to the vnode to prevent recycling */ - vhold(udf_node->vnode); - if (waitfor) { DPRINTF(WRITE, ("udf_write_logvol_dscr: sync write\n")); @@ -235,8 +229,6 @@ udf_write_logvol_dscr_seq(struct udf_str /* will be UNLOCKED in call back */ return error; } - - holdrele(udf_node->vnode); out: udf_node->outstanding_nodedscr--; if (udf_node->outstanding_nodedscr == 0) {