From owner-svn-src-stable@FreeBSD.ORG Sun May 30 08:38:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3E81065670; Sun, 30 May 2010 08:38:43 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7B48FC08; Sun, 30 May 2010 08:38:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4U8cghD091290; Sun, 30 May 2010 08:38:42 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4U8cfeb091286; Sun, 30 May 2010 08:38:41 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201005300838.o4U8cfeb091286@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 30 May 2010 08:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208652 - in stable/8: lib/libc/compat-43 share/man/man4 share/man/man9 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 May 2010 08:38:43 -0000 Author: uqs Date: Sun May 30 08:38:41 2010 New Revision: 208652 URL: http://svn.freebsd.org/changeset/base/208652 Log: MFC r208493: These features will first appear in 8.1, soon to be released Approved by: re (kib) Modified: stable/8/lib/libc/compat-43/sigpause.2 stable/8/share/man/man4/lindev.4 stable/8/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man9/ (props changed) Modified: stable/8/lib/libc/compat-43/sigpause.2 ============================================================================== --- stable/8/lib/libc/compat-43/sigpause.2 Sun May 30 04:44:32 2010 (r208651) +++ stable/8/lib/libc/compat-43/sigpause.2 Sun May 30 08:38:41 2010 (r208652) @@ -237,5 +237,5 @@ function appeared in .Bx 4.2 and has been deprecated. All other functions appeared in -.Fx 9.0 +.Fx 8.1 and were deprecated before being implemented. Modified: stable/8/share/man/man4/lindev.4 ============================================================================== --- stable/8/share/man/man4/lindev.4 Sun May 30 04:44:32 2010 (r208651) +++ stable/8/share/man/man4/lindev.4 Sun May 30 08:38:41 2010 (r208652) @@ -70,4 +70,4 @@ For reads it emulates The .Nm module first appeared in -.Fx 9.0 . +.Fx 8.1 . Modified: stable/8/share/man/man9/BUS_DESCRIBE_INTR.9 ============================================================================== --- stable/8/share/man/man9/BUS_DESCRIBE_INTR.9 Sun May 30 04:44:32 2010 (r208651) +++ stable/8/share/man/man9/BUS_DESCRIBE_INTR.9 Sun May 30 08:38:41 2010 (r208652) @@ -98,7 +98,7 @@ The method and .Fn bus_describe_intr functions first appeared in -.Fx 9.0 . +.Fx 8.1 . .Sh BUGS It is not currently possible to remove a description from an active interrupt handler. From owner-svn-src-stable@FreeBSD.ORG Sun May 30 11:28:01 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE520106564A; Sun, 30 May 2010 11:28:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C56A8FC21; Sun, 30 May 2010 11:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4UBS10A029677; Sun, 30 May 2010 11:28:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4UBS13J029675; Sun, 30 May 2010 11:28:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201005301128.o4UBS13J029675@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 30 May 2010 11:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208653 - stable/8/usr.sbin/jail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 May 2010 11:28:01 -0000 Author: bz Date: Sun May 30 11:28:01 2010 New Revision: 208653 URL: http://svn.freebsd.org/changeset/base/208653 Log: MFC r199818: New style of jail(8) usage requires "-c" argument to create a jail. Approved by: re (hrs) Modified: stable/8/usr.sbin/jail/jail.8 Directory Properties: stable/8/usr.sbin/jail/ (props changed) Modified: stable/8/usr.sbin/jail/jail.8 ============================================================================== --- stable/8/usr.sbin/jail/jail.8 Sun May 30 08:38:41 2010 (r208652) +++ stable/8/usr.sbin/jail/jail.8 Sun May 30 11:28:01 2010 (r208653) @@ -569,7 +569,7 @@ or for running a virtual server. Start a shell in the jail: .Pp .Bd -literal -offset indent -jail path=/data/jail/192.0.2.100 host.hostname=testhostname \\ +jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ ip4.addr=192.0.2.100 command=/bin/sh .Ed .Pp @@ -644,7 +644,7 @@ script from within the jail. .Bd -literal -offset indent ifconfig ed0 inet alias 192.0.2.100/32 mount -t procfs proc /data/jail/192.0.2.100/proc -jail path=/data/jail/192.0.2.100 host.hostname=testhostname \\ +jail -c path=/data/jail/192.0.2.100 host.hostname=testhostname \\ ip4.addr=192.0.2.100 command=/bin/sh /etc/rc .Ed .Pp From owner-svn-src-stable@FreeBSD.ORG Mon May 31 07:14:40 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6456D1065678; Mon, 31 May 2010 07:14:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52A948FC17; Mon, 31 May 2010 07:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4V7EeoX095820; Mon, 31 May 2010 07:14:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4V7EeQa095818; Mon, 31 May 2010 07:14:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201005310714.o4V7EeQa095818@svn.freebsd.org> From: Colin Percival Date: Mon, 31 May 2010 07:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208668 - stable/8/crypto/openssh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 07:14:40 -0000 Author: cperciva Date: Mon May 31 07:14:40 2010 New Revision: 208668 URL: http://svn.freebsd.org/changeset/base/208668 Log: MFC r208606: Remove $Mdocdate$ from man page imported from OpenBSD; their mdoc supports it, but ours doesn't. Approved by: re (hrs) Modified: stable/8/crypto/openssh/ssh-pkcs11-helper.8 Directory Properties: stable/8/crypto/openssh/ (props changed) Modified: stable/8/crypto/openssh/ssh-pkcs11-helper.8 ============================================================================== --- stable/8/crypto/openssh/ssh-pkcs11-helper.8 Mon May 31 06:06:10 2010 (r208667) +++ stable/8/crypto/openssh/ssh-pkcs11-helper.8 Mon May 31 07:14:40 2010 (r208668) @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 10 2010 $ +.Dd February 10, 2010 .Dt SSH-PKCS11-HELPER 8 .Os .Sh NAME From owner-svn-src-stable@FreeBSD.ORG Mon May 31 20:17:38 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EA60106566B; Mon, 31 May 2010 20:17:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C66C8FC18; Mon, 31 May 2010 20:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VKHbGu012128; Mon, 31 May 2010 20:17:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VKHbuU012127; Mon, 31 May 2010 20:17:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201005312017.o4VKHbuU012127@svn.freebsd.org> From: Andriy Gapon Date: Mon, 31 May 2010 20:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208673 - stable/8/sys/geom/part X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 20:17:38 -0000 Author: avg Date: Mon May 31 20:17:37 2010 New Revision: 208673 URL: http://svn.freebsd.org/changeset/base/208673 Log: MFC r201374: g_part_gpt: Properly return the UUID represented by the alias PR: kern/142174 Approved by: re (kib) Approved by: marcel Modified: stable/8/sys/geom/part/g_part_gpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Mon May 31 09:10:39 2010 (r208672) +++ stable/8/sys/geom/part/g_part_gpt.c Mon May 31 20:17:37 2010 (r208673) @@ -354,7 +354,7 @@ gpt_parse_type(const char *type, struct for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) { alias = g_part_alias_name(uap->alias); if (!strcasecmp(type, alias)) { - uuid = uap->uuid; + *uuid = *uap->uuid; return (0); } } From owner-svn-src-stable@FreeBSD.ORG Mon May 31 21:14:57 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31FDF1065674; Mon, 31 May 2010 21:14:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06D948FC16; Mon, 31 May 2010 21:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VLEukY024840; Mon, 31 May 2010 21:14:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VLEup6024838; Mon, 31 May 2010 21:14:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005312114.o4VLEup6024838@svn.freebsd.org> From: Robert Watson Date: Mon, 31 May 2010 21:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208674 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 21:14:57 -0000 Author: rwatson Date: Mon May 31 21:14:56 2010 New Revision: 208674 URL: http://svn.freebsd.org/changeset/base/208674 Log: Merge r200899 from head to stable/8: When warning about possible netisr configuration problems during boot, report using "netisr_init" rather than "netisr2", which was the development name for the project. Approved by: re (kib) Modified: stable/8/sys/net/netisr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net/netisr.c ============================================================================== --- stable/8/sys/net/netisr.c Mon May 31 20:17:37 2010 (r208673) +++ stable/8/sys/net/netisr.c Mon May 31 21:14:56 2010 (r208674) @@ -1068,12 +1068,12 @@ netisr_init(void *arg) if (netisr_maxthreads < 1) netisr_maxthreads = 1; if (netisr_maxthreads > mp_ncpus) { - printf("netisr2: forcing maxthreads from %d to %d\n", + printf("netisr_init: forcing maxthreads from %d to %d\n", netisr_maxthreads, mp_ncpus); netisr_maxthreads = mp_ncpus; } if (netisr_defaultqlimit > netisr_maxqlimit) { - printf("netisr2: forcing defaultqlimit from %d to %d\n", + printf("netisr_init: forcing defaultqlimit from %d to %d\n", netisr_defaultqlimit, netisr_maxqlimit); netisr_defaultqlimit = netisr_maxqlimit; } @@ -1084,8 +1084,8 @@ netisr_init(void *arg) * polling disables parallel netisr workers. */ if (netisr_maxthreads != 1 || netisr_bindthreads != 0) { - printf("netisr2: forcing maxthreads to 1 and bindthreads to " - "0 for device polling\n"); + printf("netisr_init: forcing maxthreads to 1 and " + "bindthreads to 0 for device polling\n"); netisr_maxthreads = 1; netisr_bindthreads = 0; } From owner-svn-src-stable@FreeBSD.ORG Mon May 31 21:35:40 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B35771065676; Mon, 31 May 2010 21:35:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8841D8FC13; Mon, 31 May 2010 21:35:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VLZeZv029402; Mon, 31 May 2010 21:35:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VLZen5029400; Mon, 31 May 2010 21:35:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005312135.o4VLZen5029400@svn.freebsd.org> From: Robert Watson Date: Mon, 31 May 2010 21:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208675 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 21:35:40 -0000 Author: rwatson Date: Mon May 31 21:35:40 2010 New Revision: 208675 URL: http://svn.freebsd.org/changeset/base/208675 Log: Merge r200976 from head to stable/8: Minor comment tweaks in rmlocks. Approved by: re (kib) Modified: stable/8/sys/kern/kern_rmlock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/kern_rmlock.c ============================================================================== --- stable/8/sys/kern/kern_rmlock.c Mon May 31 21:14:56 2010 (r208674) +++ stable/8/sys/kern/kern_rmlock.c Mon May 31 21:35:40 2010 (r208675) @@ -128,9 +128,9 @@ static struct mtx rm_spinlock; MTX_SYSINIT(rm_spinlock, &rm_spinlock, "rm_spinlock", MTX_SPIN); /* - * Add or remove tracker from per cpu list. + * Add or remove tracker from per-cpu list. * - * The per cpu list can be traversed at any time in forward direction from an + * The per-cpu list can be traversed at any time in forward direction from an * interrupt on the *local* cpu. */ static void inline @@ -257,7 +257,7 @@ _rm_rlock_hard(struct rmlock *rm, struct return; } - /* Remove our tracker from the per cpu list. */ + /* Remove our tracker from the per-cpu list. */ rm_tracker_remove(pc, tracker); /* Check to see if the IPI granted us the lock after all. */ @@ -274,8 +274,8 @@ _rm_rlock_hard(struct rmlock *rm, struct */ if ((rm->lock_object.lo_flags & LO_RECURSABLE) != 0) { /* - * Just grand the lock if this thread already have a tracker - * for this lock on the per cpu queue. + * Just grant the lock if this thread already has a tracker + * for this lock on the per-cpu queue. */ for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; queue = queue->rmq_next) { From owner-svn-src-stable@FreeBSD.ORG Mon May 31 21:57:31 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F574106566C; Mon, 31 May 2010 21:57:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDF28FC0C; Mon, 31 May 2010 21:57:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VLvVuJ034236; Mon, 31 May 2010 21:57:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VLvVLP034234; Mon, 31 May 2010 21:57:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005312157.o4VLvVLP034234@svn.freebsd.org> From: Robert Watson Date: Mon, 31 May 2010 21:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208676 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 21:57:31 -0000 Author: rwatson Date: Mon May 31 21:57:31 2010 New Revision: 208676 URL: http://svn.freebsd.org/changeset/base/208676 Log: Merge r203410 from head to stable/8: Only audit pathnames in namei(9) if copying the directory string completes successfully. Continue to do this before the empty path check so that the ENOENT returned in that case gets an empty string token in the BSM record. Approved by: re (kib) Modified: stable/8/sys/kern/vfs_lookup.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Mon May 31 21:35:40 2010 (r208675) +++ stable/8/sys/kern/vfs_lookup.c Mon May 31 21:57:31 2010 (r208676) @@ -162,11 +162,16 @@ namei(struct nameidata *ndp) error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, (size_t *)&ndp->ni_pathlen); - /* If we are auditing the kernel pathname, save the user pathname. */ - if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_UPATH1(td, cnp->cn_pnbuf); - if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_UPATH2(td, cnp->cn_pnbuf); + if (error == 0) { + /* + * If we are auditing the kernel pathname, save the user + * pathname. + */ + if (cnp->cn_flags & AUDITVNODE1) + AUDIT_ARG_UPATH1(td, cnp->cn_pnbuf); + if (cnp->cn_flags & AUDITVNODE2) + AUDIT_ARG_UPATH2(td, cnp->cn_pnbuf); + } /* * Don't allow empty pathnames. From owner-svn-src-stable@FreeBSD.ORG Mon May 31 22:03:57 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14ED51065670; Mon, 31 May 2010 22:03:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 039088FC0C; Mon, 31 May 2010 22:03:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VM3uN1035697; Mon, 31 May 2010 22:03:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VM3uUU035695; Mon, 31 May 2010 22:03:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005312203.o4VM3uUU035695@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 31 May 2010 22:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208677 - stable/8/sys/dev/sge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 22:03:57 -0000 Author: yongari Date: Mon May 31 22:03:56 2010 New Revision: 208677 URL: http://svn.freebsd.org/changeset/base/208677 Log: MFC r208512: sge_encap() can sometimes return an error with m_head set to NULL. Make sure not to requeue freed mbuf in sge_start_locked(). This should fix NULL pointer dereference panic. Reported by: Nikolay Denev gmail dot com> Submitted by: jhb Approved by: re (bz) Modified: stable/8/sys/dev/sge/if_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Mon May 31 21:57:31 2010 (r208676) +++ stable/8/sys/dev/sge/if_sge.c Mon May 31 22:03:56 2010 (r208677) @@ -1588,7 +1588,8 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head != NULL) + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-stable@FreeBSD.ORG Mon May 31 22:07:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 471661065673; Mon, 31 May 2010 22:07:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35F268FC12; Mon, 31 May 2010 22:07:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VM7Jjv036476; Mon, 31 May 2010 22:07:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VM7Jer036474; Mon, 31 May 2010 22:07:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005312207.o4VM7Jer036474@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 31 May 2010 22:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208678 - stable/7/sys/dev/sge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 22:07:19 -0000 Author: yongari Date: Mon May 31 22:07:18 2010 New Revision: 208678 URL: http://svn.freebsd.org/changeset/base/208678 Log: MFC r208512: sge_encap() can sometimes return an error with m_head set to NULL. Make sure not to requeue freed mbuf in sge_start_locked(). This should fix NULL pointer dereference panic. Reported by: Nikolay Denev gmail dot com> Submitted by: jhb Modified: stable/7/sys/dev/sge/if_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Mon May 31 22:03:56 2010 (r208677) +++ stable/7/sys/dev/sge/if_sge.c Mon May 31 22:07:18 2010 (r208678) @@ -1588,7 +1588,8 @@ sge_start_locked(struct ifnet *ifp) if (m_head == NULL) break; if (sge_encap(sc, &m_head)) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head != NULL) + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } From owner-svn-src-stable@FreeBSD.ORG Mon May 31 22:18:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AA80106566B; Mon, 31 May 2010 22:18:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED91F8FC1F; Mon, 31 May 2010 22:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VMIgdW039053; Mon, 31 May 2010 22:18:42 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VMIgWG039051; Mon, 31 May 2010 22:18:42 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005312218.o4VMIgWG039051@svn.freebsd.org> From: Robert Watson Date: Mon, 31 May 2010 22:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208679 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 22:18:43 -0000 Author: rwatson Date: Mon May 31 22:18:42 2010 New Revision: 208679 URL: http://svn.freebsd.org/changeset/base/208679 Log: Merge r204173 from head to stable/8: ifconfig(8) expects interface fooX to be supported by the module if_foo, and will try to load it if it's not present. To better meet these expectations, change the module name for the loopback interface from 'loop' to 'if_lo'. The loopback interface is always compiled into the base kernel, so there are no resulting changes in kld files, etc. Discussed with: brooks (ages ago) Approved by: re (bz, kib) Modified: stable/8/sys/net/if_loop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net/if_loop.c ============================================================================== --- stable/8/sys/net/if_loop.c Mon May 31 22:07:18 2010 (r208678) +++ stable/8/sys/net/if_loop.c Mon May 31 22:18:42 2010 (r208679) @@ -200,12 +200,12 @@ loop_modevent(module_t mod, int type, vo } static moduledata_t loop_mod = { - "loop", + "if_lo", loop_modevent, 0 }; -DECLARE_MODULE(loop, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(if_lo, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); int looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, From owner-svn-src-stable@FreeBSD.ORG Mon May 31 22:27:09 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 088E0106567B; Mon, 31 May 2010 22:27:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1DBA8FC0A; Mon, 31 May 2010 22:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VMR8hE040942; Mon, 31 May 2010 22:27:08 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VMR8ds040938; Mon, 31 May 2010 22:27:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005312227.o4VMR8ds040938@svn.freebsd.org> From: Robert Watson Date: Mon, 31 May 2010 22:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208680 - in stable/8/sys/security: mac_biba mac_lomac mac_mls X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 22:27:09 -0000 Author: rwatson Date: Mon May 31 22:27:08 2010 New Revision: 208680 URL: http://svn.freebsd.org/changeset/base/208680 Log: Merge r204581 from head to stable/8: Update device-labeling logic for Biba, LOMAC, and MLS to recognize new-style pts devices when various policy ptys_equal flags are enabled. Submitted by: Estella Mystagic Approved by: re (kib) Modified: stable/8/sys/security/mac_biba/mac_biba.c stable/8/sys/security/mac_lomac/mac_lomac.c stable/8/sys/security/mac_mls/mac_mls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/security/mac_biba/mac_biba.c ============================================================================== --- stable/8/sys/security/mac_biba/mac_biba.c Mon May 31 22:18:42 2010 (r208679) +++ stable/8/sys/security/mac_biba/mac_biba.c Mon May 31 22:27:08 2010 (r208680) @@ -955,6 +955,7 @@ biba_devfs_create_device(struct ucred *c biba_type = MAC_BIBA_TYPE_EQUAL; else if (ptys_equal && (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || + strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) biba_type = MAC_BIBA_TYPE_EQUAL; else Modified: stable/8/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- stable/8/sys/security/mac_lomac/mac_lomac.c Mon May 31 22:18:42 2010 (r208679) +++ stable/8/sys/security/mac_lomac/mac_lomac.c Mon May 31 22:27:08 2010 (r208680) @@ -1043,6 +1043,7 @@ lomac_devfs_create_device(struct ucred * lomac_type = MAC_LOMAC_TYPE_EQUAL; else if (ptys_equal && (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || + strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) lomac_type = MAC_LOMAC_TYPE_EQUAL; else Modified: stable/8/sys/security/mac_mls/mac_mls.c ============================================================================== --- stable/8/sys/security/mac_mls/mac_mls.c Mon May 31 22:18:42 2010 (r208679) +++ stable/8/sys/security/mac_mls/mac_mls.c Mon May 31 22:27:08 2010 (r208680) @@ -918,6 +918,7 @@ mls_devfs_create_device(struct ucred *cr mls_type = MAC_MLS_TYPE_HIGH; else if (ptys_equal && (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || + strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) mls_type = MAC_MLS_TYPE_EQUAL; else From owner-svn-src-stable@FreeBSD.ORG Mon May 31 22:29:49 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CB011065672; Mon, 31 May 2010 22:29:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF388FC1F; Mon, 31 May 2010 22:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4VMTmk7041579; Mon, 31 May 2010 22:29:48 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4VMTm5b041577; Mon, 31 May 2010 22:29:48 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201005312229.o4VMTm5b041577@svn.freebsd.org> From: Robert Watson Date: Mon, 31 May 2010 22:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208681 - stable/8/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 22:29:49 -0000 Author: rwatson Date: Mon May 31 22:29:48 2010 New Revision: 208681 URL: http://svn.freebsd.org/changeset/base/208681 Log: Merge r204498 from head to stable/8: Whitespace tweak. Approved by: re (kib) Modified: stable/8/sys/net/netisr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net/netisr.h ============================================================================== --- stable/8/sys/net/netisr.h Mon May 31 22:27:08 2010 (r208680) +++ stable/8/sys/net/netisr.h Mon May 31 22:29:48 2010 (r208681) @@ -85,7 +85,7 @@ * can rebalance work. */ struct mbuf; -typedef void netisr_handler_t (struct mbuf *m); +typedef void netisr_handler_t(struct mbuf *m); typedef struct mbuf *netisr_m2cpuid_t(struct mbuf *m, uintptr_t source, u_int *cpuid); typedef struct mbuf *netisr_m2flow_t(struct mbuf *m, uintptr_t source); From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 09:32:22 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A21D106564A; Tue, 1 Jun 2010 09:32:22 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58C938FC23; Tue, 1 Jun 2010 09:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o519WMuh086975; Tue, 1 Jun 2010 09:32:22 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o519WMfn086973; Tue, 1 Jun 2010 09:32:22 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201006010932.o519WMfn086973@svn.freebsd.org> From: Attilio Rao Date: Tue, 1 Jun 2010 09:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208690 - stable/8/sys/netgraph X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 09:32:22 -0000 Author: attilio Date: Tue Jun 1 09:32:22 2010 New Revision: 208690 URL: http://svn.freebsd.org/changeset/base/208690 Log: MFC r208300: Fix a race between ngs_rcvmsg() and soclose() which closes the control socket while it is still in use as ngs_rcvmsg() runs without any lock held. Sponsored by: Sandvine Incorporated Approved by: re (bz) Modified: stable/8/sys/netgraph/ng_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netgraph/ng_socket.c ============================================================================== --- stable/8/sys/netgraph/ng_socket.c Tue Jun 1 08:43:46 2010 (r208689) +++ stable/8/sys/netgraph/ng_socket.c Tue Jun 1 09:32:22 2010 (r208690) @@ -855,7 +855,7 @@ static int ngs_rcvmsg(node_p node, item_p item, hook_p lasthook) { struct ngsock *const priv = NG_NODE_PRIVATE(node); - struct ngpcb *const pcbp = priv->ctlsock; + struct ngpcb *pcbp; struct socket *so; struct sockaddr_ng addr; struct ng_mesg *msg; @@ -868,15 +868,27 @@ ngs_rcvmsg(node_p node, item_p item, hoo NG_FREE_ITEM(item); /* + * Grab priv->mtx here to prevent destroying of control socket + * after checking that priv->ctlsock is not NULL. + */ + mtx_lock(&priv->mtx); + pcbp = priv->ctlsock; + + /* * Only allow mesgs to be passed if we have the control socket. * Data sockets can only support the generic messages. */ if (pcbp == NULL) { + mtx_unlock(&priv->mtx); TRAP_ERROR; NG_FREE_MSG(msg); return (EINVAL); } so = pcbp->ng_socket; + SOCKBUF_LOCK(&so->so_rcv); + + /* As long as the race is handled, priv->mtx may be unlocked now. */ + mtx_unlock(&priv->mtx); #ifdef TRACE_MESSAGES printf("[%x]:---------->[socket]: c=<%d>cmd=%x(%s) f=%x #%d\n", @@ -899,6 +911,8 @@ ngs_rcvmsg(node_p node, item_p item, hoo default: error = EINVAL; /* unknown command */ } + SOCKBUF_UNLOCK(&so->so_rcv); + /* Free the message and return. */ NG_FREE_MSG(msg); return (error); @@ -911,6 +925,7 @@ ngs_rcvmsg(node_p node, item_p item, hoo addrlen = snprintf((char *)&addr.sg_data, sizeof(addr.sg_data), "[%x]:", retaddr); if (addrlen < 0 || addrlen > sizeof(addr.sg_data)) { + SOCKBUF_UNLOCK(&so->so_rcv); printf("%s: snprintf([%x]) failed - %d\n", __func__, retaddr, addrlen); NG_FREE_MSG(msg); @@ -928,17 +943,20 @@ ngs_rcvmsg(node_p node, item_p item, hoo NG_FREE_MSG(msg); if (m == NULL) { + SOCKBUF_UNLOCK(&so->so_rcv); TRAP_ERROR; return (ENOBUFS); } /* Send it up to the socket. */ - if (sbappendaddr(&so->so_rcv, (struct sockaddr *)&addr, m, NULL) == 0) { + if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&addr, m, + NULL) == 0) { + SOCKBUF_UNLOCK(&so->so_rcv); TRAP_ERROR; m_freem(m); return (ENOBUFS); } - sorwakeup(so); + sorwakeup_locked(so); return (error); } @@ -1020,8 +1038,11 @@ static int ngs_shutdown(node_p node) { struct ngsock *const priv = NG_NODE_PRIVATE(node); - struct ngpcb *const dpcbp = priv->datasock; - struct ngpcb *const pcbp = priv->ctlsock; + struct ngpcb *dpcbp, *pcbp; + + mtx_lock(&priv->mtx); + dpcbp = priv->datasock; + pcbp = priv->ctlsock; if (dpcbp != NULL) soisdisconnected(dpcbp->ng_socket); @@ -1029,7 +1050,6 @@ ngs_shutdown(node_p node) if (pcbp != NULL) soisdisconnected(pcbp->ng_socket); - mtx_lock(&priv->mtx); priv->node = NULL; NG_NODE_SET_PRIVATE(node, NULL); ng_socket_free_priv(priv); From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 13:57:59 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 017C2106567D; Tue, 1 Jun 2010 13:57:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E47768FC1E; Tue, 1 Jun 2010 13:57:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51DvwKe049732; Tue, 1 Jun 2010 13:57:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51DvwQ6049731; Tue, 1 Jun 2010 13:57:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011357.o51DvwQ6049731@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 13:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208691 - stable/8/sys/fs/coda X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 13:57:59 -0000 Author: rwatson Date: Tue Jun 1 13:57:58 2010 New Revision: 208691 URL: http://svn.freebsd.org/changeset/base/208691 Log: Merge r206206 from head to stable/8: Correct definition of CIOC_KERNEL_VERSION Coda ioctl() for systems where sizeof(int) != sizeof(sizeof(int)), or the ioctl will return EINVAL. Approved by: re (kib) Modified: stable/8/sys/fs/coda/coda.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/coda/coda.h ============================================================================== --- stable/8/sys/fs/coda/coda.h Tue Jun 1 09:32:22 2010 (r208690) +++ stable/8/sys/fs/coda/coda.h Tue Jun 1 13:57:58 2010 (r208691) @@ -313,7 +313,7 @@ struct coda_statfs { #define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\ VC_MAXDATASIZE -#define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int)) +#define CIOC_KERNEL_VERSION _IOWR('c', 10, int) #if 0 /* don't care about kernel version number */ #define CODA_KERNEL_VERSION 0 From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 13:59:48 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FFB21065674; Tue, 1 Jun 2010 13:59:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EAF18FC19; Tue, 1 Jun 2010 13:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51DxmLW050168; Tue, 1 Jun 2010 13:59:48 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51DxmSW050166; Tue, 1 Jun 2010 13:59:48 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011359.o51DxmSW050166@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 13:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208692 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 13:59:48 -0000 Author: rwatson Date: Tue Jun 1 13:59:48 2010 New Revision: 208692 URL: http://svn.freebsd.org/changeset/base/208692 Log: Merge r208601 from head to stable/8: When close() is called on a connected socket pair, SO_ISCONNECTED might be set but be cleared before the call to sodisconnect(). In this case, ENOTCONN is returned: suppress this error rather than returning it to userspace so that close() doesn't report an error improperly. PR: kern/144061 Reported by: Matt Reimer , Nikolay Denev , Mikolaj Golub Approved by: re (kib) Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Tue Jun 1 13:57:58 2010 (r208691) +++ stable/8/sys/kern/uipc_socket.c Tue Jun 1 13:59:48 2010 (r208692) @@ -656,8 +656,11 @@ soclose(struct socket *so) if (so->so_state & SS_ISCONNECTED) { if ((so->so_state & SS_ISDISCONNECTING) == 0) { error = sodisconnect(so); - if (error) + if (error) { + if (error == ENOTCONN) + error = 0; goto drop; + } } if (so->so_options & SO_LINGER) { if ((so->so_state & SS_ISDISCONNECTING) && From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:04:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7415F1065677; Tue, 1 Jun 2010 14:04:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 631F08FC2C; Tue, 1 Jun 2010 14:04:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51E4Xv5051332; Tue, 1 Jun 2010 14:04:33 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51E4XLU051330; Tue, 1 Jun 2010 14:04:33 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011404.o51E4XLU051330@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 14:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208694 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:04:33 -0000 Author: rwatson Date: Tue Jun 1 14:04:33 2010 New Revision: 208694 URL: http://svn.freebsd.org/changeset/base/208694 Log: Merge r204430 from head to stable/8: Remove stale comment about socket buffer accounting from access(2) code. It is the case, however, that the uidinfo of the temporary credential set up for access(2) is not properly updated when its effective uid is changed. Approved by: re (bz) Modified: stable/8/sys/kern/vfs_syscalls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/vfs_syscalls.c ============================================================================== --- stable/8/sys/kern/vfs_syscalls.c Tue Jun 1 14:04:00 2010 (r208693) +++ stable/8/sys/kern/vfs_syscalls.c Tue Jun 1 14:04:33 2010 (r208694) @@ -2118,8 +2118,7 @@ kern_accessat(struct thread *td, int fd, /* * Create and modify a temporary credential instead of one that - * is potentially shared. This could also mess up socket - * buffer accounting which can run in an interrupt context. + * is potentially shared. */ if (!(flags & AT_EACCESS)) { cred = td->td_ucred; From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:09:36 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3958F106566C; Tue, 1 Jun 2010 14:09:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 284A68FC18; Tue, 1 Jun 2010 14:09:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51E9aoX052504; Tue, 1 Jun 2010 14:09:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51E9ajH052502; Tue, 1 Jun 2010 14:09:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011409.o51E9ajH052502@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 14:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208695 - stable/8/lib/libkvm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:09:36 -0000 Author: rwatson Date: Tue Jun 1 14:09:35 2010 New Revision: 208695 URL: http://svn.freebsd.org/changeset/base/208695 Log: Merge r204435 from head to stable/8: Fix typo in comment. Approved by: re (bz) Modified: stable/8/lib/libkvm/kvm_vnet.c Directory Properties: stable/8/lib/libkvm/ (props changed) Modified: stable/8/lib/libkvm/kvm_vnet.c ============================================================================== --- stable/8/lib/libkvm/kvm_vnet.c Tue Jun 1 14:04:33 2010 (r208694) +++ stable/8/lib/libkvm/kvm_vnet.c Tue Jun 1 14:09:35 2010 (r208695) @@ -117,8 +117,8 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid } /* - * First, find the process for this pid. If we are workig on a dump, - * either locate the thread dumptid is refering to or proc0. + * First, find the process for this pid. If we are working on a + * dump, either locate the thread dumptid is refering to or proc0. * Based on either, take the address of the ucred. */ credp = 0; From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:18:45 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E6301065672; Tue, 1 Jun 2010 14:18:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340248FC19; Tue, 1 Jun 2010 14:18:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51EIj85054654; Tue, 1 Jun 2010 14:18:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51EIjwh054651; Tue, 1 Jun 2010 14:18:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011418.o51EIjwh054651@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 14:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208698 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:18:45 -0000 Author: rwatson Date: Tue Jun 1 14:18:44 2010 New Revision: 208698 URL: http://svn.freebsd.org/changeset/base/208698 Log: Merge r204806 from head to stable/8: Wrap use of rw_try_upgrade() on pcbinfo with macro INP_INFO_TRY_UPGRADE() to match other pcbinfo locking macros. Approved by: re (bz) Modified: stable/8/sys/netinet/in_pcb.h stable/8/sys/netinet/tcp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/in_pcb.h ============================================================================== --- stable/8/sys/netinet/in_pcb.h Tue Jun 1 14:17:08 2010 (r208697) +++ stable/8/sys/netinet/in_pcb.h Tue Jun 1 14:18:44 2010 (r208698) @@ -376,6 +376,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_INFO_WLOCK(ipi) rw_wlock(&(ipi)->ipi_lock) #define INP_INFO_TRY_RLOCK(ipi) rw_try_rlock(&(ipi)->ipi_lock) #define INP_INFO_TRY_WLOCK(ipi) rw_try_wlock(&(ipi)->ipi_lock) +#define INP_INFO_TRY_UPGRADE(ipi) rw_try_upgrade(&(ipi)->ipi_lock) #define INP_INFO_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_lock) #define INP_INFO_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_lock) #define INP_INFO_LOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_LOCKED) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Tue Jun 1 14:17:08 2010 (r208697) +++ stable/8/sys/netinet/tcp_input.c Tue Jun 1 14:18:44 2010 (r208698) @@ -641,7 +641,7 @@ relocked: ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked)); if (ti_locked == TI_RLOCKED) { - if (rw_try_upgrade(&V_tcbinfo.ipi_lock) == 0) { + if (INP_INFO_TRY_UPGRADE(&V_tcbinfo) == 0) { in_pcbref(inp); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); @@ -692,7 +692,7 @@ relocked: ("%s: upgrade check ti_locked %d", __func__, ti_locked)); if (ti_locked == TI_RLOCKED) { - if (rw_try_upgrade(&V_tcbinfo.ipi_lock) == 0) { + if (INP_INFO_TRY_UPGRADE(&V_tcbinfo) == 0) { in_pcbref(inp); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:21:24 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5B6B106566C; Tue, 1 Jun 2010 14:21:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB1F68FC0A; Tue, 1 Jun 2010 14:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51ELOmp055358; Tue, 1 Jun 2010 14:21:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51ELOTI055356; Tue, 1 Jun 2010 14:21:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011421.o51ELOTI055356@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 14:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208700 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:21:25 -0000 Author: rwatson Date: Tue Jun 1 14:21:24 2010 New Revision: 208700 URL: http://svn.freebsd.org/changeset/base/208700 Log: Merge r204809 from head to stable/8: Add a comment to tcp_usr_accept() to indicate why it is we acquire the tcbinfo lock there: r175612, which re-added it, masked a race between sonewconn(2) and accept(2) that could allow an incompletely initialized address on a newly-created socket on a listen queue to be exposed. Full details can be found in that commit message. Sponsored by: Juniper Networks Approved by: re (bz) Modified: stable/8/sys/netinet/tcp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/8/sys/netinet/tcp_usrreq.c Tue Jun 1 14:20:58 2010 (r208699) +++ stable/8/sys/netinet/tcp_usrreq.c Tue Jun 1 14:21:24 2010 (r208700) @@ -560,9 +560,15 @@ out: } /* - * Accept a connection. Essentially all the work is - * done at higher levels; just return the address - * of the peer, storing through addr. + * Accept a connection. Essentially all the work is done at higher levels; + * just return the address of the peer, storing through addr. + * + * The rationale for acquiring the tcbinfo lock here is somewhat complicated, + * and is described in detail in the commit log entry for r175612. Acquiring + * it delays an accept(2) racing with sonewconn(), which inserts the socket + * before the inpcb address/port fields are initialized. A better fix would + * prevent the socket from being placed in the listen queue until all fields + * are fully initialized. */ static int tcp_usr_accept(struct socket *so, struct sockaddr **nam) From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:23:16 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48A59106564A; Tue, 1 Jun 2010 14:23:16 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3718FC26; Tue, 1 Jun 2010 14:23:14 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so1405939fga.13 for ; Tue, 01 Jun 2010 07:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=M+/FU7RoN/mgHkl0qxwKgAgz4BgxTzKjNXopQnNDJhg=; b=K0z3WY2/k+NmhkAMH9uf3fHEwTCoTensnN3O8ZXXvSUATLizsMjhSRCE6tUY/eoRaY EFAHYDUx1llDuoVvDjPouhslxHHtrg0BRUBFs9ifkZgFrgKgW8By7cdeYVJCdTuGzQDt t33nlnTa8DsM5HSQpzSprqNtTMt9ljvuwiV0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=ogqiXBcC4mTTAAmkVuxujBETYz1nYlQNwS8PvAtqZN27tvOz+fn2mZbNoQG/YgS2Dd 5nGqbXFtacVMualaYxKlnxBK/lI2sL2U1EbamHd8XBi4lu6pSOP2FnyGjTgeAeLPKEo4 Q3i6MpVZg2MTN4mY9PlNFAETWHpFZ4+UPcRsc= Received: by 10.102.13.28 with SMTP id 28mr516514mum.73.1275402193958; Tue, 01 Jun 2010 07:23:13 -0700 (PDT) Received: from ndenevsa.sof.moneybookers.net ([195.34.111.178]) by mx.google.com with ESMTPS id 12sm10568991muq.33.2010.06.01.07.23.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Jun 2010 07:23:08 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201006011359.o51DxmSW050166@svn.freebsd.org> Date: Tue, 1 Jun 2010 17:23:05 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <2E4C7566-1F0E-4A44-8514-061FF1E129DE@gmail.com> References: <201006011359.o51DxmSW050166@svn.freebsd.org> To: Robert Watson X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208692 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:23:16 -0000 On Jun 1, 2010, at 4:59 PM, Robert Watson wrote: > Author: rwatson > Date: Tue Jun 1 13:59:48 2010 > New Revision: 208692 > URL: http://svn.freebsd.org/changeset/base/208692 >=20 > Log: > Merge r208601 from head to stable/8: >=20 > When close() is called on a connected socket pair, SO_ISCONNECTED = might be > set but be cleared before the call to sodisconnect(). In this = case, > ENOTCONN is returned: suppress this error rather than returning it = to > userspace so that close() doesn't report an error improperly. >=20 > PR: kern/144061 > Reported by: Matt Reimer , > Nikolay Denev , > Mikolaj Golub >=20 > Approved by: re (kib) I wonder, does this affect RELENG_7 ? (can't test at the moment, but = sys/kern/uipc_socket.c:soclose() looks similar) Regards, Niki Denev From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:26:27 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8D271065674; Tue, 1 Jun 2010 14:26:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96E928FC13; Tue, 1 Jun 2010 14:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51EQRsd056552; Tue, 1 Jun 2010 14:26:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51EQRe1056549; Tue, 1 Jun 2010 14:26:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011426.o51EQRe1056549@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 14:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208701 - stable/8/tools/tools/netrate/tcpp X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:26:27 -0000 Author: rwatson Date: Tue Jun 1 14:26:27 2010 New Revision: 208701 URL: http://svn.freebsd.org/changeset/base/208701 Log: Merge r206972 from head to stable/8: Merge @176820, @176822, @177156 to tcpp from P4 to HEAD: Improve accuracy of connection data transfer math. Disable Nagle's algorithm to avoid delaying transfers of data -- will want to refine this to combine payload with header transfer, however. Now that we're running w/o Nagle, try to send the initial data burst with the header in a single TCP segment. Prefer %zu to %ju for size_t. Sponsored by: Juniper, Inc. Approved by: re (bz) Modified: stable/8/tools/tools/netrate/tcpp/tcpp_client.c stable/8/tools/tools/netrate/tcpp/tcpp_server.c Directory Properties: stable/8/tools/tools/netrate/tcpp/ (props changed) Modified: stable/8/tools/tools/netrate/tcpp/tcpp_client.c ============================================================================== --- stable/8/tools/tools/netrate/tcpp/tcpp_client.c Tue Jun 1 14:21:24 2010 (r208700) +++ stable/8/tools/tools/netrate/tcpp/tcpp_client.c Tue Jun 1 14:26:27 2010 (r208701) @@ -33,9 +33,11 @@ #include #include #include +#include #include #include +#include #include #include @@ -82,6 +84,7 @@ static int kq; static int started; /* Number started so far. */ static int finished; /* Number finished so far. */ static int counter; /* IP number offset. */ +static uint64_t payload_len; static struct connection * tcpp_client_newconn(void) @@ -109,6 +112,9 @@ tcpp_client_newconn(void) i = 1; if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) < 0) err(-1, "setsockopt"); + i = 1; + if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i)) < 0) + err(-1, "setsockopt"); #if 0 i = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)) < 0) @@ -131,7 +137,7 @@ tcpp_client_newconn(void) conn->conn_magic = CONNECTION_MAGIC; conn->conn_fd = fd; conn->conn_header.th_magic = TCPP_MAGIC; - conn->conn_header.th_len = bflag; + conn->conn_header.th_len = payload_len; tcpp_header_encode(&conn->conn_header); EV_SET(&kev, fd, EVFILT_WRITE, EV_ADD, 0, 0, conn); @@ -156,16 +162,22 @@ static void tcpp_client_handleconn(struct kevent *kev) { struct connection *conn; - ssize_t len; + struct iovec iov[2]; + ssize_t len, header_left; conn = kev->udata; if (conn->conn_magic != CONNECTION_MAGIC) errx(-1, "tcpp_client_handleconn: magic"); if (conn->conn_header_sent < sizeof(conn->conn_header)) { - len = write(conn->conn_fd, ((u_char *)&conn->conn_header) + - conn->conn_header_sent, sizeof(conn->conn_header) - - conn->conn_header_sent); + header_left = sizeof(conn->conn_header) - + conn->conn_header_sent; + iov[0].iov_base = ((u_char *)&conn->conn_header) + + conn->conn_header_sent; + iov[0].iov_len = header_left; + iov[1].iov_base = buffer; + iov[1].iov_len = min(sizeof(buffer), payload_len); + len = writev(conn->conn_fd, iov, 2); if (len < 0) { tcpp_client_closeconn(conn); err(-1, "tcpp_client_handleconn: header write"); @@ -175,10 +187,14 @@ tcpp_client_handleconn(struct kevent *ke errx(-1, "tcpp_client_handleconn: header write " "premature EOF"); } - conn->conn_header_sent += len; + if (len > header_left) { + conn->conn_data_sent += (len - header_left); + conn->conn_header_sent += header_left; + } else + conn->conn_header_sent += len; } else { len = write(conn->conn_fd, buffer, min(sizeof(buffer), - bflag - conn->conn_data_sent)); + payload_len - conn->conn_data_sent)); if (len < 0) { tcpp_client_closeconn(conn); err(-1, "tcpp_client_handleconn: data write"); @@ -189,12 +205,12 @@ tcpp_client_handleconn(struct kevent *ke "premature EOF"); } conn->conn_data_sent += len; - if (conn->conn_data_sent >= bflag) { - /* - * All is well. - */ - tcpp_client_closeconn(conn); - } + } + if (conn->conn_data_sent >= payload_len) { + /* + * All is well. + */ + tcpp_client_closeconn(conn); } } @@ -261,6 +277,11 @@ tcpp_client(void) pid_t pid; int i, failed, status; + if (bflag < sizeof(struct tcpp_header)) + errx(-1, "Can't use -b less than %zu\n", + sizeof(struct tcpp_header)); + payload_len = bflag - sizeof(struct tcpp_header); + pid_list = malloc(sizeof(*pid_list) * pflag); if (pid_list == NULL) err(-1, "malloc pid_list"); Modified: stable/8/tools/tools/netrate/tcpp/tcpp_server.c ============================================================================== --- stable/8/tools/tools/netrate/tcpp/tcpp_server.c Tue Jun 1 14:21:24 2010 (r208700) +++ stable/8/tools/tools/netrate/tcpp/tcpp_server.c Tue Jun 1 14:26:27 2010 (r208701) @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -239,6 +240,10 @@ tcpp_server_worker(int workernum) if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEPORT, &i, sizeof(i)) < 0) err(-1, "setsockopt"); + i = 1; + if (setsockopt(listen_sock, IPPROTO_TCP, TCP_NODELAY, &i, sizeof(i)) + < 0) + err(-1, "setsockopt"); if (bind(listen_sock, (struct sockaddr *)&localipbase, sizeof(localipbase)) < 0) err(-1, "bind"); From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:29:27 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CC07106566B; Tue, 1 Jun 2010 14:29:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8ED8FC1B; Tue, 1 Jun 2010 14:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51ETRcO057233; Tue, 1 Jun 2010 14:29:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51ETR31057223; Tue, 1 Jun 2010 14:29:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006011429.o51ETR31057223@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jun 2010 14:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208702 - stable/8/sys/fs/coda X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:29:27 -0000 Author: rwatson Date: Tue Jun 1 14:29:26 2010 New Revision: 208702 URL: http://svn.freebsd.org/changeset/base/208702 Log: Merge r206210 from head to stable/7: Synchronize Coda kernel module definitions in our coda.h to Coda 6's coda.h: - CodaFid typdef -> struct CodaFid throughout. - Use unsigned int instead of unsigned long for venus_dirent and other cosmetic fixes. - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs. - Synchronize comments and macros. - Use u_int32_t instead of unsigned long for coda_out_hdr. With these changes, a 64-bit Coda kernel module now works with coda6_client, whereas previous userspace and kernel versions of RPCs differed sufficiently to prevent using the file system. This has been verified only with casual testing, but /coda is now usable for at least basic operations on amd64. Approved by: re (kensmith) Modified: stable/8/sys/fs/coda/cnode.h stable/8/sys/fs/coda/coda.h stable/8/sys/fs/coda/coda_subr.c stable/8/sys/fs/coda/coda_subr.h stable/8/sys/fs/coda/coda_venus.c stable/8/sys/fs/coda/coda_venus.h stable/8/sys/fs/coda/coda_vfsops.c stable/8/sys/fs/coda/coda_vfsops.h stable/8/sys/fs/coda/coda_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/coda/cnode.h ============================================================================== --- stable/8/sys/fs/coda/cnode.h Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/cnode.h Tue Jun 1 14:29:26 2010 (r208702) @@ -94,7 +94,7 @@ extern int coda_vfsop_print_entry; struct cnode { struct vnode *c_vnode; u_short c_flags; /* flags (see below) */ - CodaFid c_fid; /* file handle */ + struct CodaFid c_fid; /* file handle */ struct vnode *c_ovp; /* open vnode pointer */ u_short c_ocount; /* count of openers */ u_short c_owrite; /* count of open for write */ @@ -196,7 +196,8 @@ void coda_unmounting(struct mount *whoIa int coda_vmflush(struct cnode *cp); /* cfs_vnodeops.h */ -struct cnode *make_coda_node(CodaFid *fid, struct mount *vfsp, short type); +struct cnode *make_coda_node(struct CodaFid *fid, struct mount *vfsp, + short type); int coda_vnodeopstats_init(void); /* sigh */ Modified: stable/8/sys/fs/coda/coda.h ============================================================================== --- stable/8/sys/fs/coda/coda.h Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda.h Tue Jun 1 14:29:26 2010 (r208702) @@ -103,6 +103,8 @@ struct timespec { }; #endif +typedef u_int32_t cuid_t; +typedef u_int32_t cgid_t; /* * Cfs constants @@ -132,14 +134,13 @@ struct timespec { #define C_A_F_OK 0 /* Test for existence. */ - #ifndef _VENUS_DIRENT_T_ #define _VENUS_DIRENT_T_ 1 struct venus_dirent { - unsigned long d_fileno; /* file number of entry */ + unsigned int d_fileno; /* file number of entry */ unsigned short d_reclen; /* length of this record */ - char d_type; /* file type, see below */ - char d_namlen; /* length of string in d_name */ + unsigned char d_type; /* file type, see below */ + unsigned char d_namlen; /* length of string in d_name */ char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */ }; #undef DIRSIZ @@ -169,19 +170,19 @@ struct venus_dirent { #ifdef CODA_COMPAT_5 -typedef struct { +struct CodaFid { u_long Volume; u_long Vnode; u_long Unique; -} CodaFid; +}; -static __inline__ ino_t coda_f2i(CodaFid *fid) +static __inline__ ino_t coda_f2i(struct CodaFid *fid) { if (!fid) return 0; return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20)); } -static __inline__ char * coda_f2s(CodaFid *fid) +static __inline__ char * coda_f2s(struct CodaFid *fid) { static char fid_str [35]; snprintf (fid_str, 35, "[%lx.%lx.%lx]", fid->Volume, @@ -189,7 +190,7 @@ static __inline__ char * coda_f2s(CodaFi return fid_str; } -static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2) +static __inline__ int coda_fid_eq (struct CodaFid *fid1, struct CodaFid *fid2) { return (fid1->Volume == fid2->Volume && fid1->Vnode == fid2->Vnode && @@ -203,18 +204,18 @@ struct coda_cred { #else /* CODA_COMPAT_5 */ -typedef struct { +struct CodaFid { u_int32_t opaque[4]; -} CodaFid; +}; -static __inline__ ino_t coda_f2i(CodaFid *fid) +static __inline__ ino_t coda_f2i(struct CodaFid *fid) { if ( ! fid ) return 0; return (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]); } -static __inline__ char * coda_f2s(CodaFid *fid) +static __inline__ char * coda_f2s(struct CodaFid *fid) { static char fid_str [35]; snprintf (fid_str, 35, "[%x.%x.%x.%x]", fid->opaque[0], @@ -222,7 +223,7 @@ static __inline__ char * coda_f2s(CodaFi return fid_str; } -static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2) +static __inline__ int coda_fid_eq (struct CodaFid *fid1, struct CodaFid *fid2) { return (fid1->opaque[0] == fid2->opaque[0] && fid1->opaque[1] == fid2->opaque[1] && @@ -240,11 +241,11 @@ static __inline__ int coda_fid_eq (CodaF enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; struct coda_vattr { - int va_type; /* vnode type (for create) */ + long va_type; /* vnode type (for create) */ u_short va_mode; /* files access mode and type */ short va_nlink; /* number of references to file */ - uid_t va_uid; /* owner user id */ - gid_t va_gid; /* owner group id */ + cuid_t va_uid; /* owner user id */ + cgid_t va_gid; /* owner group id */ long va_fileid; /* file id */ u_quad_t va_size; /* file size in bytes */ long va_blocksize; /* blocksize preferred for i/o */ @@ -344,23 +345,23 @@ struct coda_in_hdr { struct coda_in_hdr { u_int32_t opcode; u_int32_t unique; /* Keep multiple outstanding msgs distinct */ - pid_t pid; /* Common to all */ - pid_t pgid; /* Common to all */ - uid_t uid; /* Common to all */ + pid_t pid; + pid_t pgid; + cuid_t uid; }; #endif /* Really important that opcode and unique are 1st two fields! */ struct coda_out_hdr { - unsigned long opcode; - unsigned long unique; - unsigned long result; + u_int32_t opcode; + u_int32_t unique; + u_int32_t result; }; /* coda_root: NO_IN */ struct coda_root_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; }; struct coda_root_in { @@ -373,7 +374,7 @@ struct coda_root_in { /* coda_open: */ struct coda_open_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int flags; }; @@ -387,7 +388,7 @@ struct coda_open_out { /* coda_close: */ struct coda_close_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int flags; }; @@ -398,7 +399,7 @@ struct coda_close_out { /* coda_ioctl: */ struct coda_ioctl_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int cmd; int len; int rwflag; @@ -415,7 +416,7 @@ struct coda_ioctl_out { /* coda_getattr: */ struct coda_getattr_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; }; struct coda_getattr_out { @@ -427,7 +428,7 @@ struct coda_getattr_out { /* coda_setattr: NO_OUT */ struct coda_setattr_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; struct coda_vattr attr; }; @@ -438,7 +439,7 @@ struct coda_setattr_out { /* coda_access: NO_OUT */ struct coda_access_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int flags; }; @@ -454,14 +455,14 @@ struct coda_access_out { /* coda_lookup: */ struct coda_lookup_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int name; /* Place holder for data. */ int flags; }; struct coda_lookup_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; int vtype; }; @@ -469,7 +470,7 @@ struct coda_lookup_out { /* coda_create: */ struct coda_create_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; struct coda_vattr attr; int excl; int mode; @@ -478,7 +479,7 @@ struct coda_create_in { struct coda_create_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; struct coda_vattr attr; }; @@ -486,7 +487,7 @@ struct coda_create_out { /* coda_remove: NO_OUT */ struct coda_remove_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int name; /* Place holder for data. */ }; @@ -497,8 +498,8 @@ struct coda_remove_out { /* coda_link: NO_OUT */ struct coda_link_in { struct coda_in_hdr ih; - CodaFid sourceFid; /* cnode to link *to* */ - CodaFid destFid; /* Directory in which to place link */ + struct CodaFid sourceFid; /* cnode to link *to* */ + struct CodaFid destFid; /* Directory in which to place link */ int tname; /* Place holder for data. */ }; @@ -510,9 +511,9 @@ struct coda_link_out { /* coda_rename: NO_OUT */ struct coda_rename_in { struct coda_in_hdr ih; - CodaFid sourceFid; + struct CodaFid sourceFid; int srcname; - CodaFid destFid; + struct CodaFid destFid; int destname; }; @@ -523,14 +524,14 @@ struct coda_rename_out { /* coda_mkdir: */ struct coda_mkdir_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; struct coda_vattr attr; int name; /* Place holder for data. */ }; struct coda_mkdir_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; struct coda_vattr attr; }; @@ -538,7 +539,7 @@ struct coda_mkdir_out { /* coda_rmdir: NO_OUT */ struct coda_rmdir_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int name; /* Place holder for data. */ }; @@ -549,7 +550,7 @@ struct coda_rmdir_out { /* coda_readdir: */ struct coda_readdir_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int count; int offset; }; @@ -563,7 +564,7 @@ struct coda_readdir_out { /* coda_symlink: NO_OUT */ struct coda_symlink_in { struct coda_in_hdr ih; - CodaFid Fid; /* Directory to put symlink in */ + struct CodaFid Fid; /* Directory to put symlink in */ int srcname; struct coda_vattr attr; int tname; @@ -576,7 +577,7 @@ struct coda_symlink_out { /* coda_readlink: */ struct coda_readlink_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; }; struct coda_readlink_out { @@ -589,7 +590,7 @@ struct coda_readlink_out { /* coda_fsync: NO_OUT */ struct coda_fsync_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; }; struct coda_fsync_out { @@ -599,18 +600,18 @@ struct coda_fsync_out { /* coda_inactive: NO_OUT */ struct coda_inactive_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; }; /* coda_vget: */ struct coda_vget_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; }; struct coda_vget_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; int vtype; }; @@ -626,7 +627,7 @@ struct coda_purgeuser_out { #ifdef CODA_COMPAT_5 struct coda_cred cred; #else - uid_t uid; + cuid_t uid; #endif }; @@ -634,14 +635,14 @@ struct coda_purgeuser_out { /* CODA_ZAPFILE is a venus->kernel call */ struct coda_zapfile_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; }; /* coda_zapdir: */ /* CODA_ZAPDIR is a venus->kernel call */ struct coda_zapdir_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; }; /* coda_zapnode: */ @@ -651,41 +652,44 @@ struct coda_zapvnode_out { #ifdef CODA_COMPAT_5 struct coda_cred cred; #endif - CodaFid Fid; + struct CodaFid Fid; }; /* coda_purgefid: */ /* CODA_PURGEFID is a venus->kernel call */ struct coda_purgefid_out { struct coda_out_hdr oh; - CodaFid Fid; + struct CodaFid Fid; }; /* coda_replace: */ /* CODA_REPLACE is a venus->kernel call */ struct coda_replace_out { /* coda_replace is a venus->kernel call */ struct coda_out_hdr oh; - CodaFid NewFid; - CodaFid OldFid; + struct CodaFid NewFid; + struct CodaFid OldFid; }; /* coda_open_by_fd: */ struct coda_open_by_fd_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int flags; }; struct coda_open_by_fd_out { struct coda_out_hdr oh; int fd; +#ifdef _KERNEL + /* not passed from userspace but used in-kernel only */ struct vnode *vp; +#endif }; /* coda_open_by_path: */ struct coda_open_by_path_in { struct coda_in_hdr ih; - CodaFid Fid; + struct CodaFid Fid; int flags; }; @@ -799,6 +803,9 @@ struct PioctlData { #define CODA_CONTROL ".CONTROL" #define CODA_CONTROLLEN 8 +#define CTL_VOL -1 +#define CTL_VNO -1 +#define CTL_UNI -1 #define CTL_INO -1 #define CTL_FILE "/coda/.CONTROL" @@ -810,10 +817,9 @@ struct PioctlData { #define INVAL_FID { 0, 0, 0 } #else #define CTL_FID { { -1, -1, -1, -1 } } -#define IS_CTL_FID(fidp) ((fidp)->opaque[0] == -1 &&\ - (fidp)->opaque[1] == -1 &&\ - (fidp)->opaque[2] == -1 &&\ - (fidp)->opaque[3] == -1) +#define IS_CTL_FID(fidp) ((fidp)->opaque[1] == CTL_VOL && \ + (fidp)->opaque[2] == CTL_VNO && \ + (fidp)->opaque[3] == CTL_UNI) #define INVAL_FID { { 0, 0, 0, 0 } } #endif Modified: stable/8/sys/fs/coda/coda_subr.c ============================================================================== --- stable/8/sys/fs/coda/coda_subr.c Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_subr.c Tue Jun 1 14:29:26 2010 (r208702) @@ -164,7 +164,7 @@ coda_unsave(struct cnode *cp) * NOTE: this allows multiple cnodes with same fid -- dcs 1/25/95 */ struct cnode * -coda_find(CodaFid *fid) +coda_find(struct CodaFid *fid) { struct cnode *cp; Modified: stable/8/sys/fs/coda/coda_subr.h ============================================================================== --- stable/8/sys/fs/coda/coda_subr.h Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_subr.h Tue Jun 1 14:29:26 2010 (r208702) @@ -35,7 +35,7 @@ struct cnode *coda_alloc(void); void coda_free(struct cnode *cp); -struct cnode *coda_find(CodaFid *fid); +struct cnode *coda_find(struct CodaFid *fid); void coda_flush(struct coda_mntinfo *mnt, enum dc_status dcstat); void coda_testflush(void); void coda_checkunmounting(struct mount *mp); Modified: stable/8/sys/fs/coda/coda_venus.c ============================================================================== --- stable/8/sys/fs/coda/coda_venus.c Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_venus.c Tue Jun 1 14:29:26 2010 (r208702) @@ -177,7 +177,7 @@ int coda_kernel_version = CODA_KERNEL_VE int venus_root(void *mdp, struct ucred *cred, struct proc *p, - /*out*/ CodaFid *VFid) + /*out*/ struct CodaFid *VFid) { DECL_NO_IN(coda_root); /* sets Isize & Osize */ ALLOC_NO_IN(coda_root); /* sets inp & outp */ @@ -194,7 +194,7 @@ venus_root(void *mdp, struct ucred *cred } int -venus_open(void *mdp, CodaFid *fid, int flag, struct ucred *cred, +venus_open(void *mdp, struct CodaFid *fid, int flag, struct ucred *cred, struct proc *p, /*out*/ struct vnode **vp) { int cflag; @@ -215,7 +215,7 @@ venus_open(void *mdp, CodaFid *fid, int } int -venus_close(void *mdp, CodaFid *fid, int flag, struct ucred *cred, +venus_close(void *mdp, struct CodaFid *fid, int flag, struct ucred *cred, struct proc *p) { int cflag; @@ -252,7 +252,7 @@ venus_write(void) * normal files. */ int -venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data, +venus_ioctl(void *mdp, struct CodaFid *fid, int com, int flag, caddr_t data, struct ucred *cred, struct proc *p) { DECL(coda_ioctl); /* sets Isize & Osize */ @@ -304,7 +304,8 @@ venus_ioctl(void *mdp, CodaFid *fid, int } int -venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct vattr *vap) +venus_getattr(void *mdp, struct CodaFid *fid, struct ucred *cred, + struct vattr *vap) { struct proc *p; DECL(coda_getattr); /* sets Isize & Osize */ @@ -326,7 +327,8 @@ venus_getattr(void *mdp, CodaFid *fid, s } int -venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred) +venus_setattr(void *mdp, struct CodaFid *fid, struct vattr *vap, + struct ucred *cred) { struct proc *p; DECL_NO_OUT(coda_setattr); /* sets Isize & Osize */ @@ -347,8 +349,8 @@ venus_setattr(void *mdp, CodaFid *fid, s } int -venus_access(void *mdp, CodaFid *fid, accmode_t accmode, struct ucred *cred, - struct proc *p) +venus_access(void *mdp, struct CodaFid *fid, accmode_t accmode, + struct ucred *cred, struct proc *p) { DECL_NO_OUT(coda_access); /* sets Isize & Osize */ ALLOC_NO_OUT(coda_access); /* sets inp & outp */ @@ -374,8 +376,8 @@ venus_access(void *mdp, CodaFid *fid, ac } int -venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p, - /*out*/ char **str, int *len) +venus_readlink(void *mdp, struct CodaFid *fid, struct ucred *cred, + struct proc *p, /*out*/ char **str, int *len) { DECL(coda_readlink); /* sets Isize & Osize */ coda_readlink_size += CODA_MAXPATHLEN; @@ -400,7 +402,7 @@ venus_readlink(void *mdp, CodaFid *fid, } int -venus_fsync(void *mdp, CodaFid *fid, struct proc *p) +venus_fsync(void *mdp, struct CodaFid *fid, struct proc *p) { DECL_NO_OUT(coda_fsync); /* sets Isize & Osize */ ALLOC_NO_OUT(coda_fsync); /* sets inp & outp */ @@ -420,8 +422,9 @@ venus_fsync(void *mdp, CodaFid *fid, str } int -venus_lookup(void *mdp, CodaFid *fid, const char *nm, int len, - struct ucred *cred, struct proc *p, /*out*/ CodaFid *VFid, int *vtype) +venus_lookup(void *mdp, struct CodaFid *fid, const char *nm, int len, + struct ucred *cred, struct proc *p, /*out*/ struct CodaFid *VFid, + int *vtype) { DECL(coda_lookup); /* sets Isize & Osize */ coda_lookup_size += len + 1; @@ -457,9 +460,9 @@ venus_lookup(void *mdp, CodaFid *fid, co } int -venus_create(void *mdp, CodaFid *fid, const char *nm, int len, int exclusive, - int mode, struct vattr *va, struct ucred *cred, struct proc *p, - /*out*/ CodaFid *VFid, struct vattr *attr) +venus_create(void *mdp, struct CodaFid *fid, const char *nm, int len, + int exclusive, int mode, struct vattr *va, struct ucred *cred, + struct proc *p, /*out*/ struct CodaFid *VFid, struct vattr *attr) { DECL(coda_create); /* sets Isize & Osize */ coda_create_size += len + 1; @@ -488,7 +491,7 @@ venus_create(void *mdp, CodaFid *fid, co } int -venus_remove(void *mdp, CodaFid *fid, const char *nm, int len, +venus_remove(void *mdp, struct CodaFid *fid, const char *nm, int len, struct ucred *cred, struct proc *p) { DECL_NO_OUT(coda_remove); /* sets Isize & Osize */ @@ -511,8 +514,8 @@ venus_remove(void *mdp, CodaFid *fid, co } int -venus_link(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, int len, - struct ucred *cred, struct proc *p) +venus_link(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, + const char *nm, int len, struct ucred *cred, struct proc *p) { DECL_NO_OUT(coda_link); /* sets Isize & Osize */ coda_link_size += len + 1; @@ -535,8 +538,9 @@ venus_link(void *mdp, CodaFid *fid, Coda } int -venus_rename(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, int len, - const char *tnm, int tlen, struct ucred *cred, struct proc *p) +venus_rename(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, + const char *nm, int len, const char *tnm, int tlen, struct ucred *cred, + struct proc *p) { DECL_NO_OUT(coda_rename); /* sets Isize & Osize */ coda_rename_size += len + 1 + tlen + 1; @@ -562,9 +566,9 @@ venus_rename(void *mdp, CodaFid *fid, Co } int -venus_mkdir(void *mdp, CodaFid *fid, const char *nm, int len, +venus_mkdir(void *mdp, struct CodaFid *fid, const char *nm, int len, struct vattr *va, struct ucred *cred, struct proc *p, - /*out*/ CodaFid *VFid, struct vattr *ova) + /*out*/ struct CodaFid *VFid, struct vattr *ova) { DECL(coda_mkdir); /* sets Isize & Osize */ coda_mkdir_size += len + 1; @@ -591,7 +595,7 @@ venus_mkdir(void *mdp, CodaFid *fid, con } int -venus_rmdir(void *mdp, CodaFid *fid, const char *nm, int len, +venus_rmdir(void *mdp, struct CodaFid *fid, const char *nm, int len, struct ucred *cred, struct proc *p) { DECL_NO_OUT(coda_rmdir); /* sets Isize & Osize */ @@ -614,7 +618,7 @@ venus_rmdir(void *mdp, CodaFid *fid, con } int -venus_symlink(void *mdp, CodaFid *fid, const char *lnm, int llen, +venus_symlink(void *mdp, struct CodaFid *fid, const char *lnm, int llen, const char *nm, int len, struct vattr *va, struct ucred *cred, struct proc *p) { @@ -645,7 +649,7 @@ venus_symlink(void *mdp, CodaFid *fid, c * XXX: Unused. */ int -venus_readdir(void *mdp, CodaFid *fid, int count, int offset, +venus_readdir(void *mdp, struct CodaFid *fid, int count, int offset, struct ucred *cred, struct proc *p, /*out*/ char *buffer, int *len) { DECL(coda_readdir); /* sets Isize & Osize */ @@ -672,8 +676,8 @@ venus_readdir(void *mdp, CodaFid *fid, i } int -venus_fhtovp(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p, - /*out*/ CodaFid *VFid, int *vtype) +venus_fhtovp(void *mdp, struct CodaFid *fid, struct ucred *cred, + struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype) { DECL(coda_vget); /* sets Isize & Osize */ ALLOC(coda_vget); /* sets inp & outp */ Modified: stable/8/sys/fs/coda/coda_venus.h ============================================================================== --- stable/8/sys/fs/coda/coda_venus.h Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_venus.h Tue Jun 1 14:29:26 2010 (r208702) @@ -34,49 +34,50 @@ #define _CODA_VENUS_H_ int venus_root(void *mdp, struct ucred *cred, struct proc *p, - /*out*/ CodaFid *VFid); -int venus_open(void *mdp, CodaFid *fid, int flag, struct ucred *cred, - struct proc *p, /*out*/ struct vnode **vp); -int venus_close(void *mdp, CodaFid *fid, int flag, struct ucred *cred, - struct proc *p); + /*out*/ struct CodaFid *VFid); +int venus_open(void *mdp, struct CodaFid *fid, int flag, + struct ucred *cred, struct proc *p, /*out*/ struct vnode **vp); +int venus_close(void *mdp, struct CodaFid *fid, int flag, + struct ucred *cred, struct proc *p); void venus_read(void); void venus_write(void); -int venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data, - struct ucred *cred, struct proc *p); -int venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, +int venus_ioctl(void *mdp, struct CodaFid *fid, int com, int flag, + caddr_t data, struct ucred *cred, struct proc *p); +int venus_getattr(void *mdp, struct CodaFid *fid, struct ucred *cred, struct vattr *vap); -int venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, +int venus_setattr(void *mdp, struct CodaFid *fid, struct vattr *vap, struct ucred *cred); -int venus_access(void *mdp, CodaFid *fid, int mode, struct ucred *cred, - struct proc *p); -int venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred, +int venus_access(void *mdp, struct CodaFid *fid, int mode, + struct ucred *cred, struct proc *p); +int venus_readlink(void *mdp, struct CodaFid *fid, struct ucred *cred, struct proc *p, /*out*/ char **str, int *len); -int venus_fsync(void *mdp, CodaFid *fid, struct proc *p); -int venus_lookup(void *mdp, CodaFid *fid, const char *nm, int len, - struct ucred *cred, struct proc *p, /*out*/ CodaFid *VFid, +int venus_fsync(void *mdp, struct CodaFid *fid, struct proc *p); +int venus_lookup(void *mdp, struct CodaFid *fid, const char *nm, int len, + struct ucred *cred, struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype); -int venus_create(void *mdp, CodaFid *fid, const char *nm, int len, +int venus_create(void *mdp, struct CodaFid *fid, const char *nm, int len, int exclusive, int mode, struct vattr *va, struct ucred *cred, - struct proc *p, /*out*/ CodaFid *VFid, struct vattr *attr); -int venus_remove(void *mdp, CodaFid *fid, const char *nm, int len, + struct proc *p, /*out*/ struct CodaFid *VFid, + struct vattr *attr); +int venus_remove(void *mdp, struct CodaFid *fid, const char *nm, int len, struct ucred *cred, struct proc *p); -int venus_link(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, - int len, struct ucred *cred, struct proc *p); -int venus_rename(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, - int len, const char *tnm, int tlen, struct ucred *cred, - struct proc *p); -int venus_mkdir(void *mdp, CodaFid *fid, const char *nm, int len, +int venus_link(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, + const char *nm, int len, struct ucred *cred, struct proc *p); +int venus_rename(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, + const char *nm, int len, const char *tnm, int tlen, + struct ucred *cred, struct proc *p); +int venus_mkdir(void *mdp, struct CodaFid *fid, const char *nm, int len, struct vattr *va, struct ucred *cred, struct proc *p, - /*out*/ CodaFid *VFid, struct vattr *ova); -int venus_rmdir(void *mdp, CodaFid *fid, const char *nm, int len, + /*out*/ struct CodaFid *VFid, struct vattr *ova); +int venus_rmdir(void *mdp, struct CodaFid *fid, const char *nm, int len, + struct ucred *cred, struct proc *p); +int venus_symlink(void *mdp, struct CodaFid *fid, const char *lnm, + int llen, const char *nm, int len, struct vattr *va, struct ucred *cred, struct proc *p); -int venus_symlink(void *mdp, CodaFid *fid, const char *lnm, int llen, - const char *nm, int len, struct vattr *va, struct ucred *cred, - struct proc *p); -int venus_readdir(void *mdp, CodaFid *fid, int count, int offset, +int venus_readdir(void *mdp, struct CodaFid *fid, int count, int offset, struct ucred *cred, struct proc *p, /*out*/ char *buffer, int *len); -int venus_fhtovp(void *mdp, CodaFid *fid, struct ucred *cred, - struct proc *p, /*out*/ CodaFid *VFid, int *vtype); +int venus_fhtovp(void *mdp, struct CodaFid *fid, struct ucred *cred, + struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype); #endif /* !_CODA_VENUS_H_ */ Modified: stable/8/sys/fs/coda/coda_vfsops.c ============================================================================== --- stable/8/sys/fs/coda/coda_vfsops.c Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_vfsops.c Tue Jun 1 14:29:26 2010 (r208702) @@ -113,8 +113,8 @@ coda_mount(struct mount *vfsp) struct cdev *dev; struct coda_mntinfo *mi; struct vnode *rootvp; - CodaFid rootfid = INVAL_FID; - CodaFid ctlfid = CTL_FID; + struct CodaFid rootfid = INVAL_FID; + struct CodaFid ctlfid = CTL_FID; int error; struct nameidata ndp; ENTRY; @@ -268,8 +268,8 @@ coda_root(struct mount *vfsp, int flags, int error; struct proc *p; struct thread *td; - CodaFid VFid; - static const CodaFid invalfid = INVAL_FID; + struct CodaFid VFid; + static const struct CodaFid invalfid = INVAL_FID; td = curthread; p = td->td_proc; @@ -288,7 +288,7 @@ coda_root(struct mount *vfsp, int flags, * but not in any released versions as of 6 Mar 2003. */ if (memcmp(&VTOC(mi->mi_rootvp)->c_fid, &invalfid, - sizeof(CodaFid)) != 0 || mi->mi_started == 0) { + sizeof(struct CodaFid)) != 0 || mi->mi_started == 0) { /* * Found valid root. */ @@ -407,7 +407,7 @@ coda_fhtovp(struct mount *vfsp, struct f int error; struct thread *td = curthread; /* XXX -mach */ struct proc *p = td->td_proc; - CodaFid VFid; + struct CodaFid VFid; int vtype; ENTRY; Modified: stable/8/sys/fs/coda/coda_vfsops.h ============================================================================== --- stable/8/sys/fs/coda/coda_vfsops.h Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_vfsops.h Tue Jun 1 14:29:26 2010 (r208702) @@ -42,7 +42,7 @@ struct cfid { u_short cfid_len; u_short padding; - CodaFid cfid_fid; + struct CodaFid cfid_fid; }; struct mbuf; Modified: stable/8/sys/fs/coda/coda_vnops.c ============================================================================== --- stable/8/sys/fs/coda/coda_vnops.c Tue Jun 1 14:26:27 2010 (r208701) +++ stable/8/sys/fs/coda/coda_vnops.c Tue Jun 1 14:29:26 2010 (r208702) @@ -872,7 +872,7 @@ coda_lookup(struct vop_cachedlookup_args struct cnode *cp; const char *nm = cnp->cn_nameptr; int len = cnp->cn_namelen; - CodaFid VFid; + struct CodaFid VFid; int vtype; int error = 0; @@ -1009,7 +1009,7 @@ coda_create(struct vop_create_args *ap) struct cnode *cp; const char *nm = cnp->cn_nameptr; int len = cnp->cn_namelen; - CodaFid VFid; + struct CodaFid VFid; struct vattr attr; MARK_ENTRY(CODA_CREATE_STATS); @@ -1278,7 +1278,7 @@ coda_mkdir(struct vop_mkdir_args *ap) const char *nm = cnp->cn_nameptr; int len = cnp->cn_namelen; struct cnode *cp; - CodaFid VFid; + struct CodaFid VFid; struct vattr ova; MARK_ENTRY(CODA_MKDIR_STATS); @@ -1687,7 +1687,7 @@ coda_print_cred(struct ucred *cred) * coda_unsave. */ struct cnode * -make_coda_node(CodaFid *fid, struct mount *vfsp, short type) +make_coda_node(struct CodaFid *fid, struct mount *vfsp, short type) { struct cnode *cp; struct vnode *vp; From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 14:39:03 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D808A106566B; Tue, 1 Jun 2010 14:39:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B0EAF8FC21; Tue, 1 Jun 2010 14:39:03 +0000 (UTC) Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk [128.232.18.47]) by cyrus.watson.org (Postfix) with ESMTPSA id C1E7846B8E; Tue, 1 Jun 2010 10:39:02 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <2E4C7566-1F0E-4A44-8514-061FF1E129DE@gmail.com> Date: Tue, 1 Jun 2010 15:39:01 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <57DF5801-1685-4C69-9FD3-E56F5425E28C@FreeBSD.org> References: <201006011359.o51DxmSW050166@svn.freebsd.org> <2E4C7566-1F0E-4A44-8514-061FF1E129DE@gmail.com> To: Nikolay Denev X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208692 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 14:39:04 -0000 On 1 Jun 2010, at 15:23, Nikolay Denev wrote: >> When close() is called on a connected socket pair, SO_ISCONNECTED = might be >> set but be cleared before the call to sodisconnect(). In this = case, >> ENOTCONN is returned: suppress this error rather than returning it = to >> userspace so that close() doesn't report an error improperly. >>=20 >> PR: kern/144061 >> Reported by: Matt Reimer , >> Nikolay Denev , >> Mikolaj Golub > I wonder, does this affect RELENG_7 ? (can't test at the moment, but = sys/kern/uipc_socket.c:soclose() looks similar) Yes, almost certainly -- if it doesn't manifest, it's just because of = timing differences, not because the bug isn't present. I'll look at = merging it to 7.x as well. Robert= From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 15:11:18 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 662641065673; Tue, 1 Jun 2010 15:11:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F35618FC15; Tue, 1 Jun 2010 15:11:17 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id A620746C0A; Tue, 1 Jun 2010 11:11:17 -0400 (EDT) Date: Tue, 1 Jun 2010 16:11:17 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org In-Reply-To: <201006011429.o51ETR31057223@svn.freebsd.org> Message-ID: References: <201006011429.o51ETR31057223@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r208702 - stable/8/sys/fs/coda X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 15:11:18 -0000 On Tue, 1 Jun 2010, Robert Watson wrote: > Log: > Merge r206210 from head to stable/7: Should, of course, read stable/8... Robert > > Synchronize Coda kernel module definitions in our coda.h to Coda 6's > coda.h: > > - CodaFid typdef -> struct CodaFid throughout. > - Use unsigned int instead of unsigned long for venus_dirent and other > cosmetic fixes. > - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs. > - Synchronize comments and macros. > - Use u_int32_t instead of unsigned long for coda_out_hdr. > > With these changes, a 64-bit Coda kernel module now works with > coda6_client, whereas previous userspace and kernel versions of RPCs > differed sufficiently to prevent using the file system. This has been > verified only with casual testing, but /coda is now usable for at least > basic operations on amd64. > > Approved by: re (kensmith) > > Modified: > stable/8/sys/fs/coda/cnode.h > stable/8/sys/fs/coda/coda.h > stable/8/sys/fs/coda/coda_subr.c > stable/8/sys/fs/coda/coda_subr.h > stable/8/sys/fs/coda/coda_venus.c > stable/8/sys/fs/coda/coda_venus.h > stable/8/sys/fs/coda/coda_vfsops.c > stable/8/sys/fs/coda/coda_vfsops.h > stable/8/sys/fs/coda/coda_vnops.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > stable/8/sys/geom/sched/ (props changed) > > Modified: stable/8/sys/fs/coda/cnode.h > ============================================================================== > --- stable/8/sys/fs/coda/cnode.h Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/cnode.h Tue Jun 1 14:29:26 2010 (r208702) > @@ -94,7 +94,7 @@ extern int coda_vfsop_print_entry; > struct cnode { > struct vnode *c_vnode; > u_short c_flags; /* flags (see below) */ > - CodaFid c_fid; /* file handle */ > + struct CodaFid c_fid; /* file handle */ > struct vnode *c_ovp; /* open vnode pointer */ > u_short c_ocount; /* count of openers */ > u_short c_owrite; /* count of open for write */ > @@ -196,7 +196,8 @@ void coda_unmounting(struct mount *whoIa > int coda_vmflush(struct cnode *cp); > > /* cfs_vnodeops.h */ > -struct cnode *make_coda_node(CodaFid *fid, struct mount *vfsp, short type); > +struct cnode *make_coda_node(struct CodaFid *fid, struct mount *vfsp, > + short type); > int coda_vnodeopstats_init(void); > > /* sigh */ > > Modified: stable/8/sys/fs/coda/coda.h > ============================================================================== > --- stable/8/sys/fs/coda/coda.h Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda.h Tue Jun 1 14:29:26 2010 (r208702) > @@ -103,6 +103,8 @@ struct timespec { > }; > #endif > > +typedef u_int32_t cuid_t; > +typedef u_int32_t cgid_t; > > /* > * Cfs constants > @@ -132,14 +134,13 @@ struct timespec { > #define C_A_F_OK 0 /* Test for existence. */ > > > - > #ifndef _VENUS_DIRENT_T_ > #define _VENUS_DIRENT_T_ 1 > struct venus_dirent { > - unsigned long d_fileno; /* file number of entry */ > + unsigned int d_fileno; /* file number of entry */ > unsigned short d_reclen; /* length of this record */ > - char d_type; /* file type, see below */ > - char d_namlen; /* length of string in d_name */ > + unsigned char d_type; /* file type, see below */ > + unsigned char d_namlen; /* length of string in d_name */ > char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */ > }; > #undef DIRSIZ > @@ -169,19 +170,19 @@ struct venus_dirent { > > #ifdef CODA_COMPAT_5 > > -typedef struct { > +struct CodaFid { > u_long Volume; > u_long Vnode; > u_long Unique; > -} CodaFid; > +}; > > -static __inline__ ino_t coda_f2i(CodaFid *fid) > +static __inline__ ino_t coda_f2i(struct CodaFid *fid) > { > if (!fid) return 0; > return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20)); > } > > -static __inline__ char * coda_f2s(CodaFid *fid) > +static __inline__ char * coda_f2s(struct CodaFid *fid) > { > static char fid_str [35]; > snprintf (fid_str, 35, "[%lx.%lx.%lx]", fid->Volume, > @@ -189,7 +190,7 @@ static __inline__ char * coda_f2s(CodaFi > return fid_str; > } > > -static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2) > +static __inline__ int coda_fid_eq (struct CodaFid *fid1, struct CodaFid *fid2) > { > return (fid1->Volume == fid2->Volume && > fid1->Vnode == fid2->Vnode && > @@ -203,18 +204,18 @@ struct coda_cred { > > #else /* CODA_COMPAT_5 */ > > -typedef struct { > +struct CodaFid { > u_int32_t opaque[4]; > -} CodaFid; > +}; > > -static __inline__ ino_t coda_f2i(CodaFid *fid) > +static __inline__ ino_t coda_f2i(struct CodaFid *fid) > { > if ( ! fid ) > return 0; > return (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]); > } > > -static __inline__ char * coda_f2s(CodaFid *fid) > +static __inline__ char * coda_f2s(struct CodaFid *fid) > { > static char fid_str [35]; > snprintf (fid_str, 35, "[%x.%x.%x.%x]", fid->opaque[0], > @@ -222,7 +223,7 @@ static __inline__ char * coda_f2s(CodaFi > return fid_str; > } > > -static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2) > +static __inline__ int coda_fid_eq (struct CodaFid *fid1, struct CodaFid *fid2) > { > return (fid1->opaque[0] == fid2->opaque[0] && > fid1->opaque[1] == fid2->opaque[1] && > @@ -240,11 +241,11 @@ static __inline__ int coda_fid_eq (CodaF > enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; > > struct coda_vattr { > - int va_type; /* vnode type (for create) */ > + long va_type; /* vnode type (for create) */ > u_short va_mode; /* files access mode and type */ > short va_nlink; /* number of references to file */ > - uid_t va_uid; /* owner user id */ > - gid_t va_gid; /* owner group id */ > + cuid_t va_uid; /* owner user id */ > + cgid_t va_gid; /* owner group id */ > long va_fileid; /* file id */ > u_quad_t va_size; /* file size in bytes */ > long va_blocksize; /* blocksize preferred for i/o */ > @@ -344,23 +345,23 @@ struct coda_in_hdr { > struct coda_in_hdr { > u_int32_t opcode; > u_int32_t unique; /* Keep multiple outstanding msgs distinct */ > - pid_t pid; /* Common to all */ > - pid_t pgid; /* Common to all */ > - uid_t uid; /* Common to all */ > + pid_t pid; > + pid_t pgid; > + cuid_t uid; > }; > #endif > > /* Really important that opcode and unique are 1st two fields! */ > struct coda_out_hdr { > - unsigned long opcode; > - unsigned long unique; > - unsigned long result; > + u_int32_t opcode; > + u_int32_t unique; > + u_int32_t result; > }; > > /* coda_root: NO_IN */ > struct coda_root_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > struct coda_root_in { > @@ -373,7 +374,7 @@ struct coda_root_in { > /* coda_open: */ > struct coda_open_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int flags; > }; > > @@ -387,7 +388,7 @@ struct coda_open_out { > /* coda_close: */ > struct coda_close_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int flags; > }; > > @@ -398,7 +399,7 @@ struct coda_close_out { > /* coda_ioctl: */ > struct coda_ioctl_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int cmd; > int len; > int rwflag; > @@ -415,7 +416,7 @@ struct coda_ioctl_out { > /* coda_getattr: */ > struct coda_getattr_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > struct coda_getattr_out { > @@ -427,7 +428,7 @@ struct coda_getattr_out { > /* coda_setattr: NO_OUT */ > struct coda_setattr_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > struct coda_vattr attr; > }; > > @@ -438,7 +439,7 @@ struct coda_setattr_out { > /* coda_access: NO_OUT */ > struct coda_access_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int flags; > }; > > @@ -454,14 +455,14 @@ struct coda_access_out { > /* coda_lookup: */ > struct coda_lookup_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int name; /* Place holder for data. */ > int flags; > }; > > struct coda_lookup_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > int vtype; > }; > > @@ -469,7 +470,7 @@ struct coda_lookup_out { > /* coda_create: */ > struct coda_create_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > struct coda_vattr attr; > int excl; > int mode; > @@ -478,7 +479,7 @@ struct coda_create_in { > > struct coda_create_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > struct coda_vattr attr; > }; > > @@ -486,7 +487,7 @@ struct coda_create_out { > /* coda_remove: NO_OUT */ > struct coda_remove_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int name; /* Place holder for data. */ > }; > > @@ -497,8 +498,8 @@ struct coda_remove_out { > /* coda_link: NO_OUT */ > struct coda_link_in { > struct coda_in_hdr ih; > - CodaFid sourceFid; /* cnode to link *to* */ > - CodaFid destFid; /* Directory in which to place link */ > + struct CodaFid sourceFid; /* cnode to link *to* */ > + struct CodaFid destFid; /* Directory in which to place link */ > int tname; /* Place holder for data. */ > }; > > @@ -510,9 +511,9 @@ struct coda_link_out { > /* coda_rename: NO_OUT */ > struct coda_rename_in { > struct coda_in_hdr ih; > - CodaFid sourceFid; > + struct CodaFid sourceFid; > int srcname; > - CodaFid destFid; > + struct CodaFid destFid; > int destname; > }; > > @@ -523,14 +524,14 @@ struct coda_rename_out { > /* coda_mkdir: */ > struct coda_mkdir_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > struct coda_vattr attr; > int name; /* Place holder for data. */ > }; > > struct coda_mkdir_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > struct coda_vattr attr; > }; > > @@ -538,7 +539,7 @@ struct coda_mkdir_out { > /* coda_rmdir: NO_OUT */ > struct coda_rmdir_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int name; /* Place holder for data. */ > }; > > @@ -549,7 +550,7 @@ struct coda_rmdir_out { > /* coda_readdir: */ > struct coda_readdir_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int count; > int offset; > }; > @@ -563,7 +564,7 @@ struct coda_readdir_out { > /* coda_symlink: NO_OUT */ > struct coda_symlink_in { > struct coda_in_hdr ih; > - CodaFid Fid; /* Directory to put symlink in */ > + struct CodaFid Fid; /* Directory to put symlink in */ > int srcname; > struct coda_vattr attr; > int tname; > @@ -576,7 +577,7 @@ struct coda_symlink_out { > /* coda_readlink: */ > struct coda_readlink_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > struct coda_readlink_out { > @@ -589,7 +590,7 @@ struct coda_readlink_out { > /* coda_fsync: NO_OUT */ > struct coda_fsync_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > struct coda_fsync_out { > @@ -599,18 +600,18 @@ struct coda_fsync_out { > /* coda_inactive: NO_OUT */ > struct coda_inactive_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > /* coda_vget: */ > struct coda_vget_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > struct coda_vget_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > int vtype; > }; > > @@ -626,7 +627,7 @@ struct coda_purgeuser_out { > #ifdef CODA_COMPAT_5 > struct coda_cred cred; > #else > - uid_t uid; > + cuid_t uid; > #endif > }; > > @@ -634,14 +635,14 @@ struct coda_purgeuser_out { > /* CODA_ZAPFILE is a venus->kernel call */ > struct coda_zapfile_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > /* coda_zapdir: */ > /* CODA_ZAPDIR is a venus->kernel call */ > struct coda_zapdir_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > /* coda_zapnode: */ > @@ -651,41 +652,44 @@ struct coda_zapvnode_out { > #ifdef CODA_COMPAT_5 > struct coda_cred cred; > #endif > - CodaFid Fid; > + struct CodaFid Fid; > }; > > /* coda_purgefid: */ > /* CODA_PURGEFID is a venus->kernel call */ > struct coda_purgefid_out { > struct coda_out_hdr oh; > - CodaFid Fid; > + struct CodaFid Fid; > }; > > /* coda_replace: */ > /* CODA_REPLACE is a venus->kernel call */ > struct coda_replace_out { /* coda_replace is a venus->kernel call */ > struct coda_out_hdr oh; > - CodaFid NewFid; > - CodaFid OldFid; > + struct CodaFid NewFid; > + struct CodaFid OldFid; > }; > > /* coda_open_by_fd: */ > struct coda_open_by_fd_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int flags; > }; > > struct coda_open_by_fd_out { > struct coda_out_hdr oh; > int fd; > +#ifdef _KERNEL > + /* not passed from userspace but used in-kernel only */ > struct vnode *vp; > +#endif > }; > > /* coda_open_by_path: */ > struct coda_open_by_path_in { > struct coda_in_hdr ih; > - CodaFid Fid; > + struct CodaFid Fid; > int flags; > }; > > @@ -799,6 +803,9 @@ struct PioctlData { > > #define CODA_CONTROL ".CONTROL" > #define CODA_CONTROLLEN 8 > +#define CTL_VOL -1 > +#define CTL_VNO -1 > +#define CTL_UNI -1 > #define CTL_INO -1 > #define CTL_FILE "/coda/.CONTROL" > > @@ -810,10 +817,9 @@ struct PioctlData { > #define INVAL_FID { 0, 0, 0 } > #else > #define CTL_FID { { -1, -1, -1, -1 } } > -#define IS_CTL_FID(fidp) ((fidp)->opaque[0] == -1 &&\ > - (fidp)->opaque[1] == -1 &&\ > - (fidp)->opaque[2] == -1 &&\ > - (fidp)->opaque[3] == -1) > +#define IS_CTL_FID(fidp) ((fidp)->opaque[1] == CTL_VOL && \ > + (fidp)->opaque[2] == CTL_VNO && \ > + (fidp)->opaque[3] == CTL_UNI) > #define INVAL_FID { { 0, 0, 0, 0 } } > #endif > > > Modified: stable/8/sys/fs/coda/coda_subr.c > ============================================================================== > --- stable/8/sys/fs/coda/coda_subr.c Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_subr.c Tue Jun 1 14:29:26 2010 (r208702) > @@ -164,7 +164,7 @@ coda_unsave(struct cnode *cp) > * NOTE: this allows multiple cnodes with same fid -- dcs 1/25/95 > */ > struct cnode * > -coda_find(CodaFid *fid) > +coda_find(struct CodaFid *fid) > { > struct cnode *cp; > > > Modified: stable/8/sys/fs/coda/coda_subr.h > ============================================================================== > --- stable/8/sys/fs/coda/coda_subr.h Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_subr.h Tue Jun 1 14:29:26 2010 (r208702) > @@ -35,7 +35,7 @@ > > struct cnode *coda_alloc(void); > void coda_free(struct cnode *cp); > -struct cnode *coda_find(CodaFid *fid); > +struct cnode *coda_find(struct CodaFid *fid); > void coda_flush(struct coda_mntinfo *mnt, enum dc_status dcstat); > void coda_testflush(void); > void coda_checkunmounting(struct mount *mp); > > Modified: stable/8/sys/fs/coda/coda_venus.c > ============================================================================== > --- stable/8/sys/fs/coda/coda_venus.c Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_venus.c Tue Jun 1 14:29:26 2010 (r208702) > @@ -177,7 +177,7 @@ int coda_kernel_version = CODA_KERNEL_VE > > int > venus_root(void *mdp, struct ucred *cred, struct proc *p, > - /*out*/ CodaFid *VFid) > + /*out*/ struct CodaFid *VFid) > { > DECL_NO_IN(coda_root); /* sets Isize & Osize */ > ALLOC_NO_IN(coda_root); /* sets inp & outp */ > @@ -194,7 +194,7 @@ venus_root(void *mdp, struct ucred *cred > } > > int > -venus_open(void *mdp, CodaFid *fid, int flag, struct ucred *cred, > +venus_open(void *mdp, struct CodaFid *fid, int flag, struct ucred *cred, > struct proc *p, /*out*/ struct vnode **vp) > { > int cflag; > @@ -215,7 +215,7 @@ venus_open(void *mdp, CodaFid *fid, int > } > > int > -venus_close(void *mdp, CodaFid *fid, int flag, struct ucred *cred, > +venus_close(void *mdp, struct CodaFid *fid, int flag, struct ucred *cred, > struct proc *p) > { > int cflag; > @@ -252,7 +252,7 @@ venus_write(void) > * normal files. > */ > int > -venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data, > +venus_ioctl(void *mdp, struct CodaFid *fid, int com, int flag, caddr_t data, > struct ucred *cred, struct proc *p) > { > DECL(coda_ioctl); /* sets Isize & Osize */ > @@ -304,7 +304,8 @@ venus_ioctl(void *mdp, CodaFid *fid, int > } > > int > -venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct vattr *vap) > +venus_getattr(void *mdp, struct CodaFid *fid, struct ucred *cred, > + struct vattr *vap) > { > struct proc *p; > DECL(coda_getattr); /* sets Isize & Osize */ > @@ -326,7 +327,8 @@ venus_getattr(void *mdp, CodaFid *fid, s > } > > int > -venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred) > +venus_setattr(void *mdp, struct CodaFid *fid, struct vattr *vap, > + struct ucred *cred) > { > struct proc *p; > DECL_NO_OUT(coda_setattr); /* sets Isize & Osize */ > @@ -347,8 +349,8 @@ venus_setattr(void *mdp, CodaFid *fid, s > } > > int > -venus_access(void *mdp, CodaFid *fid, accmode_t accmode, struct ucred *cred, > - struct proc *p) > +venus_access(void *mdp, struct CodaFid *fid, accmode_t accmode, > + struct ucred *cred, struct proc *p) > { > DECL_NO_OUT(coda_access); /* sets Isize & Osize */ > ALLOC_NO_OUT(coda_access); /* sets inp & outp */ > @@ -374,8 +376,8 @@ venus_access(void *mdp, CodaFid *fid, ac > } > > int > -venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p, > - /*out*/ char **str, int *len) > +venus_readlink(void *mdp, struct CodaFid *fid, struct ucred *cred, > + struct proc *p, /*out*/ char **str, int *len) > { > DECL(coda_readlink); /* sets Isize & Osize */ > coda_readlink_size += CODA_MAXPATHLEN; > @@ -400,7 +402,7 @@ venus_readlink(void *mdp, CodaFid *fid, > } > > int > -venus_fsync(void *mdp, CodaFid *fid, struct proc *p) > +venus_fsync(void *mdp, struct CodaFid *fid, struct proc *p) > { > DECL_NO_OUT(coda_fsync); /* sets Isize & Osize */ > ALLOC_NO_OUT(coda_fsync); /* sets inp & outp */ > @@ -420,8 +422,9 @@ venus_fsync(void *mdp, CodaFid *fid, str > } > > int > -venus_lookup(void *mdp, CodaFid *fid, const char *nm, int len, > - struct ucred *cred, struct proc *p, /*out*/ CodaFid *VFid, int *vtype) > +venus_lookup(void *mdp, struct CodaFid *fid, const char *nm, int len, > + struct ucred *cred, struct proc *p, /*out*/ struct CodaFid *VFid, > + int *vtype) > { > DECL(coda_lookup); /* sets Isize & Osize */ > coda_lookup_size += len + 1; > @@ -457,9 +460,9 @@ venus_lookup(void *mdp, CodaFid *fid, co > } > > int > -venus_create(void *mdp, CodaFid *fid, const char *nm, int len, int exclusive, > - int mode, struct vattr *va, struct ucred *cred, struct proc *p, > - /*out*/ CodaFid *VFid, struct vattr *attr) > +venus_create(void *mdp, struct CodaFid *fid, const char *nm, int len, > + int exclusive, int mode, struct vattr *va, struct ucred *cred, > + struct proc *p, /*out*/ struct CodaFid *VFid, struct vattr *attr) > { > DECL(coda_create); /* sets Isize & Osize */ > coda_create_size += len + 1; > @@ -488,7 +491,7 @@ venus_create(void *mdp, CodaFid *fid, co > } > > int > -venus_remove(void *mdp, CodaFid *fid, const char *nm, int len, > +venus_remove(void *mdp, struct CodaFid *fid, const char *nm, int len, > struct ucred *cred, struct proc *p) > { > DECL_NO_OUT(coda_remove); /* sets Isize & Osize */ > @@ -511,8 +514,8 @@ venus_remove(void *mdp, CodaFid *fid, co > } > > int > -venus_link(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, int len, > - struct ucred *cred, struct proc *p) > +venus_link(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, > + const char *nm, int len, struct ucred *cred, struct proc *p) > { > DECL_NO_OUT(coda_link); /* sets Isize & Osize */ > coda_link_size += len + 1; > @@ -535,8 +538,9 @@ venus_link(void *mdp, CodaFid *fid, Coda > } > > int > -venus_rename(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, int len, > - const char *tnm, int tlen, struct ucred *cred, struct proc *p) > +venus_rename(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, > + const char *nm, int len, const char *tnm, int tlen, struct ucred *cred, > + struct proc *p) > { > DECL_NO_OUT(coda_rename); /* sets Isize & Osize */ > coda_rename_size += len + 1 + tlen + 1; > @@ -562,9 +566,9 @@ venus_rename(void *mdp, CodaFid *fid, Co > } > > int > -venus_mkdir(void *mdp, CodaFid *fid, const char *nm, int len, > +venus_mkdir(void *mdp, struct CodaFid *fid, const char *nm, int len, > struct vattr *va, struct ucred *cred, struct proc *p, > - /*out*/ CodaFid *VFid, struct vattr *ova) > + /*out*/ struct CodaFid *VFid, struct vattr *ova) > { > DECL(coda_mkdir); /* sets Isize & Osize */ > coda_mkdir_size += len + 1; > @@ -591,7 +595,7 @@ venus_mkdir(void *mdp, CodaFid *fid, con > } > > int > -venus_rmdir(void *mdp, CodaFid *fid, const char *nm, int len, > +venus_rmdir(void *mdp, struct CodaFid *fid, const char *nm, int len, > struct ucred *cred, struct proc *p) > { > DECL_NO_OUT(coda_rmdir); /* sets Isize & Osize */ > @@ -614,7 +618,7 @@ venus_rmdir(void *mdp, CodaFid *fid, con > } > > int > -venus_symlink(void *mdp, CodaFid *fid, const char *lnm, int llen, > +venus_symlink(void *mdp, struct CodaFid *fid, const char *lnm, int llen, > const char *nm, int len, struct vattr *va, struct ucred *cred, > struct proc *p) > { > @@ -645,7 +649,7 @@ venus_symlink(void *mdp, CodaFid *fid, c > * XXX: Unused. > */ > int > -venus_readdir(void *mdp, CodaFid *fid, int count, int offset, > +venus_readdir(void *mdp, struct CodaFid *fid, int count, int offset, > struct ucred *cred, struct proc *p, /*out*/ char *buffer, int *len) > { > DECL(coda_readdir); /* sets Isize & Osize */ > @@ -672,8 +676,8 @@ venus_readdir(void *mdp, CodaFid *fid, i > } > > int > -venus_fhtovp(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p, > - /*out*/ CodaFid *VFid, int *vtype) > +venus_fhtovp(void *mdp, struct CodaFid *fid, struct ucred *cred, > + struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype) > { > DECL(coda_vget); /* sets Isize & Osize */ > ALLOC(coda_vget); /* sets inp & outp */ > > Modified: stable/8/sys/fs/coda/coda_venus.h > ============================================================================== > --- stable/8/sys/fs/coda/coda_venus.h Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_venus.h Tue Jun 1 14:29:26 2010 (r208702) > @@ -34,49 +34,50 @@ > #define _CODA_VENUS_H_ > > int venus_root(void *mdp, struct ucred *cred, struct proc *p, > - /*out*/ CodaFid *VFid); > -int venus_open(void *mdp, CodaFid *fid, int flag, struct ucred *cred, > - struct proc *p, /*out*/ struct vnode **vp); > -int venus_close(void *mdp, CodaFid *fid, int flag, struct ucred *cred, > - struct proc *p); > + /*out*/ struct CodaFid *VFid); > +int venus_open(void *mdp, struct CodaFid *fid, int flag, > + struct ucred *cred, struct proc *p, /*out*/ struct vnode **vp); > +int venus_close(void *mdp, struct CodaFid *fid, int flag, > + struct ucred *cred, struct proc *p); > void venus_read(void); > void venus_write(void); > -int venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data, > - struct ucred *cred, struct proc *p); > -int venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, > +int venus_ioctl(void *mdp, struct CodaFid *fid, int com, int flag, > + caddr_t data, struct ucred *cred, struct proc *p); > +int venus_getattr(void *mdp, struct CodaFid *fid, struct ucred *cred, > struct vattr *vap); > -int venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, > +int venus_setattr(void *mdp, struct CodaFid *fid, struct vattr *vap, > struct ucred *cred); > -int venus_access(void *mdp, CodaFid *fid, int mode, struct ucred *cred, > - struct proc *p); > -int venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred, > +int venus_access(void *mdp, struct CodaFid *fid, int mode, > + struct ucred *cred, struct proc *p); > +int venus_readlink(void *mdp, struct CodaFid *fid, struct ucred *cred, > struct proc *p, /*out*/ char **str, int *len); > -int venus_fsync(void *mdp, CodaFid *fid, struct proc *p); > -int venus_lookup(void *mdp, CodaFid *fid, const char *nm, int len, > - struct ucred *cred, struct proc *p, /*out*/ CodaFid *VFid, > +int venus_fsync(void *mdp, struct CodaFid *fid, struct proc *p); > +int venus_lookup(void *mdp, struct CodaFid *fid, const char *nm, int len, > + struct ucred *cred, struct proc *p, /*out*/ struct CodaFid *VFid, > int *vtype); > -int venus_create(void *mdp, CodaFid *fid, const char *nm, int len, > +int venus_create(void *mdp, struct CodaFid *fid, const char *nm, int len, > int exclusive, int mode, struct vattr *va, struct ucred *cred, > - struct proc *p, /*out*/ CodaFid *VFid, struct vattr *attr); > -int venus_remove(void *mdp, CodaFid *fid, const char *nm, int len, > + struct proc *p, /*out*/ struct CodaFid *VFid, > + struct vattr *attr); > +int venus_remove(void *mdp, struct CodaFid *fid, const char *nm, int len, > struct ucred *cred, struct proc *p); > -int venus_link(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, > - int len, struct ucred *cred, struct proc *p); > -int venus_rename(void *mdp, CodaFid *fid, CodaFid *tfid, const char *nm, > - int len, const char *tnm, int tlen, struct ucred *cred, > - struct proc *p); > -int venus_mkdir(void *mdp, CodaFid *fid, const char *nm, int len, > +int venus_link(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, > + const char *nm, int len, struct ucred *cred, struct proc *p); > +int venus_rename(void *mdp, struct CodaFid *fid, struct CodaFid *tfid, > + const char *nm, int len, const char *tnm, int tlen, > + struct ucred *cred, struct proc *p); > +int venus_mkdir(void *mdp, struct CodaFid *fid, const char *nm, int len, > struct vattr *va, struct ucred *cred, struct proc *p, > - /*out*/ CodaFid *VFid, struct vattr *ova); > -int venus_rmdir(void *mdp, CodaFid *fid, const char *nm, int len, > + /*out*/ struct CodaFid *VFid, struct vattr *ova); > +int venus_rmdir(void *mdp, struct CodaFid *fid, const char *nm, int len, > + struct ucred *cred, struct proc *p); > +int venus_symlink(void *mdp, struct CodaFid *fid, const char *lnm, > + int llen, const char *nm, int len, struct vattr *va, > struct ucred *cred, struct proc *p); > -int venus_symlink(void *mdp, CodaFid *fid, const char *lnm, int llen, > - const char *nm, int len, struct vattr *va, struct ucred *cred, > - struct proc *p); > -int venus_readdir(void *mdp, CodaFid *fid, int count, int offset, > +int venus_readdir(void *mdp, struct CodaFid *fid, int count, int offset, > struct ucred *cred, struct proc *p, /*out*/ char *buffer, > int *len); > -int venus_fhtovp(void *mdp, CodaFid *fid, struct ucred *cred, > - struct proc *p, /*out*/ CodaFid *VFid, int *vtype); > +int venus_fhtovp(void *mdp, struct CodaFid *fid, struct ucred *cred, > + struct proc *p, /*out*/ struct CodaFid *VFid, int *vtype); > > #endif /* !_CODA_VENUS_H_ */ > > Modified: stable/8/sys/fs/coda/coda_vfsops.c > ============================================================================== > --- stable/8/sys/fs/coda/coda_vfsops.c Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_vfsops.c Tue Jun 1 14:29:26 2010 (r208702) > @@ -113,8 +113,8 @@ coda_mount(struct mount *vfsp) > struct cdev *dev; > struct coda_mntinfo *mi; > struct vnode *rootvp; > - CodaFid rootfid = INVAL_FID; > - CodaFid ctlfid = CTL_FID; > + struct CodaFid rootfid = INVAL_FID; > + struct CodaFid ctlfid = CTL_FID; > int error; > struct nameidata ndp; > ENTRY; > @@ -268,8 +268,8 @@ coda_root(struct mount *vfsp, int flags, > int error; > struct proc *p; > struct thread *td; > - CodaFid VFid; > - static const CodaFid invalfid = INVAL_FID; > + struct CodaFid VFid; > + static const struct CodaFid invalfid = INVAL_FID; > > td = curthread; > p = td->td_proc; > @@ -288,7 +288,7 @@ coda_root(struct mount *vfsp, int flags, > * but not in any released versions as of 6 Mar 2003. > */ > if (memcmp(&VTOC(mi->mi_rootvp)->c_fid, &invalfid, > - sizeof(CodaFid)) != 0 || mi->mi_started == 0) { > + sizeof(struct CodaFid)) != 0 || mi->mi_started == 0) { > /* > * Found valid root. > */ > @@ -407,7 +407,7 @@ coda_fhtovp(struct mount *vfsp, struct f > int error; > struct thread *td = curthread; /* XXX -mach */ > struct proc *p = td->td_proc; > - CodaFid VFid; > + struct CodaFid VFid; > int vtype; > > ENTRY; > > Modified: stable/8/sys/fs/coda/coda_vfsops.h > ============================================================================== > --- stable/8/sys/fs/coda/coda_vfsops.h Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_vfsops.h Tue Jun 1 14:29:26 2010 (r208702) > @@ -42,7 +42,7 @@ > struct cfid { > u_short cfid_len; > u_short padding; > - CodaFid cfid_fid; > + struct CodaFid cfid_fid; > }; > > struct mbuf; > > Modified: stable/8/sys/fs/coda/coda_vnops.c > ============================================================================== > --- stable/8/sys/fs/coda/coda_vnops.c Tue Jun 1 14:26:27 2010 (r208701) > +++ stable/8/sys/fs/coda/coda_vnops.c Tue Jun 1 14:29:26 2010 (r208702) > @@ -872,7 +872,7 @@ coda_lookup(struct vop_cachedlookup_args > struct cnode *cp; > const char *nm = cnp->cn_nameptr; > int len = cnp->cn_namelen; > - CodaFid VFid; > + struct CodaFid VFid; > int vtype; > int error = 0; > > @@ -1009,7 +1009,7 @@ coda_create(struct vop_create_args *ap) > struct cnode *cp; > const char *nm = cnp->cn_nameptr; > int len = cnp->cn_namelen; > - CodaFid VFid; > + struct CodaFid VFid; > struct vattr attr; > > MARK_ENTRY(CODA_CREATE_STATS); > @@ -1278,7 +1278,7 @@ coda_mkdir(struct vop_mkdir_args *ap) > const char *nm = cnp->cn_nameptr; > int len = cnp->cn_namelen; > struct cnode *cp; > - CodaFid VFid; > + struct CodaFid VFid; > struct vattr ova; > > MARK_ENTRY(CODA_MKDIR_STATS); > @@ -1687,7 +1687,7 @@ coda_print_cred(struct ucred *cred) > * coda_unsave. > */ > struct cnode * > -make_coda_node(CodaFid *fid, struct mount *vfsp, short type) > +make_coda_node(struct CodaFid *fid, struct mount *vfsp, short type) > { > struct cnode *cp; > struct vnode *vp; > From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 19:38:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C93E1065675; Tue, 1 Jun 2010 19:38:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 606F68FC13; Tue, 1 Jun 2010 19:38:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51JckL4025836; Tue, 1 Jun 2010 19:38:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51Jckr6025834; Tue, 1 Jun 2010 19:38:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006011938.o51Jckr6025834@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Jun 2010 19:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208718 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 19:38:46 -0000 Author: jhb Date: Tue Jun 1 19:38:46 2010 New Revision: 208718 URL: http://svn.freebsd.org/changeset/base/208718 Log: MFC 208555: Ignore the 'addr' argument passed to PT_STEP (it is required to be '1' for PT_STEP which means "ignore") and PT_DETACH. Approved by: re (kib) Modified: stable/8/sys/kern/sys_process.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Tue Jun 1 18:57:21 2010 (r208717) +++ stable/8/sys/kern/sys_process.c Tue Jun 1 19:38:46 2010 (r208718) @@ -896,24 +896,29 @@ kern_ptrace(struct thread *td, int req, if (error) goto out; break; + case PT_CONTINUE: case PT_TO_SCE: - p->p_stops |= S_PT_SCE; - break; case PT_TO_SCX: - p->p_stops |= S_PT_SCX; - break; case PT_SYSCALL: - p->p_stops |= S_PT_SCE | S_PT_SCX; - break; - } - - if (addr != (void *)1) { - error = ptrace_set_pc(td2, (u_long)(uintfptr_t)addr); - if (error) + if (addr != (void *)1) { + error = ptrace_set_pc(td2, + (u_long)(uintfptr_t)addr); + if (error) + goto out; + } + switch (req) { + case PT_TO_SCE: + p->p_stops |= S_PT_SCE; break; - } - - if (req == PT_DETACH) { + case PT_TO_SCX: + p->p_stops |= S_PT_SCX; + break; + case PT_SYSCALL: + p->p_stops |= S_PT_SCE | S_PT_SCX; + break; + } + break; + case PT_DETACH: /* reset process parent */ if (p->p_oppid != p->p_pptr->p_pid) { struct proc *pp; @@ -938,6 +943,7 @@ kern_ptrace(struct thread *td, int req, /* should we send SIGCHLD? */ /* childproc_continued(p); */ + break; } sendsig: From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 19:39:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF1B1065676; Tue, 1 Jun 2010 19:39:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E56F8FC2F; Tue, 1 Jun 2010 19:39:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51JdS9u026006; Tue, 1 Jun 2010 19:39:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51JdSxo026004; Tue, 1 Jun 2010 19:39:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006011939.o51JdSxo026004@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Jun 2010 19:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208719 - stable/7/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 19:39:28 -0000 Author: jhb Date: Tue Jun 1 19:39:27 2010 New Revision: 208719 URL: http://svn.freebsd.org/changeset/base/208719 Log: MFC 208555: Ignore the 'addr' argument passed to PT_STEP (it is required to be '1' for PT_STEP which means "ignore") and PT_DETACH. Modified: stable/7/sys/kern/sys_process.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sys_process.c ============================================================================== --- stable/7/sys/kern/sys_process.c Tue Jun 1 19:38:46 2010 (r208718) +++ stable/7/sys/kern/sys_process.c Tue Jun 1 19:39:27 2010 (r208719) @@ -731,24 +731,29 @@ kern_ptrace(struct thread *td, int req, if (error) goto out; break; + case PT_CONTINUE: case PT_TO_SCE: - p->p_stops |= S_PT_SCE; - break; case PT_TO_SCX: - p->p_stops |= S_PT_SCX; - break; case PT_SYSCALL: - p->p_stops |= S_PT_SCE | S_PT_SCX; - break; - } - - if (addr != (void *)1) { - error = ptrace_set_pc(td2, (u_long)(uintfptr_t)addr); - if (error) + if (addr != (void *)1) { + error = ptrace_set_pc(td2, + (u_long)(uintfptr_t)addr); + if (error) + goto out; + } + switch (req) { + case PT_TO_SCE: + p->p_stops |= S_PT_SCE; break; - } - - if (req == PT_DETACH) { + case PT_TO_SCX: + p->p_stops |= S_PT_SCX; + break; + case PT_SYSCALL: + p->p_stops |= S_PT_SCE | S_PT_SCX; + break; + } + break; + case PT_DETACH: /* reset process parent */ if (p->p_oppid != p->p_pptr->p_pid) { struct proc *pp; @@ -773,6 +778,7 @@ kern_ptrace(struct thread *td, int req, /* should we send SIGCHLD? */ /* childproc_continued(p); */ + break; } sendsig: From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 20:37:53 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5D42106564A; Tue, 1 Jun 2010 20:37:53 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C2FB28FC1E; Tue, 1 Jun 2010 20:37:52 +0000 (UTC) Received: by fxm5 with SMTP id 5so4131426fxm.13 for ; Tue, 01 Jun 2010 13:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :x-comment-to:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=R6iEfN649xnq2hdKOvvpiAXN7betRezb9shtN7u4uv0=; b=iCV8JTZiXeEy1SdFVQytUV9PR/D57xHsyuauHde6UVZ8zH46udFmRslfUosapXFXCK 6FDH/y1OEmsv+/IQvDtn2MYVnreUiOGM8lx0T0WQcU9uFRft8VqYwE7kpSlk+MOEsOjT FdR3iPIC8ZL1G/Iz3WV/1U4tuMYM4DUQ52Xt0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=Zim37/rMb6GDQmvNmTz2EmwHgtr6BLURLBffGI1waOy/s1RVtMq07X+gHSvxNigoN4 QlRO/wzjQQFfPYhhMXT5AuZpPVP2iaMhEJxh8WULy9oT5/SOI5woR1zYh87f2mjRQw0l iUZv8u1zNg5/owAqQUzpL/KVT44EYLYEQAPRA= Received: by 10.204.48.195 with SMTP id s3mr1019232bkf.195.1275423280394; Tue, 01 Jun 2010 13:14:40 -0700 (PDT) Received: from localhost ([95.69.167.97]) by mx.google.com with ESMTPS id v2sm4636413bkz.19.2010.06.01.13.14.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Jun 2010 13:14:39 -0700 (PDT) From: Mikolaj Golub To: "Robert N. M. Watson" References: <201006011359.o51DxmSW050166@svn.freebsd.org> <2E4C7566-1F0E-4A44-8514-061FF1E129DE@gmail.com> <57DF5801-1685-4C69-9FD3-E56F5425E28C@FreeBSD.org> X-Comment-To: Robert N. M. Watson Date: Tue, 01 Jun 2010 23:14:36 +0300 In-Reply-To: <57DF5801-1685-4C69-9FD3-E56F5425E28C@FreeBSD.org> (Robert N. M. Watson's message of "Tue, 1 Jun 2010 15:39:01 +0100") Message-ID: <86wrui4ij7.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Nikolay Denev , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org Subject: Re: svn commit: r208692 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 20:37:53 -0000 On Tue, 1 Jun 2010 15:39:01 +0100 Robert N. M. Watson wrote: RNMW> On 1 Jun 2010, at 15:23, Nikolay Denev wrote: >>> When close() is called on a connected socket pair, SO_ISCONNECTED might be >>> set but be cleared before the call to sodisconnect(). In this case, >>> ENOTCONN is returned: suppress this error rather than returning it to >>> userspace so that close() doesn't report an error improperly. >>> >>> PR: kern/144061 >>> Reported by: Matt Reimer , >>> Nikolay Denev , >>> Mikolaj Golub >> I wonder, does this affect RELENG_7 ? (can't test at the moment, but sys/kern/uipc_socket.c:soclose() looks similar) RNMW> Yes, almost certainly -- if it doesn't manifest, it's just because of RNMW> timing differences, not because the bug isn't present. I'll look at RNMW> merging it to 7.x as well. Actually these were 7.1 servers where I noticed this problem fist. -- Mikolaj Golub From owner-svn-src-stable@FreeBSD.ORG Tue Jun 1 21:19:58 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBC7D106566B; Tue, 1 Jun 2010 21:19:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5B398FC1B; Tue, 1 Jun 2010 21:19:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o51LJwAu048290; Tue, 1 Jun 2010 21:19:58 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o51LJw0d048280; Tue, 1 Jun 2010 21:19:58 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201006012119.o51LJw0d048280@svn.freebsd.org> From: Attilio Rao Date: Tue, 1 Jun 2010 21:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208723 - in stable/8: share/man/man4 sys/amd64/amd64 sys/amd64/include sys/dev/io sys/i386/i386 sys/i386/include sys/ia64/ia64 sys/ia64/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 21:19:58 -0000 Author: attilio Date: Tue Jun 1 21:19:58 2010 New Revision: 208723 URL: http://svn.freebsd.org/changeset/base/208723 Log: MFC r207329, r208716: - Extract the IODEV_PIO interface from ia64 and make it MI. - On i386 and amd64 the old behaviour is kept but multithreaded processes must use the new interface in order to work well. - Support for the other architectures is greatly improved. Sponsored by: Sandvine Incorporated Approved by: re (kib, bz) Added: stable/8/sys/dev/io/iodev.h - copied unchanged from r207329, head/sys/dev/io/iodev.h Modified: stable/8/share/man/man4/io.4 stable/8/sys/amd64/amd64/io.c stable/8/sys/amd64/include/iodev.h stable/8/sys/dev/io/iodev.c stable/8/sys/i386/i386/io.c stable/8/sys/i386/include/iodev.h stable/8/sys/ia64/ia64/iodev_machdep.c stable/8/sys/ia64/include/iodev.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/share/man/man4/io.4 ============================================================================== --- stable/8/share/man/man4/io.4 Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/share/man/man4/io.4 Tue Jun 1 21:19:58 2010 (r208723) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd June 01, 2010 .Dt IO 4 .Os .Sh NAME @@ -35,32 +35,89 @@ .Nd I/O privilege file .Sh SYNOPSIS .Cd "device io" +.Pp +.In sys/types.h +.In sys/ioctl.h +.In dev/io/iodev.h +.In machine/iodev.h +.Pp +.Bd -literal +struct iodev_pio_req { + u_int access; + u_int port; + u_int width; + u_int val; +}; .Sh DESCRIPTION The special file .Pa /dev/io is a controlled security hole that allows a process to gain I/O privileges (which are normally reserved for kernel-internal code). -Any process that holds a file descriptor on -.Pa /dev/io -open will get its -.Em IOPL -bits in the flag register set, thus allowing it to perform direct -I/O operations. This can be useful in order to write userland programs that handle some hardware directly. -Note that even read-only access will grant the full I/O privileges. +.Pp +The usual operations on the device are to open it via the +.Xr open 2 +interface and to send I/O requests to the file descriptor using the +.Xr ioctl 2 +syscall. +.Pp +The +.Xr ioctl 2 +requests available for +.Pa /dev/io +are mostly platform dependent, but there are also some in common between +all of them. +The +.Dv IODEV_PIO +is used by all the architectures in order to request that an I/O operation +be performed. It takes a 'struct iodev_pio_req' argument +that must be previously setup. +.Pp +The +.Fa access +member specifies the type of operation requested. It may be: +.Bl -tag -width IODEV_PIO_WRITE +.It Dv IODEV_PIO_READ +The operation is an "in" type. A value will be read from the specified port +(retrieved from the +.Fa port +member) and the result will be stored in the +.Fa val +member. +.It Dv IODEV_PIO_WRITE +The operation is a "out" type. The value will be fetched from the +.Fa val +member and will be written out to the specified port (defined as the +.Fa port +member). +.El +.Pp +Finally, the +.Fa width +member specifies the size of the operand to be read/written, expressed +in bytes. .Pp In addition to any file access permissions on .Pa /dev/io , the kernel enforces that only the super-user may open this device. -.Sh FILES -.Bl -tag -width Pa -compact -.It Pa /dev/io -.El +.Sh LEGACY +The +.Pa /dev/io +interface used to be very i386 specific and worked differently. The initial +implementation, in fact, simply raised the +.Em IOPL +of the current thread when +.Xr open 2 +was called on the file. This behaviour is retained in the current +implementation as legacy support for both i386 and amd64 architectures. .Sh SEE ALSO +.Xr close 2 , .Xr i386_get_ioperm 2 , .Xr i386_set_ioperm 2 , +.Xr ioctl 2 , +.Xr open 2 , .Xr mem 4 .Sh HISTORY The Modified: stable/8/sys/amd64/amd64/io.c ============================================================================== --- stable/8/sys/amd64/amd64/io.c Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/amd64/amd64/io.c Tue Jun 1 21:19:58 2010 (r208723) @@ -28,60 +28,32 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include - -#include -#include - #include +#include -/* ARGSUSED */ int -ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_open(struct thread *td) { - int error; - - error = priv_check(td, PRIV_IO); - if (error != 0) - return (error); - error = securelevel_gt(td->td_ucred, 0); - if (error != 0) - return (error); td->td_frame->tf_rflags |= PSL_IOPL; - return (0); } -/* ARGSUSED */ int -ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_close(struct thread *td) { - td->td_frame->tf_rflags &= ~PSL_IOPL; + td->td_frame->tf_rflags &= ~PSL_IOPL; return (0); } /* ARGSUSED */ int -ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, - int fflag __unused, struct thread *td __unused) +iodev_ioctl(u_long cmd __unused, caddr_t data __unused) { - return (ENXIO); + return (ENOIOCTL); } Modified: stable/8/sys/amd64/include/iodev.h ============================================================================== --- stable/8/sys/amd64/include/iodev.h Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/amd64/include/iodev.h Tue Jun 1 21:19:58 2010 (r208723) @@ -25,7 +25,22 @@ * * $FreeBSD$ */ +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ -d_open_t ioopen; -d_close_t ioclose; -d_ioctl_t ioioctl; +#ifdef _KERNEL +#include + +#define iodev_read_1 inb +#define iodev_read_2 inw +#define iodev_read_4 inl +#define iodev_write_1 outb +#define iodev_write_2 outw +#define iodev_write_4 outl + +int iodev_open(struct thread *td); +int iodev_close(struct thread *td); +int iodev_ioctl(u_long cmd, caddr_t data); + +#endif /* _KERNEL */ +#endif /* _MACHINE_IODEV_H_ */ Modified: stable/8/sys/dev/io/iodev.c ============================================================================== --- stable/8/sys/dev/io/iodev.c Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/dev/io/iodev.c Tue Jun 1 21:19:58 2010 (r208723) @@ -30,22 +30,27 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include -#include +#include #include -#include +#include #include -#include #include -#include - -#include -#include #include +#include + +static int ioopen(struct cdev *dev, int flags, int fmt, + struct thread *td); +static int ioclose(struct cdev *dev, int flags, int fmt, + struct thread *td); +static int ioioctl(struct cdev *dev, u_long cmd, caddr_t data, + int fflag, struct thread *td); + +static int iopio_read(struct iodev_pio_req *req); +static int iopio_write(struct iodev_pio_req *req); + static struct cdev *iodev; static struct cdevsw io_cdevsw = { @@ -58,6 +63,129 @@ static struct cdevsw io_cdevsw = { /* ARGSUSED */ static int +ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td) +{ + int error; + + error = priv_check(td, PRIV_IO); + if (error != 0) + return (error); + error = securelevel_gt(td->td_ucred, 0); + if (error != 0) + return (error); + error = iodev_open(td); + + return (error); +} + +/* ARGSUSED */ +static int +ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td) +{ + + return (iodev_close(td)); +} + +/* ARGSUSED */ +static int +ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, + int fflag __unused, struct thread *td __unused) +{ + struct iodev_pio_req *pio_req; + int error; + + switch (cmd) { + case IODEV_PIO: + pio_req = (struct iodev_pio_req *)data; + switch (pio_req->access) { + case IODEV_PIO_READ: + error = iopio_read(pio_req); + break; + case IODEV_PIO_WRITE: + error = iopio_write(pio_req); + break; + default: + error = EINVAL; + break; + } + break; + default: + error = iodev_ioctl(cmd, data); + } + + return (error); +} + +static int +iopio_read(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + req->val = iodev_read_1(req->port); + break; + case 2: + if (req->port & 1) { + req->val = iodev_read_1(req->port); + req->val |= iodev_read_1(req->port + 1) << 8; + } else + req->val = iodev_read_2(req->port); + break; + case 4: + if (req->port & 1) { + req->val = iodev_read_1(req->port); + req->val |= iodev_read_2(req->port + 1) << 8; + req->val |= iodev_read_1(req->port + 3) << 24; + } else if (req->port & 2) { + req->val = iodev_read_2(req->port); + req->val |= iodev_read_2(req->port + 2) << 16; + } else + req->val = iodev_read_4(req->port); + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +iopio_write(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + iodev_write_1(req->port, req->val); + break; + case 2: + if (req->port & 1) { + iodev_write_1(req->port, req->val); + iodev_write_1(req->port + 1, req->val >> 8); + } else + iodev_write_2(req->port, req->val); + break; + case 4: + if (req->port & 1) { + iodev_write_1(req->port, req->val); + iodev_write_2(req->port + 1, req->val >> 8); + iodev_write_1(req->port + 3, req->val >> 24); + } else if (req->port & 2) { + iodev_write_2(req->port, req->val); + iodev_write_2(req->port + 2, req->val >> 16); + } else + iodev_write_4(req->port, req->val); + break; + default: + return (EINVAL); + } + + return (0); +} + +/* ARGSUSED */ +static int io_modevent(module_t mod __unused, int type, void *data __unused) { switch(type) { Copied: stable/8/sys/dev/io/iodev.h (from r207329, head/sys/dev/io/iodev.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/io/iodev.h Tue Jun 1 21:19:58 2010 (r208723, copy of r207329, head/sys/dev/io/iodev.h) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * 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 AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IODEV_H_ +#define _DEV_IODEV_H_ + +#define IODEV_PIO_READ 0 +#define IODEV_PIO_WRITE 1 + +struct iodev_pio_req { + u_int access; + u_int port; + u_int width; + u_int val; +}; + +#define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) + +#endif /* _DEV_IODEV_H_ */ Modified: stable/8/sys/i386/i386/io.c ============================================================================== --- stable/8/sys/i386/i386/io.c Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/i386/i386/io.c Tue Jun 1 21:19:58 2010 (r208723) @@ -28,60 +28,32 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include - -#include -#include - #include +#include -/* ARGSUSED */ int -ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_open(struct thread *td) { - int error; - - error = priv_check(td, PRIV_IO); - if (error != 0) - return (error); - error = securelevel_gt(td->td_ucred, 0); - if (error != 0) - return (error); td->td_frame->tf_eflags |= PSL_IOPL; - return (0); } -/* ARGSUSED */ int -ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_close(struct thread *td) { - td->td_frame->tf_eflags &= ~PSL_IOPL; + td->td_frame->tf_eflags &= ~PSL_IOPL; return (0); } /* ARGSUSED */ int -ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, - int fflag __unused, struct thread *td __unused) +iodev_ioctl(u_long cmd __unused, caddr_t data __unused) { - return (ENXIO); + return (ENOIOCTL); } Modified: stable/8/sys/i386/include/iodev.h ============================================================================== --- stable/8/sys/i386/include/iodev.h Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/i386/include/iodev.h Tue Jun 1 21:19:58 2010 (r208723) @@ -25,7 +25,22 @@ * * $FreeBSD$ */ +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ -d_open_t ioopen; -d_close_t ioclose; -d_ioctl_t ioioctl; +#ifdef _KERNEL +#include + +#define iodev_read_1 inb +#define iodev_read_2 inw +#define iodev_read_4 inl +#define iodev_write_1 outb +#define iodev_write_2 outw +#define iodev_write_4 outl + +int iodev_open(struct thread *td); +int iodev_close(struct thread *td); +int iodev_ioctl(u_long cmd, caddr_t data); + +#endif /* _KERNEL */ +#endif /* _MACHINE_IODEV_H_ */ Modified: stable/8/sys/ia64/ia64/iodev_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/iodev_machdep.c Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/ia64/ia64/iodev_machdep.c Tue Jun 1 21:19:58 2010 (r208723) @@ -40,61 +40,33 @@ __FBSDID("$FreeBSD$"); #include #include -static int iodev_pio_read(struct iodev_pio_req *req); -static int iodev_pio_write(struct iodev_pio_req *req); - static int iodev_efivar_getvar(struct iodev_efivar_req *req); static int iodev_efivar_nextname(struct iodev_efivar_req *req); static int iodev_efivar_setvar(struct iodev_efivar_req *req); /* ARGSUSED */ int -ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_open(struct thread *td __unused) { - int error; - - error = priv_check(td, PRIV_IO); - if (error == 0) - error = securelevel_gt(td->td_ucred, 0); - return (error); + return (0); } /* ARGSUSED */ int -ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td __unused) +iodev_close(struct thread *td __unused) { return (0); } -/* ARGSUSED */ int -ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, - int fflag __unused, struct thread *td __unused) +iodev_ioctl(u_long cmd, caddr_t data) { struct iodev_efivar_req *efivar_req; - struct iodev_pio_req *pio_req; int error; - error = ENOIOCTL; switch (cmd) { - case IODEV_PIO: - pio_req = (struct iodev_pio_req *)data; - switch (pio_req->access) { - case IODEV_PIO_READ: - error = iodev_pio_read(pio_req); - break; - case IODEV_PIO_WRITE: - error = iodev_pio_write(pio_req); - break; - default: - error = EINVAL; - break; - } - break; case IODEV_EFIVAR: efivar_req = (struct iodev_efivar_req *)data; efivar_req->result = 0; /* So it's well-defined */ @@ -113,75 +85,11 @@ ioioctl(struct cdev *dev __unused, u_lon break; } break; - } - - return (error); -} - -static int -iodev_pio_read(struct iodev_pio_req *req) -{ - - switch (req->width) { - case 1: - req->val = bus_space_read_io_1(req->port); - break; - case 2: - if (req->port & 1) { - req->val = bus_space_read_io_1(req->port); - req->val |= bus_space_read_io_1(req->port + 1) << 8; - } else - req->val = bus_space_read_io_2(req->port); - break; - case 4: - if (req->port & 1) { - req->val = bus_space_read_io_1(req->port); - req->val |= bus_space_read_io_2(req->port + 1) << 8; - req->val |= bus_space_read_io_1(req->port + 3) << 24; - } else if (req->port & 2) { - req->val = bus_space_read_io_2(req->port); - req->val |= bus_space_read_io_2(req->port + 2) << 16; - } else - req->val = bus_space_read_io_4(req->port); - break; - default: - return (EINVAL); - } - - return (0); -} - -static int -iodev_pio_write(struct iodev_pio_req *req) -{ - - switch (req->width) { - case 1: - bus_space_write_io_1(req->port, req->val); - break; - case 2: - if (req->port & 1) { - bus_space_write_io_1(req->port, req->val); - bus_space_write_io_1(req->port + 1, req->val >> 8); - } else - bus_space_write_io_2(req->port, req->val); - break; - case 4: - if (req->port & 1) { - bus_space_write_io_1(req->port, req->val); - bus_space_write_io_2(req->port + 1, req->val >> 8); - bus_space_write_io_1(req->port + 3, req->val >> 24); - } else if (req->port & 2) { - bus_space_write_io_2(req->port, req->val); - bus_space_write_io_2(req->port + 2, req->val >> 16); - } else - bus_space_write_io_4(req->port, req->val); - break; default: - return (EINVAL); + error = ENOIOCTL; } - return (0); + return (error); } static int Modified: stable/8/sys/ia64/include/iodev.h ============================================================================== --- stable/8/sys/ia64/include/iodev.h Tue Jun 1 21:15:05 2010 (r208722) +++ stable/8/sys/ia64/include/iodev.h Tue Jun 1 21:19:58 2010 (r208723) @@ -31,22 +31,16 @@ #include -struct iodev_pio_req { - u_int access; -#define IODEV_PIO_READ 0 -#define IODEV_PIO_WRITE 1 - u_int port; - u_int width; - u_int val; -}; - -#define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) +#ifdef _KERNEL +#include +#endif -struct iodev_efivar_req { - u_int access; #define IODEV_EFIVAR_GETVAR 0 #define IODEV_EFIVAR_NEXTNAME 1 #define IODEV_EFIVAR_SETVAR 2 + +struct iodev_efivar_req { + u_int access; u_int result; /* errno value */ size_t namesize; u_short *name; /* UCS-2 */ @@ -59,11 +53,16 @@ struct iodev_efivar_req { #define IODEV_EFIVAR _IOWR('I', 1, struct iodev_efivar_req) #ifdef _KERNEL +#define iodev_read_1 bus_space_read_io_1 +#define iodev_read_2 bus_space_read_io_2 +#define iodev_read_4 bus_space_read_io_4 +#define iodev_write_1 bus_space_write_io_1 +#define iodev_write_2 bus_space_write_io_2 +#define iodev_write_4 bus_space_write_io_4 + +int iodev_open(struct thread *td); +int iodev_close(struct thread *td); +int iodev_ioctl(u_long, caddr_t data); -d_open_t ioopen; -d_close_t ioclose; -d_ioctl_t ioioctl; - -#endif - +#endif /* _KERNEL */ #endif /* _MACHINE_IODEV_H_ */ From owner-svn-src-stable@FreeBSD.ORG Wed Jun 2 10:26:31 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD011106566B; Wed, 2 Jun 2010 10:26:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C18F8FC25; Wed, 2 Jun 2010 10:26:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o52AQV5j026567; Wed, 2 Jun 2010 10:26:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o52AQVBG026565; Wed, 2 Jun 2010 10:26:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006021026.o52AQVBG026565@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 2 Jun 2010 10:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208735 - stable/8/crypto/openssh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 10:26:31 -0000 Author: des Date: Wed Jun 2 10:26:31 2010 New Revision: 208735 URL: http://svn.freebsd.org/changeset/base/208735 Log: Fix expansion of AuthorizedKeysFile (upstream patch) PR: 146334, 145940 Approved by: re (kib@) Modified: stable/8/crypto/openssh/servconf.c Modified: stable/8/crypto/openssh/servconf.c ============================================================================== --- stable/8/crypto/openssh/servconf.c Wed Jun 2 10:20:38 2010 (r208734) +++ stable/8/crypto/openssh/servconf.c Wed Jun 2 10:26:31 2010 (r208735) @@ -1227,7 +1227,17 @@ process_server_config_line(ServerOptions charptr = (opcode == sAuthorizedKeysFile) ? &options->authorized_keys_file : &options->authorized_keys_file2; - goto parse_filename; + arg = strdelim(&cp); + if (!arg || *arg == '\0') + fatal("%s line %d: missing file name.", + filename, linenum); + if (*activep && *charptr == NULL) { + *charptr = tilde_expand_filename(arg, getuid()); + /* increase optional counter */ + if (intptr != NULL) + *intptr = *intptr + 1; + } + break; case sClientAliveInterval: intptr = &options->client_alive_interval; From owner-svn-src-stable@FreeBSD.ORG Wed Jun 2 10:28:26 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9418A1065670; Wed, 2 Jun 2010 10:28:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 823018FC27; Wed, 2 Jun 2010 10:28:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o52ASQws027048; Wed, 2 Jun 2010 10:28:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o52ASQHi027034; Wed, 2 Jun 2010 10:28:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006021028.o52ASQHi027034@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 2 Jun 2010 10:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208736 - stable/8/crypto/openssh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 10:28:26 -0000 Author: des Date: Wed Jun 2 10:28:26 2010 New Revision: 208736 URL: http://svn.freebsd.org/changeset/base/208736 Log: Missing commas in Dd Approved by: re (kib@) Modified: stable/8/crypto/openssh/moduli.5 stable/8/crypto/openssh/scp.1 stable/8/crypto/openssh/sftp-server.8 stable/8/crypto/openssh/sftp.1 stable/8/crypto/openssh/ssh-add.1 stable/8/crypto/openssh/ssh-agent.1 stable/8/crypto/openssh/ssh-keygen.1 stable/8/crypto/openssh/ssh-keyscan.1 stable/8/crypto/openssh/ssh-keysign.8 stable/8/crypto/openssh/ssh.1 stable/8/crypto/openssh/ssh_config.5 stable/8/crypto/openssh/sshd.8 stable/8/crypto/openssh/sshd_config.5 Modified: stable/8/crypto/openssh/moduli.5 ============================================================================== --- stable/8/crypto/openssh/moduli.5 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/moduli.5 Wed Jun 2 10:28:26 2010 (r208736) @@ -13,7 +13,7 @@ .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd June 26 2008 +.Dd June 26, 2008 .Dt MODULI 5 .Os .Sh NAME Modified: stable/8/crypto/openssh/scp.1 ============================================================================== --- stable/8/crypto/openssh/scp.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/scp.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -11,7 +11,7 @@ .\" .\" $OpenBSD: scp.1,v 1.50 2010/02/08 10:50:20 markus Exp $ .\" -.Dd February 8 2010 +.Dd February 8, 2010 .Dt SCP 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/sftp-server.8 ============================================================================== --- stable/8/crypto/openssh/sftp-server.8 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/sftp-server.8 Wed Jun 2 10:28:26 2010 (r208736) @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 9 2010 +.Dd January 9, 2010 .Dt SFTP-SERVER 8 .Os .Sh NAME Modified: stable/8/crypto/openssh/sftp.1 ============================================================================== --- stable/8/crypto/openssh/sftp.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/sftp.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 8 2010 +.Dd February 8, 2010 .Dt SFTP 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh-add.1 ============================================================================== --- stable/8/crypto/openssh/ssh-add.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh-add.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -37,7 +37,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 5 2010 +.Dd March 5, 2010 .Dt SSH-ADD 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh-agent.1 ============================================================================== --- stable/8/crypto/openssh/ssh-agent.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh-agent.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -35,7 +35,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 17 2010 +.Dd January 17, 2010 .Dt SSH-AGENT 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh-keygen.1 ============================================================================== --- stable/8/crypto/openssh/ssh-keygen.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh-keygen.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -38,7 +38,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 8 2010 +.Dd March 8, 2010 .Dt SSH-KEYGEN 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh-keyscan.1 ============================================================================== --- stable/8/crypto/openssh/ssh-keyscan.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh-keyscan.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -7,7 +7,7 @@ .\" permitted provided that due credit is given to the author and the .\" OpenBSD project by leaving this copyright notice intact. .\" -.Dd January 9 2010 +.Dd January 9, 2010 .Dt SSH-KEYSCAN 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh-keysign.8 ============================================================================== --- stable/8/crypto/openssh/ssh-keysign.8 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh-keysign.8 Wed Jun 2 10:28:26 2010 (r208736) @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 31 2007 +.Dd May 31, 2007 .Dt SSH-KEYSIGN 8 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh.1 ============================================================================== --- stable/8/crypto/openssh/ssh.1 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh.1 Wed Jun 2 10:28:26 2010 (r208736) @@ -36,7 +36,7 @@ .\" .\" $OpenBSD: ssh.1,v 1.302 2010/03/05 10:28:21 djm Exp $ .\" $FreeBSD$ -.Dd March 5 2010 +.Dd March 5, 2010 .Dt SSH 1 .Os .Sh NAME Modified: stable/8/crypto/openssh/ssh_config.5 ============================================================================== --- stable/8/crypto/openssh/ssh_config.5 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/ssh_config.5 Wed Jun 2 10:28:26 2010 (r208736) @@ -36,7 +36,7 @@ .\" .\" $OpenBSD: ssh_config.5,v 1.129 2010/03/05 10:28:21 djm Exp $ .\" $FreeBSD$ -.Dd March 5 2010 +.Dd March 5, 2010 .Dt SSH_CONFIG 5 .Os .Sh NAME Modified: stable/8/crypto/openssh/sshd.8 ============================================================================== --- stable/8/crypto/openssh/sshd.8 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/sshd.8 Wed Jun 2 10:28:26 2010 (r208736) @@ -36,7 +36,7 @@ .\" .\" $OpenBSD: sshd.8,v 1.255 2010/03/05 06:50:35 jmc Exp $ .\" $FreeBSD$ -.Dd March 5 2010 +.Dd March 5, 2010 .Dt SSHD 8 .Os .Sh NAME Modified: stable/8/crypto/openssh/sshd_config.5 ============================================================================== --- stable/8/crypto/openssh/sshd_config.5 Wed Jun 2 10:26:31 2010 (r208735) +++ stable/8/crypto/openssh/sshd_config.5 Wed Jun 2 10:28:26 2010 (r208736) @@ -36,7 +36,7 @@ .\" .\" $OpenBSD: sshd_config.5,v 1.120 2010/03/04 23:17:25 djm Exp $ .\" $FreeBSD$ -.Dd March 4 2010 +.Dd March 4, 2010 .Dt SSHD_CONFIG 5 .Os .Sh NAME From owner-svn-src-stable@FreeBSD.ORG Wed Jun 2 18:46:12 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66FAF1065670; Wed, 2 Jun 2010 18:46:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52DA68FC1A; Wed, 2 Jun 2010 18:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o52IkC1H037270; Wed, 2 Jun 2010 18:46:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o52IkCZ8037263; Wed, 2 Jun 2010 18:46:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201006021846.o52IkCZ8037263@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 2 Jun 2010 18:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208754 - in stable/8: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/input sys/modules/usb/uep X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 18:46:12 -0000 Author: glebius Date: Wed Jun 2 18:46:12 2010 New Revision: 208754 URL: http://svn.freebsd.org/changeset/base/208754 Log: Merge 208554 from head: Add uep(4), driver for USB onscreen touch panel from eGalax. The driver is stub. It just creates device entry and feeds reassembled packets from hardware into it. If in future we would port wsmouse(4) from NetBSD, or make sysmouse(4) to support absolute motion events, then the driver can be extended to act as system mouse. Meanwhile, it just presents a /dev/uep0, that can be utilized by X driver, that I am going to commit to ports tree soon. The name for the driver is chosen to be the same as in NetBSD, however, due to different USB stacks this driver isn't a port. The driver is supported by ports/x11-drivers/xf86-input-egalax. Approved by: re (kib) Added: stable/8/share/man/man4/uep.4 - copied unchanged from r208554, head/share/man/man4/uep.4 stable/8/sys/dev/usb/input/uep.c - copied unchanged from r208554, head/sys/dev/usb/input/uep.c stable/8/sys/modules/usb/uep/ - copied from r208554, head/sys/modules/usb/uep/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Jun 2 18:31:04 2010 (r208753) +++ stable/8/share/man/man4/Makefile Wed Jun 2 18:46:12 2010 (r208754) @@ -431,6 +431,7 @@ MAN= aac.4 \ udav.4 \ udbp.4 \ udp.4 \ + uep.4 \ ufm.4 \ ufoma.4 \ uftdi.4 \ Copied: stable/8/share/man/man4/uep.4 (from r208554, head/share/man/man4/uep.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/uep.4 Wed Jun 2 18:46:12 2010 (r208754, copy of r208554, head/share/man/man4/uep.4) @@ -0,0 +1,79 @@ +.\" Copyright (c) 2010 Gleb Smirnoff +.\" 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 AUTHOR 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 AUTHOR 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. +.\" +.\" $FreeBSD$ +.\" +.Dd May 25, 2010 +.Dt UEP 4 +.Os +.Sh NAME +.Nm uep +.Nd eGalax touchscreen driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uep" +.Cd "device usb" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +uep_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the eGalax onscreen touch panels. +.Pp +The driver is stub. +It just probes and attaches to USB device, creates device entry +and feeds reassambled packets from the hardware to it. +.Pp +To get mouse working in +.Xr X 7 , +one needs to install +.Pa ports/x11-drivers/xf86-input-egalax . +.Sh BUGS +.Nm +can't act like +.Xr sysmouse 4 , +since the latter does not support absolute motion events. +.Sh FILES +.Nm +creates a blocking pseudo\-device file, +.Pa /dev/uep0 . +.Sh SEE ALSO +.Xr usb 4 , +.Xr loader.conf 5 , +.Xr xorg.conf 5 Pq Pa ports/x11/xorg , +.Xr egalax 4 Pq Pa ports/x11-drivers/xf86-input-egalax . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Gleb Smirnoff Aq glebius@FreeBSD.org Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Wed Jun 2 18:31:04 2010 (r208753) +++ stable/8/sys/conf/NOTES Wed Jun 2 18:46:12 2010 (r208754) @@ -2549,6 +2549,8 @@ device umct device umodem # USB mouse device ums +# eGalax USB touch screen +device uep # Diamond Rio 500 MP3 player device urio # Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Wed Jun 2 18:31:04 2010 (r208753) +++ stable/8/sys/conf/files Wed Jun 2 18:46:12 2010 (r208754) @@ -1766,6 +1766,7 @@ dev/usb/misc/udbp.c optional udbp # USB input drivers # dev/usb/input/atp.c optional atp +dev/usb/input/uep.c optional uep dev/usb/input/uhid.c optional uhid dev/usb/input/ukbd.c optional ukbd dev/usb/input/ums.c optional ums Copied: stable/8/sys/dev/usb/input/uep.c (from r208554, head/sys/dev/usb/input/uep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/usb/input/uep.c Wed Jun 2 18:46:12 2010 (r208754, copy of r208554, head/sys/dev/usb/input/uep.c) @@ -0,0 +1,441 @@ +/*- + * Copyright 2010, Gleb Smirnoff + * 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 AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ + */ + +/* + * http://home.eeti.com.tw/web20/drivers/Software%20Programming%20Guide_v2.0.pdf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "usbdevs.h" + +#include +#include +#include + +#define USB_DEBUG_VAR uep_debug +#include + +#ifdef USB_DEBUG +static int uep_debug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep"); +SYSCTL_INT(_hw_usb_uep, OID_AUTO, debug, CTLFLAG_RW, + &uep_debug, 0, "Debug level"); +#endif + +#define UEP_MAX_X 2047 +#define UEP_MAX_Y 2047 + +#define UEP_DOWN 0x01 +#define UEP_PACKET_LEN_MAX 16 +#define UEP_PACKET_LEN_REPORT 5 +#define UEP_PACKET_LEN_REPORT2 6 +#define UEP_PACKET_DIAG 0x0a +#define UEP_PACKET_REPORT_MASK 0xe0 +#define UEP_PACKET_REPORT 0x80 +#define UEP_PACKET_REPORT_PRESSURE 0xc0 +#define UEP_PACKET_REPORT_PLAYER 0xa0 +#define UEP_PACKET_LEN_MASK + +#define UEP_FIFO_BUF_SIZE 8 /* bytes */ +#define UEP_FIFO_QUEUE_MAXLEN 50 /* units */ + +enum { + UEP_INTR_DT, + UEP_N_TRANSFER, +}; + +struct uep_softc { + struct mtx mtx; + + struct usb_xfer *xfer[UEP_N_TRANSFER]; + struct usb_fifo_sc fifo; + + u_int pollrate; + u_int state; +#define UEP_ENABLED 0x01 + + /* Reassembling buffer. */ + u_char buf[UEP_PACKET_LEN_MAX]; + uint8_t buf_len; +}; + +static usb_callback_t uep_intr_callback; + +static device_probe_t uep_probe; +static device_attach_t uep_attach; +static device_detach_t uep_detach; + +static usb_fifo_cmd_t uep_start_read; +static usb_fifo_cmd_t uep_stop_read; +static usb_fifo_open_t uep_open; +static usb_fifo_close_t uep_close; + +static void uep_put_queue(struct uep_softc *, u_char *); + +static struct usb_fifo_methods uep_fifo_methods = { + .f_open = &uep_open, + .f_close = &uep_close, + .f_start_read = &uep_start_read, + .f_stop_read = &uep_stop_read, + .basename[0] = "uep", +}; + +static int +get_pkt_len(u_char *buf) +{ + if (buf[0] == UEP_PACKET_DIAG) { + int len; + + len = buf[1] + 2; + if (len > UEP_PACKET_LEN_MAX) { + DPRINTF("bad packet len %u\n", len); + return (UEP_PACKET_LEN_MAX); + } + + return (len); + } + + switch (buf[0] & UEP_PACKET_REPORT_MASK) { + case UEP_PACKET_REPORT: + return (UEP_PACKET_LEN_REPORT); + case UEP_PACKET_REPORT_PRESSURE: + case UEP_PACKET_REPORT_PLAYER: + case UEP_PACKET_REPORT_PRESSURE | UEP_PACKET_REPORT_PLAYER: + return (UEP_PACKET_LEN_REPORT2); + default: + DPRINTF("bad packet len 0\n"); + return (0); + } +} + +static void +uep_process_pkt(struct uep_softc *sc, u_char *buf) +{ + int32_t x, y; + + if ((buf[0] & 0xFE) != 0x80) { + DPRINTF("bad input packet format 0x%.2x\n", buf[0]); + return; + } + + /* + * Packet format is 5 bytes: + * + * 1000000T + * 0000AAAA + * 0AAAAAAA + * 0000BBBB + * 0BBBBBBB + * + * T: 1=touched 0=not touched + * A: bits of axis A position, MSB to LSB + * B: bits of axis B position, MSB to LSB + * + * For the unit I have, which is CTF1020-S from CarTFT.com, + * A = X and B = Y. But in NetBSD uep(4) it is other way round :) + * + * The controller sends a stream of T=1 events while the + * panel is touched, followed by a single T=0 event. + * + */ + + x = (buf[1] << 7) | buf[2]; + y = (buf[3] << 7) | buf[4]; + + DPRINTFN(2, "x %u y %u\n", x, y); + + uep_put_queue(sc, buf); +} + +static void +uep_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uep_softc *sc = usbd_xfer_softc(xfer); + int len; + + usbd_xfer_status(xfer, &len, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + { + struct usb_page_cache *pc; + u_char buf[17], *p; + int pkt_len; + + if (len > sizeof(buf)) { + DPRINTF("bad input length %d\n", len); + goto tr_setup; + } + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, buf, len); + + /* + * The below code mimics Linux a lot. I don't know + * why NetBSD reads complete packets, but we need + * to reassamble 'em like Linux does (tries?). + */ + if (sc->buf_len > 0) { + int res; + + if (sc->buf_len == 1) + sc->buf[1] = buf[0]; + + if ((pkt_len = get_pkt_len(sc->buf)) == 0) + goto tr_setup; + + res = pkt_len - sc->buf_len; + memcpy(sc->buf + sc->buf_len, buf, res); + uep_process_pkt(sc, sc->buf); + sc->buf_len = 0; + + p = buf + res; + len -= res; + } else + p = buf; + + if (len == 1) { + sc->buf[0] = buf[0]; + sc->buf_len = 1; + + goto tr_setup; + } + + while (len > 0) { + if ((pkt_len = get_pkt_len(p)) == 0) + goto tr_setup; + + /* full packet: process */ + if (pkt_len <= len) { + uep_process_pkt(sc, p); + } else { + /* incomplete packet: save in buffer */ + memcpy(sc->buf, p, len); + sc->buf_len = len; + } + p += pkt_len; + len -= pkt_len; + } + } + case USB_ST_SETUP: + tr_setup: + /* check if we can put more data into the FIFO */ + if (usb_fifo_put_bytes_max(sc->fifo.fp[USB_FIFO_RX]) != 0) { + usbd_xfer_set_frame_len(xfer, 0, + usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + } + break; + + default: + if (error != USB_ERR_CANCELLED) { + /* try clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static const struct usb_config uep_config[UEP_N_TRANSFER] = { + [UEP_INTR_DT] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &uep_intr_callback, + }, +}; + +static int +uep_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + if ((uaa->info.idVendor == USB_VENDOR_EGALAX) && + ((uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL) || + (uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL2))) + return (BUS_PROBE_SPECIFIC); + + if ((uaa->info.idVendor == USB_VENDOR_EGALAX2) && + (uaa->info.idProduct == USB_PRODUCT_EGALAX2_TPANEL)) + return (BUS_PROBE_SPECIFIC); + + return (ENXIO); +} + +static int +uep_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct uep_softc *sc = device_get_softc(dev); + int error; + + device_set_usb_desc(dev); + + mtx_init(&sc->mtx, "uep lock", NULL, MTX_DEF); + + error = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, + sc->xfer, uep_config, UEP_N_TRANSFER, sc, &sc->mtx); + + if (error) { + DPRINTF("usbd_transfer_setup error=%s\n", usbd_errstr(error)); + goto detach; + } + + error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods, + &sc->fifo, device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, + UID_ROOT, GID_OPERATOR, 0644); + + if (error) { + DPRINTF("usb_fifo_attach error=%s\n", usbd_errstr(error)); + goto detach; + } + + sc->buf_len = 0; + + return (0); + +detach: + uep_detach(dev); + + return (ENOMEM); /* XXX */ +} + +static int +uep_detach(device_t dev) +{ + struct uep_softc *sc = device_get_softc(dev); + + usb_fifo_detach(&sc->fifo); + + usbd_transfer_unsetup(sc->xfer, UEP_N_TRANSFER); + + mtx_destroy(&sc->mtx); + + return (0); +} + +static void +uep_start_read(struct usb_fifo *fifo) +{ + struct uep_softc *sc = usb_fifo_softc(fifo); + u_int rate; + + if ((rate = sc->pollrate) > 1000) + rate = 1000; + + if (rate > 0 && sc->xfer[UEP_INTR_DT] != NULL) { + usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); + usbd_xfer_set_interval(sc->xfer[UEP_INTR_DT], 1000 / rate); + sc->pollrate = 0; + } + + usbd_transfer_start(sc->xfer[UEP_INTR_DT]); +} + +static void +uep_stop_read(struct usb_fifo *fifo) +{ + struct uep_softc *sc = usb_fifo_softc(fifo); + + usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); +} + +static void +uep_put_queue(struct uep_softc *sc, u_char *buf) +{ + usb_fifo_put_data_linear(sc->fifo.fp[USB_FIFO_RX], buf, + UEP_PACKET_LEN_REPORT, 1); +} + +static int +uep_open(struct usb_fifo *fifo, int fflags) +{ + if (fflags & FREAD) { + struct uep_softc *sc = usb_fifo_softc(fifo); + + if (sc->state & UEP_ENABLED) + return (EBUSY); + if (usb_fifo_alloc_buffer(fifo, UEP_FIFO_BUF_SIZE, + UEP_FIFO_QUEUE_MAXLEN)) + return (ENOMEM); + + sc->state |= UEP_ENABLED; + } + + return (0); +} + +static void +uep_close(struct usb_fifo *fifo, int fflags) +{ + if (fflags & FREAD) { + struct uep_softc *sc = usb_fifo_softc(fifo); + + sc->state &= ~(UEP_ENABLED); + usb_fifo_free_buffer(fifo); + } +} + +static devclass_t uep_devclass; + +static device_method_t uep_methods[] = { + DEVMETHOD(device_probe, uep_probe), + DEVMETHOD(device_attach, uep_attach), + DEVMETHOD(device_detach, uep_detach), + { 0, 0 }, +}; + +static driver_t uep_driver = { + .name = "uep", + .methods = uep_methods, + .size = sizeof(struct uep_softc), +}; + +DRIVER_MODULE(uep, uhub, uep_driver, uep_devclass, NULL, NULL); +MODULE_DEPEND(uep, usb, 1, 1, 1); Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Wed Jun 2 18:31:04 2010 (r208753) +++ stable/8/sys/dev/usb/usbdevs Wed Jun 2 18:46:12 2010 (r208754) @@ -1385,6 +1385,11 @@ product EDIMAX RT2870_1 0x7711 RT2870 product EDIMAX EW7717 0x7717 EW-7717 product EDIMAX EW7718 0x7718 EW-7718 +/* eGalax Products */ +product EGALAX TPANEL 0x0001 Touch Panel +product EGALAX TPANEL2 0x0002 Touch Panel +product EGALAX2 TPANEL 0x0001 Touch Panel + /* Eicon Networks */ product EICON DIVA852 0x4905 Diva 852 ISDN TA From owner-svn-src-stable@FreeBSD.ORG Wed Jun 2 20:35:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 627781065672; Wed, 2 Jun 2010 20:35:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 511EF8FC14; Wed, 2 Jun 2010 20:35:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o52KZuso061637; Wed, 2 Jun 2010 20:35:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o52KZuhm061634; Wed, 2 Jun 2010 20:35:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201006022035.o52KZuhm061634@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 2 Jun 2010 20:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208756 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 20:35:56 -0000 Author: trasz Date: Wed Jun 2 20:35:56 2010 New Revision: 208756 URL: http://svn.freebsd.org/changeset/base/208756 Log: MFC r208437: Make acl_get_perm_np(3) work with NFSv4 ACLs. Reviewed by: kientzle@ Approved by: re (kib) Modified: stable/8/lib/libc/posix1e/acl_get.c stable/8/lib/libc/posix1e/acl_perm.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/posix1e/acl_get.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_get.c Wed Jun 2 19:16:58 2010 (r208755) +++ stable/8/lib/libc/posix1e/acl_get.c Wed Jun 2 20:35:56 2010 (r208756) @@ -132,30 +132,6 @@ acl_get_fd_np(int fd, acl_type_t type) return (aclp); } -int -acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) -{ - - if (permset_d == NULL) { - errno = EINVAL; - return (-1); - } - - switch(perm) { - case ACL_READ: - case ACL_WRITE: - case ACL_EXECUTE: - if (*permset_d & perm) - return (1); - break; - default: - errno = EINVAL; - return (-1); - } - - return (0); -} - /* * acl_get_permset() (23.4.17): return via permset_p a descriptor to * the permission set in the ACL entry entry_d. Modified: stable/8/lib/libc/posix1e/acl_perm.c ============================================================================== --- stable/8/lib/libc/posix1e/acl_perm.c Wed Jun 2 19:16:58 2010 (r208755) +++ stable/8/lib/libc/posix1e/acl_perm.c Wed Jun 2 20:35:56 2010 (r208756) @@ -108,3 +108,21 @@ acl_delete_perm(acl_permset_t permset_d, return (0); } + +int +acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm) +{ + + if (permset_d == NULL) { + errno = EINVAL; + return (-1); + } + + if (_perm_is_invalid(perm)) + return (-1); + + if (*permset_d & perm) + return (1); + + return (0); +} From owner-svn-src-stable@FreeBSD.ORG Wed Jun 2 21:00:18 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F53F1065678; Wed, 2 Jun 2010 21:00:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E7848FC15; Wed, 2 Jun 2010 21:00:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o52L0ILT067063; Wed, 2 Jun 2010 21:00:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o52L0IcC067061; Wed, 2 Jun 2010 21:00:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006022100.o52L0IcC067061@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 2 Jun 2010 21:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208757 - stable/8/sys/dev/fdc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 21:00:18 -0000 Author: jkim Date: Wed Jun 2 21:00:18 2010 New Revision: 208757 URL: http://svn.freebsd.org/changeset/base/208757 Log: MFC: r208650 Fix a regression from r203544 (MFC of r200554), which broke fdc(4) attachment to acpi(4). Approved by: re (kib) Modified: stable/8/sys/dev/fdc/fdc_acpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/fdc/fdc_acpi.c ============================================================================== --- stable/8/sys/dev/fdc/fdc_acpi.c Wed Jun 2 20:35:56 2010 (r208756) +++ stable/8/sys/dev/fdc/fdc_acpi.c Wed Jun 2 21:00:18 2010 (r208757) @@ -96,6 +96,7 @@ fdc_acpi_attach(device_t dev) { struct fdc_data *sc; ACPI_BUFFER buf; + ACPI_OBJECT *obj; device_t bus; int error; @@ -131,7 +132,8 @@ fdc_acpi_attach(device_t dev) } /* Add fd child devices as specified. */ - error = fdc_acpi_probe_children(bus, dev, buf.Pointer); + obj = buf.Pointer; + error = fdc_acpi_probe_children(bus, dev, obj->Buffer.Pointer); out: if (buf.Pointer) From owner-svn-src-stable@FreeBSD.ORG Thu Jun 3 08:55:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2456E1065709; Thu, 3 Jun 2010 08:55:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 130028FC26; Thu, 3 Jun 2010 08:55:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o538tjuh024440; Thu, 3 Jun 2010 08:55:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o538tjke024438; Thu, 3 Jun 2010 08:55:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006030855.o538tjke024438@svn.freebsd.org> From: Robert Watson Date: Thu, 3 Jun 2010 08:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208766 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 08:55:46 -0000 Author: rwatson Date: Thu Jun 3 08:55:45 2010 New Revision: 208766 URL: http://svn.freebsd.org/changeset/base/208766 Log: Merge r204810 from head to stable/8: Remove unnecessary locking of divcbinfo lock from div_output(): this has not been required since FreeBSD 7.0 when the so_pcb pointer leading to inp was guaranteed to be stable when a valid socket reference is held (as it is in the output path). Reviewed by: bz Sponsored by: Juniper Networks Approved by: re (kib) Modified: stable/8/sys/netinet/ip_divert.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/ip_divert.c ============================================================================== --- stable/8/sys/netinet/ip_divert.c Thu Jun 3 03:55:22 2010 (r208765) +++ stable/8/sys/netinet/ip_divert.c Thu Jun 3 08:55:45 2010 (r208766) @@ -392,7 +392,6 @@ div_output(struct socket *so, struct mbu struct inpcb *inp; dt->info |= IPFW_IS_DIVERT | IPFW_INFO_OUT; - INP_INFO_WLOCK(&V_divcbinfo); inp = sotoinpcb(so); INP_RLOCK(inp); /* @@ -403,7 +402,6 @@ div_output(struct socket *so, struct mbu ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) { error = EINVAL; INP_RUNLOCK(inp); - INP_INFO_WUNLOCK(&V_divcbinfo); m_freem(m); } else { /* Convert fields to host order for ip_output() */ @@ -444,7 +442,6 @@ div_output(struct socket *so, struct mbu error = ENOBUFS; } INP_RUNLOCK(inp); - INP_INFO_WUNLOCK(&V_divcbinfo); if (error == ENOBUFS) { m_freem(m); return (error); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 3 09:02:53 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9385C1065675; Thu, 3 Jun 2010 09:02:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D828FC0C; Thu, 3 Jun 2010 09:02:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5392rLS026124; Thu, 3 Jun 2010 09:02:53 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5392rHA026122; Thu, 3 Jun 2010 09:02:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006030902.o5392rHA026122@svn.freebsd.org> From: Robert Watson Date: Thu, 3 Jun 2010 09:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208767 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 09:02:53 -0000 Author: rwatson Date: Thu Jun 3 09:02:53 2010 New Revision: 208767 URL: http://svn.freebsd.org/changeset/base/208767 Log: Merge r204826 from head to stable/8: Make udp_set_kernel_tunneling() less forgiving when its invariants are violated: so_pcb can never be NULL for a valid UDP socket, and it is always SOCK_DGRAM. Use sotoinpcb() as the rest of the UDP code does. Reviewed by: bz Sponsored by: Juniper Networks Approved by: re (kib) Modified: stable/8/sys/netinet/udp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Thu Jun 3 08:55:45 2010 (r208766) +++ stable/8/sys/netinet/udp_usrreq.c Thu Jun 3 09:02:53 2010 (r208767) @@ -1439,7 +1439,7 @@ udp_attach(struct socket *so, int proto, return (error); } - inp = (struct inpcb *)so->so_pcb; + inp = sotoinpcb(so); inp->inp_vflag |= INP_IPV4; inp->inp_ip_ttl = V_ip_defttl; @@ -1462,17 +1462,10 @@ udp_set_kernel_tunneling(struct socket * struct inpcb *inp; struct udpcb *up; - KASSERT(so->so_type == SOCK_DGRAM, ("udp_set_kernel_tunneling: !dgram")); - KASSERT(so->so_pcb != NULL, ("udp_set_kernel_tunneling: NULL inp")); - if (so->so_type != SOCK_DGRAM) { - /* Not UDP socket... sorry! */ - return (ENOTSUP); - } - inp = (struct inpcb *)so->so_pcb; - if (inp == NULL) { - /* NULL INP? */ - return (EINVAL); - } + KASSERT(so->so_type == SOCK_DGRAM, + ("udp_set_kernel_tunneling: !dgram")); + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("udp_set_kernel_tunneling: inp == NULL")); INP_WLOCK(inp); up = intoudpcb(inp); if (up->u_tun_func != NULL) { From owner-svn-src-stable@FreeBSD.ORG Thu Jun 3 09:06:51 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15EC91065670; Thu, 3 Jun 2010 09:06:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04F968FC13; Thu, 3 Jun 2010 09:06:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5396oQL027019; Thu, 3 Jun 2010 09:06:50 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5396oR8027017; Thu, 3 Jun 2010 09:06:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006030906.o5396oR8027017@svn.freebsd.org> From: Robert Watson Date: Thu, 3 Jun 2010 09:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208768 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 09:06:51 -0000 Author: rwatson Date: Thu Jun 3 09:06:50 2010 New Revision: 208768 URL: http://svn.freebsd.org/changeset/base/208768 Log: Merge r204830 from head to stable/8 Locking the tcbinfo structure should not be necessary in tcp_timer_delack(), so don't. Reviewed by: bz Sponsored by: Juniper Networks Approved by: re (kib) Modified: stable/8/sys/netinet/tcp_timer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/tcp_timer.c ============================================================================== --- stable/8/sys/netinet/tcp_timer.c Thu Jun 3 09:02:53 2010 (r208767) +++ stable/8/sys/netinet/tcp_timer.c Thu Jun 3 09:06:50 2010 (r208768) @@ -162,7 +162,6 @@ tcp_timer_delack(void *xtp) struct inpcb *inp; CURVNET_SET(tp->t_vnet); - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; /* * XXXRW: While this assert is in fact correct, bugs in the tcpcb @@ -173,12 +172,10 @@ tcp_timer_delack(void *xtp) */ if (inp == NULL) { tcp_timer_race++; - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } INP_WLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack) || !callout_active(&tp->t_timers->tt_delack)) { INP_WUNLOCK(inp); From owner-svn-src-stable@FreeBSD.ORG Thu Jun 3 09:15:53 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EA5A1065675; Thu, 3 Jun 2010 09:15:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23E198FC1F; Thu, 3 Jun 2010 09:15:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o539FruD029026; Thu, 3 Jun 2010 09:15:53 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o539FrjJ029024; Thu, 3 Jun 2010 09:15:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006030915.o539FrjJ029024@svn.freebsd.org> From: Robert Watson Date: Thu, 3 Jun 2010 09:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208769 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 09:15:53 -0000 Author: rwatson Date: Thu Jun 3 09:15:52 2010 New Revision: 208769 URL: http://svn.freebsd.org/changeset/base/208769 Log: Merge r205010 from head to stable/8: Update nfsrv_getsocksndseq() for changes in TCP internals since FreeBSD 6.x: - so_pcb is now guaranteed to be non-NULL and valid if a valid socket reference is held. - Need to check INP_TIMEWAIT and INP_DROPPED before assuming inp_ppcb is a tcpcb, as it might be a tcptw or NULL otherwise. - tp can never be NULL by the end of the function, so only check TCPS_ESTABLISHED before extracting tcpcb fields. The NFS server arguably incorporates too many assumptions about TCP internals, but fixing that is left for another day. Reviewed by: bz Reviewed and tested by: rmacklem Sponsored by: Juniper Networks Approved by: re (kib) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Thu Jun 3 09:06:50 2010 (r208768) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Thu Jun 3 09:15:52 2010 (r208769) @@ -2674,24 +2674,23 @@ nfsrv_getsocksndseq(struct socket *so, t { struct inpcb *inp; struct tcpcb *tp; - int error = EPIPE; - INP_INFO_RLOCK(&V_tcbinfo); inp = sotoinpcb(so); - if (inp == NULL) { - INP_INFO_RUNLOCK(&V_tcbinfo); - return (error); - } + KASSERT(inp != NULL, ("nfsrv_getsocksndseq: inp == NULL")); INP_RLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + INP_RUNLOCK(inp); + return (EPIPE); + } tp = intotcpcb(inp); - if (tp != NULL && tp->t_state == TCPS_ESTABLISHED) { - *maxp = tp->snd_max; - *unap = tp->snd_una; - error = 0; + if (tp->t_state != TCPS_ESTABLISHED) { + INP_RUNLOCK(inp); + return (EPIPE); } + *maxp = tp->snd_max; + *unap = tp->snd_una; INP_RUNLOCK(inp); - return (error); + return (0); } /* From owner-svn-src-stable@FreeBSD.ORG Thu Jun 3 13:35:26 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B0D11065674; Thu, 3 Jun 2010 13:35:26 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8BDD38FC1F; Thu, 3 Jun 2010 13:35:22 +0000 (UTC) Received: by wwb22 with SMTP id 22so102230wwb.13 for ; Thu, 03 Jun 2010 06:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=sL8E3UZ2jHO/1V4OBu+nKg9/Hi0f3LTdCCDp5hsEovc=; b=j66hGir3qm31IMcVX0s4EqrJQVhXCQCF+0Xpiu5+gOxSaD5RkcF/ndxhYe4D4V6meI ywKhuM/VTwLrp99YsSuR0OOfQTEo7rXWvK2nR+mviugeVa83ng/lQKFrTiTLQIrY+vzZ VLWkAkR5whu69jQFlv/iq3DsZf6843xlSjQUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=jrKtXKopvEOIn8Nb5xm+xLeCQm4LK48EzkWOJtdKUXgfPtpzm/1xoPAb4Fok1XMB2A o/96htvRIXPItKJX7TrQjbJeXFBWr04RSnyfxnFYQ2JiKxKbqPBhf2rWqKheDMuyP/aq Wsg5FRyEok7h0Ct8oJUqu24+XvByp9Kr7oJUo= Received: by 10.227.136.195 with SMTP id s3mr9464378wbt.1.1275570584549; Thu, 03 Jun 2010 06:09:44 -0700 (PDT) MIME-Version: 1.0 Sender: ermal.luci@gmail.com Received: by 10.216.8.68 with HTTP; Thu, 3 Jun 2010 06:09:21 -0700 (PDT) In-Reply-To: <201006030855.o538tjke024438@svn.freebsd.org> References: <201006030855.o538tjke024438@svn.freebsd.org> From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Date: Thu, 3 Jun 2010 15:09:21 +0200 X-Google-Sender-Auth: vy8XdFOzyzfVosZAxEbno_hO5HQ Message-ID: To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208766 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 13:35:26 -0000 On Thu, Jun 3, 2010 at 10:55 AM, Robert Watson wrote: > Author: rwatson > Date: Thu Jun =A03 08:55:45 2010 > New Revision: 208766 > URL: http://svn.freebsd.org/changeset/base/208766 > > Log: > =A0Merge r204810 from head to stable/8: > > =A0 =A0Remove unnecessary locking of divcbinfo lock from div_output(): th= is has > =A0 =A0not been required since FreeBSD 7.0 when the so_pcb pointer leadin= g to inp > =A0 =A0was guaranteed to be stable when a valid socket reference is held = (as it > =A0 =A0is in the output path). > > =A0 =A0Reviewed by: =A0 =A0 =A0 =A0bz > =A0 =A0Sponsored by: =A0 =A0 =A0 Juniper Networks > > =A0Approved by: =A0re (kib) > > Modified: > =A0stable/8/sys/netinet/ip_divert.c > Directory Properties: > =A0stable/8/sys/ =A0 (props changed) > =A0stable/8/sys/amd64/include/xen/ =A0 (props changed) > =A0stable/8/sys/cddl/contrib/opensolaris/ =A0 (props changed) > =A0stable/8/sys/contrib/dev/acpica/ =A0 (props changed) > =A0stable/8/sys/contrib/pf/ =A0 (props changed) > =A0stable/8/sys/dev/xen/xenpci/ =A0 (props changed) > =A0stable/8/sys/geom/sched/ =A0 (props changed) > > Modified: stable/8/sys/netinet/ip_divert.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/netinet/ip_divert.c =A0 =A0Thu Jun =A03 03:55:22 2010 = =A0 =A0 =A0 =A0(r208765) > +++ stable/8/sys/netinet/ip_divert.c =A0 =A0Thu Jun =A03 08:55:45 2010 = =A0 =A0 =A0 =A0(r208766) > @@ -392,7 +392,6 @@ div_output(struct socket *so, struct mbu > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct inpcb *inp; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dt->info |=3D IPFW_IS_DIVERT | IPFW_INFO_O= UT; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 INP_INFO_WLOCK(&V_divcbinfo); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0inp =3D sotoinpcb(so); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0INP_RLOCK(inp); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > @@ -403,7 +402,6 @@ div_output(struct socket *so, struct mbu > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((u_short)ntohs(ip->ip_len) > m->= m_pkthdr.len)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D EINVAL; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0INP_RUNLOCK(inp); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 INP_INFO_WUNLOCK(&V_divcbin= fo); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m_freem(m); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Convert fields to host = order for ip_output() */ > @@ -444,7 +442,6 @@ div_output(struct socket *so, struct mbu > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0error =3D ENOBUFS; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0INP_RUNLOCK(inp); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 INP_INFO_WUNLOCK(&V_divcbin= fo); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (error =3D=3D ENOBUFS) = { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m_freem(m)= ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (er= ror); > Would it make sense to remove even passing the interface name up and actually send the interface index? That is what we are doing at pfSense and it works quite ok. --=20 Ermal From owner-svn-src-stable@FreeBSD.ORG Fri Jun 4 08:46:27 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F8B3106566C; Fri, 4 Jun 2010 08:46:27 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB728FC1F; Fri, 4 Jun 2010 08:46:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o548kRcI047506; Fri, 4 Jun 2010 08:46:27 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o548kQva047504; Fri, 4 Jun 2010 08:46:26 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006040846.o548kQva047504@svn.freebsd.org> From: Martin Matuska Date: Fri, 4 Jun 2010 08:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208799 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 08:46:27 -0000 Author: mm Date: Fri Jun 4 08:46:26 2010 New Revision: 208799 URL: http://svn.freebsd.org/changeset/base/208799 Log: MFC r208689: Fix ZIL close when doing zfs rollback or zfs receive on a mounted dataset. The fix is a partial import and merge of OpenSolaris onnv revisions 8227:f7d7be9b1f56. and 9292:e112194b5b73 Reviewed by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6798298) Approved by: re (kib) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jun 4 08:19:43 2010 (r208798) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jun 4 08:46:26 2010 (r208799) @@ -499,6 +499,12 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t dmu_objset_set_user(zfsvfs->z_os, zfsvfs); mutex_exit(&zfsvfs->z_os->os->os_user_ptr_lock); + zfsvfs->z_log = zil_open(zfsvfs->z_os, zfs_get_data); + if (zil_disable) { + zil_destroy(zfsvfs->z_log, B_FALSE); + zfsvfs->z_log = NULL; + } + /* * If we are not mounting (ie: online recv), then we don't * have to worry about replaying the log as we blocked all @@ -512,21 +518,45 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t * allow replays to succeed. */ readonly = zfsvfs->z_vfs->vfs_flag & VFS_RDONLY; - zfsvfs->z_vfs->vfs_flag &= ~VFS_RDONLY; - - /* - * Parse and replay the intent log. - */ - zil_replay(zfsvfs->z_os, zfsvfs, &zfsvfs->z_assign, - zfs_replay_vector, zfs_unlinked_drain); + if (readonly != 0) + zfsvfs->z_vfs->vfs_flag &= ~VFS_RDONLY; + else + zfs_unlinked_drain(zfsvfs); - zfs_unlinked_drain(zfsvfs); + if (zfsvfs->z_log) { + /* + * Parse and replay the intent log. + * + * Because of ziltest, this must be done after + * zfs_unlinked_drain(). (Further note: ziltest + * doesn't use readonly mounts, where + * zfs_unlinked_drain() isn't called.) This is because + * ziltest causes spa_sync() to think it's committed, + * but actually it is not, so the intent log contains + * many txg's worth of changes. + * + * In particular, if object N is in the unlinked set in + * the last txg to actually sync, then it could be + * actually freed in a later txg and then reallocated + * in a yet later txg. This would write a "create + * object N" record to the intent log. Normally, this + * would be fine because the spa_sync() would have + * written out the fact that object N is free, before + * we could write the "create object N" intent log + * record. + * + * But when we are in ziltest mode, we advance the "open + * txg" without actually spa_sync()-ing the changes to + * disk. So we would see that object N is still + * allocated and in the unlinked set, and there is an + * intent log record saying to allocate it. + */ + zil_replay(zfsvfs->z_os, zfsvfs, &zfsvfs->z_assign, + zfs_replay_vector, zfs_unlinked_drain); + } zfsvfs->z_vfs->vfs_flag |= readonly; /* restore readonly bit */ } - if (!zil_disable) - zfsvfs->z_log = zil_open(zfsvfs->z_os, zfs_get_data); - return (0); } From owner-svn-src-stable@FreeBSD.ORG Fri Jun 4 10:11:31 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C40106566B; Fri, 4 Jun 2010 10:11:31 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF8848FC13; Fri, 4 Jun 2010 10:11:30 +0000 (UTC) Received: from [192.168.2.105] (host86-162-158-86.range86-162.btcentralplus.com [86.162.158.86]) by cyrus.watson.org (Postfix) with ESMTPSA id A237646B7E; Fri, 4 Jun 2010 06:11:29 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=iso-8859-1 From: "Robert N. M. Watson" In-Reply-To: Date: Fri, 4 Jun 2010 11:11:27 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <0925CEED-A973-4820-A8DA-E5EDD44CCBDF@freebsd.org> References: <201006030855.o538tjke024438@svn.freebsd.org> To: =?iso-8859-1?Q?Ermal_Lu=E7i?= X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208766 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 10:11:31 -0000 On 3 Jun 2010, at 14:09, Ermal Lu=E7i wrote: > Would it make sense to remove even passing the interface name up and > actually send the > interface index? >=20 > That is what we are doing at pfSense and it works quite ok. I see one important argument for doing this: - Looking up an interface by number instead of by name has a number of = advantages. - User programs that already reason about network interfaces by ifindex = don't have to take an indirection. However, it has two important downsides: - It changes an existing API that a moderate number of applications = depend on. - Applications that reason about ifnet names now have to take an = indirection, which might well mean monitoring routing sockets for = interface renames/additions/removals, additional sysctls, etc. As such, I'm not sure the benefits of replacing the current behavior = with the proposed new behavior is worth the cost. An alternative = approach might be to add a socket option to set the disposition of the = divert socket, defaulting to current behavior but optionally switching = to a different interpretation of the sockaddr passed in (i.e., use the = ifindex instead when the option is set). Could you say a bit more about = why you found this change advantageous in your environment, and whether = the socket option approach would be problematic there? Robert= From owner-svn-src-stable@FreeBSD.ORG Fri Jun 4 14:06:59 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0FCB106564A; Fri, 4 Jun 2010 14:06:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E019D8FC15; Fri, 4 Jun 2010 14:06:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o54E6xeP022574; Fri, 4 Jun 2010 14:06:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o54E6xPn022572; Fri, 4 Jun 2010 14:06:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006041406.o54E6xPn022572@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 4 Jun 2010 14:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208801 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 14:07:00 -0000 Author: kib Date: Fri Jun 4 14:06:59 2010 New Revision: 208801 URL: http://svn.freebsd.org/changeset/base/208801 Log: MFC r208374: Remove POLLHUP from the flags used to test for to set exceptfsd fd_set bits in select(2). It seems that historical behaviour is to not reporting exception on EOF, and several applications are broken. Approved by: re (kensmith) Modified: stable/8/sys/kern/sys_generic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Fri Jun 4 13:55:55 2010 (r208800) +++ stable/8/sys/kern/sys_generic.c Fri Jun 4 14:06:59 2010 (r208801) @@ -996,7 +996,7 @@ done: static int select_flags[3] = { POLLRDNORM | POLLHUP | POLLERR, POLLWRNORM | POLLHUP | POLLERR, - POLLRDBAND | POLLHUP | POLLERR + POLLRDBAND | POLLERR }; /* From owner-svn-src-stable@FreeBSD.ORG Fri Jun 4 19:33:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 850CE1065670; Fri, 4 Jun 2010 19:33:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5078FC19; Fri, 4 Jun 2010 19:33:42 +0000 (UTC) Received: by mail-wy0-f182.google.com with SMTP id 28so1504829wyf.13 for ; Fri, 04 Jun 2010 12:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=p1wItY9D4mx7cECRvJlc0lFzXngaJvn3+m2dNv5DZuE=; b=xY6JhnRwn2pyFWVFP1LyWKFuLCYGw+ieHG+DQ5CLCUgdEc4H9V4MwE38YeGuynry4S bEb8EpJrJn0VUKgB+UInQ/NXC6AE5y5RY7EzP4DcvsMOxV9UuHabJle1fa/adZVAACyD /OC5ysBeWDTlOCzF33ZyVv2+Lak28oDGgpOYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=rox//qEQ6Y3F2KBHEM8B+mhVtWKuX3FFXEBvQB4jijW5/G8kWUQVNO4DT1VVG7dIBI cHMPDxrmCSm7jS42pR/8p/vhnJW+S8wuPh2chfNWVrjBnPXbAhG7aPZRbbl0tP/EGxBw YyrkQ9IROQsga026+JIy6s607VuuTl0ejQGUA= Received: by 10.216.86.195 with SMTP id w45mr2611949wee.47.1275680021712; Fri, 04 Jun 2010 12:33:41 -0700 (PDT) MIME-Version: 1.0 Sender: ermal.luci@gmail.com Received: by 10.216.8.68 with HTTP; Fri, 4 Jun 2010 12:33:21 -0700 (PDT) In-Reply-To: <0925CEED-A973-4820-A8DA-E5EDD44CCBDF@freebsd.org> References: <201006030855.o538tjke024438@svn.freebsd.org> <0925CEED-A973-4820-A8DA-E5EDD44CCBDF@freebsd.org> From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Date: Fri, 4 Jun 2010 20:33:21 +0100 X-Google-Sender-Auth: pmb5GVZRbyzwRHBdbKy6HxWCSRU Message-ID: To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208766 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 19:33:43 -0000 On Fri, Jun 4, 2010 at 11:11 AM, Robert N. M. Watson wrote: > > On 3 Jun 2010, at 14:09, Ermal Lu=E7i wrote: > >> Would it make sense to remove even passing the interface name up and >> actually send the >> interface index? >> >> That is what we are doing at pfSense and it works quite ok. > > I see one important argument for doing this: > > - Looking up an interface by number instead of by name has a number of ad= vantages. > - User programs that already reason about network interfaces by ifindex d= on't have to take an indirection. > > However, it has two important downsides: > > - It changes an existing API that a moderate number of applications depen= d on. > - Applications that reason about ifnet names now have to take an indirect= ion, which might well mean monitoring routing sockets for interface renames= /additions/removals, additional sysctls, etc. > > As such, I'm not sure the benefits of replacing the current behavior with= the proposed new behavior is worth the cost. An alternative approach might= be to add a socket option to set the disposition of the divert socket, def= aulting to current behavior but optionally switching to a different interpr= etation of the sockaddr passed in (i.e., use the ifindex instead when the o= ption is set). Could you say a bit more about why you found this change adv= antageous in your environment, and whether the socket option approach would= be problematic there? Well the main motivation about it was the limitation on interface name length that can be stored in sin_zero. Furthermore speed processing is faster since the interface name does not have to be reconstructed when diverting a packet. The patch is here http://tinyurl.com/3a9h5gs Interface event are not an issue for pfSense architecture since it controls all the underlying data and i think most of the divert applications do not care much about interface events apart renaming. Keeping both options sounds reasonable too. --=20 Ermal From owner-svn-src-stable@FreeBSD.ORG Sat Jun 5 13:30:33 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 239321065672; Sat, 5 Jun 2010 13:30:33 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EE2598FC16; Sat, 5 Jun 2010 13:30:32 +0000 (UTC) Received: from [192.168.2.105] (host86-162-158-86.range86-162.btcentralplus.com [86.162.158.86]) by cyrus.watson.org (Postfix) with ESMTPSA id D5D1946B1A; Sat, 5 Jun 2010 09:30:31 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=iso-8859-1 From: "Robert N. M. Watson" In-Reply-To: Date: Sat, 5 Jun 2010 14:30:30 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <8185F188-5D80-4215-976C-4CAC6C4C5C26@freebsd.org> References: <201006030855.o538tjke024438@svn.freebsd.org> <0925CEED-A973-4820-A8DA-E5EDD44CCBDF@freebsd.org> To: =?iso-8859-1?Q?Ermal_Lu=E7i?= X-Mailer: Apple Mail (2.1078) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r208766 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 13:30:33 -0000 On 4 Jun 2010, at 20:33, Ermal Lu=E7i wrote: > Interface event are not an issue for pfSense architecture since it > controls all the underlying data and i think most of the divert > applications do not care much about interface events apart renaming. > Keeping both options sounds reasonable too. A patch along these lines would, I think, be most welcome. There is, of = course, the issue of a short window before the socket option is set -- = possibly there's a good way to distinguish this via the sockaddr? Robert= From owner-svn-src-stable@FreeBSD.ORG Sat Jun 5 14:53:34 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6F51065674; Sat, 5 Jun 2010 14:53:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB63C8FC13; Sat, 5 Jun 2010 14:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55ErYi4054436; Sat, 5 Jun 2010 14:53:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55ErYL7054432; Sat, 5 Jun 2010 14:53:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006051453.o55ErYL7054432@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Jun 2010 14:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208832 - in stable/8/sys: kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 14:53:35 -0000 Author: kib Date: Sat Jun 5 14:53:34 2010 New Revision: 208832 URL: http://svn.freebsd.org/changeset/base/208832 Log: MFC r208731: Add a facility to dynamically adjust or unconfigure p1003_1b mib. Use it to allow to tune sem_nsem_max at runtime, only when sem.ko module is present in kernel. Approved by: re (bz) Modified: stable/8/sys/kern/posix4_mib.c stable/8/sys/kern/uipc_sem.c stable/8/sys/sys/posix4.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/posix4_mib.c ============================================================================== --- stable/8/sys/kern/posix4_mib.c Sat Jun 5 12:53:44 2010 (r208831) +++ stable/8/sys/kern/posix4_mib.c Sat Jun 5 14:53:34 2010 (r208832) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); static int facility[CTL_P1003_1B_MAXID - 1]; static int facility_initialized[CTL_P1003_1B_MAXID - 1]; +static int p31b_sysctl_proc(SYSCTL_HANDLER_ARGS); + /* OID_AUTO isn't working with sysconf(3). I guess I'd have to * modify it to do a lookup by name from the index. * For now I've left it a top-level sysctl. @@ -55,16 +57,21 @@ static int facility_initialized[CTL_P100 SYSCTL_DECL(_p1003_1b); #define P1B_SYSCTL(num, name) \ -SYSCTL_INT(_p1003_1b, num, \ - name, CTLFLAG_RD, facility + num - 1, 0, ""); + SYSCTL_INT(_p1003_1b, num, name, CTLFLAG_RD, facility + num - 1, 0, ""); +#define P1B_SYSCTL_RW(num, name) \ + SYSCTL_PROC(_p1003_1b, num, name, CTLTYPE_INT | CTLFLAG_RW, NULL, num, \ + p31b_sysctl_proc, "I", ""); #else SYSCTL_DECL(_kern_p1003_1b); #define P1B_SYSCTL(num, name) \ -SYSCTL_INT(_kern_p1003_1b, OID_AUTO, \ - name, CTLFLAG_RD, facility + num - 1, 0, ""); + SYSCTL_INT(_kern_p1003_1b, OID_AUTO, name, CTLFLAG_RD, \ + facility + num - 1, 0, ""); +#define P1B_SYSCTL_RW(num, name) \ + SYSCTL_PROC(_p1003_1b, OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW, NULL, \ + num, p31b_sysctl_proc, "I", ""); SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW, 0, "P1003.1B"); #endif @@ -91,13 +98,28 @@ P1B_SYSCTL(CTL_P1003_1B_DELAYTIMER_MAX, P1B_SYSCTL(CTL_P1003_1B_MQ_OPEN_MAX, mq_open_max); P1B_SYSCTL(CTL_P1003_1B_PAGESIZE, pagesize); P1B_SYSCTL(CTL_P1003_1B_RTSIG_MAX, rtsig_max); -P1B_SYSCTL(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max); +P1B_SYSCTL_RW(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max); P1B_SYSCTL(CTL_P1003_1B_SEM_VALUE_MAX, sem_value_max); P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max); P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max); #define P31B_VALID(num) ((num) >= 1 && (num) < CTL_P1003_1B_MAXID) +static int +p31b_sysctl_proc(SYSCTL_HANDLER_ARGS) +{ + int error, num, val; + + num = arg2; + if (!P31B_VALID(num)) + return (EINVAL); + val = facility_initialized[num] ? facility[num - 1] : 0; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error == 0 && req->newptr != NULL && facility_initialized[num]) + facility[num - 1] = val; + return (error); +} + /* p31b_setcfg: Set the configuration */ void @@ -110,6 +132,14 @@ p31b_setcfg(int num, int value) } } +void +p31b_unsetcfg(int num) +{ + + facility[num - 1] = 0; + facility_initialized[num -1] = 0; +} + int p31b_getcfg(int num) { Modified: stable/8/sys/kern/uipc_sem.c ============================================================================== --- stable/8/sys/kern/uipc_sem.c Sat Jun 5 12:53:44 2010 (r208831) +++ stable/8/sys/kern/uipc_sem.c Sat Jun 5 14:53:34 2010 (r208832) @@ -977,6 +977,8 @@ ksem_module_destroy(void) sx_destroy(&ksem_dict_lock); mtx_destroy(&ksem_count_lock); mtx_destroy(&sem_lock); + p31b_unsetcfg(CTL_P1003_1B_SEM_VALUE_MAX); + p31b_unsetcfg(CTL_P1003_1B_SEM_NSEMS_MAX); } static int Modified: stable/8/sys/sys/posix4.h ============================================================================== --- stable/8/sys/sys/posix4.h Sat Jun 5 12:53:44 2010 (r208831) +++ stable/8/sys/sys/posix4.h Sat Jun 5 14:53:34 2010 (r208832) @@ -64,6 +64,7 @@ int p31b_proc(struct proc *, pid_t, stru void p31b_setcfg(int, int); int p31b_getcfg(int); int p31b_iscfg(int); +void p31b_unsetcfg(int); #ifdef _KPOSIX_PRIORITY_SCHEDULING From owner-svn-src-stable@FreeBSD.ORG Sat Jun 5 18:30:42 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A47931065670; Sat, 5 Jun 2010 18:30:42 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9351E8FC1C; Sat, 5 Jun 2010 18:30:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55IUgaV002751; Sat, 5 Jun 2010 18:30:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55IUgu6002749; Sat, 5 Jun 2010 18:30:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201006051830.o55IUgu6002749@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 5 Jun 2010 18:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208848 - stable/8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 18:30:42 -0000 Author: gavin Date: Sat Jun 5 18:30:42 2010 New Revision: 208848 URL: http://svn.freebsd.org/changeset/base/208848 Log: Fix typo (COMPAT_FREEBDS32 -> COMPAT_FREEBSD32) Direct commit to stable/8 as this text isn't in head. PR: docs/147497 Submitted by: Jack Low Approved by: re (kib) Modified: stable/8/UPDATING Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Sat Jun 5 18:24:41 2010 (r208847) +++ stable/8/UPDATING Sat Jun 5 18:30:42 2010 (r208848) @@ -40,7 +40,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. The meanings correspond to the relevant IPv4 variables. 20100417: - COMPAT_IA32 has been added as an alias for COMPAT_FREEBDS32. A new + COMPAT_IA32 has been added as an alias for COMPAT_FREEBSD32. A new version of config(8) is required. The error message when you hit this condition is confusing (COMPAT_FREEBSD32 duplicate option), when it should really say "your config is too old to compile this new kernel." From owner-svn-src-stable@FreeBSD.ORG Sat Jun 5 20:51:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E63A41065674; Sat, 5 Jun 2010 20:51:56 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D46078FC08; Sat, 5 Jun 2010 20:51:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55KpuW8034558; Sat, 5 Jun 2010 20:51:56 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55Kpu8K034556; Sat, 5 Jun 2010 20:51:56 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006052051.o55Kpu8K034556@svn.freebsd.org> From: Rui Paulo Date: Sat, 5 Jun 2010 20:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208851 - stable/8/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 20:51:57 -0000 Author: rpaulo Date: Sat Jun 5 20:51:56 2010 New Revision: 208851 URL: http://svn.freebsd.org/changeset/base/208851 Log: MFC r208696: Don't reference null pointer in hwmp_recv_preq(). Found with: Coverity Prevent(tm) CID: 3912 Approved by: re (bz) Modified: stable/8/sys/net80211/ieee80211_hwmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net80211/ieee80211_hwmp.c ============================================================================== --- stable/8/sys/net80211/ieee80211_hwmp.c Sat Jun 5 20:41:22 2010 (r208850) +++ stable/8/sys/net80211/ieee80211_hwmp.c Sat Jun 5 20:51:56 2010 (r208851) @@ -707,6 +707,9 @@ hwmp_recv_preq(struct ieee80211vap *vap, rtorig = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); if (rtorig == NULL) rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr); + if (rtorig == NULL) + /* XXX stat */ + return; hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route); /* * Sequence number validation.