From owner-svn-src-all@FreeBSD.ORG Fri Mar 8 19:36:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D336BEA1; Fri, 8 Mar 2013 19:36:36 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C574EC41; Fri, 8 Mar 2013 19:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28JaaSO037760; Fri, 8 Mar 2013 19:36:36 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28JaaN9037759; Fri, 8 Mar 2013 19:36:36 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201303081936.r28JaaN9037759@svn.freebsd.org> From: Ryan Stone Date: Fri, 8 Mar 2013 19:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248066 - stable/9/sys/netgraph X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 19:36:36 -0000 Author: rstone Date: Fri Mar 8 19:36:36 2013 New Revision: 248066 URL: http://svnweb.freebsd.org/changeset/base/248066 Log: MFC r241009 Ensure that all cases that enqueue a netgraph item for delivery by a ngthread properly set the item's depth to 1. In particular, prior to this change if ng_snd_item failed to acquire a lock on a node, the item's depth would not be set at all. This fix ensures that the error code from rcvmsg/ rcvdata is properly passed back to the apply callback. For example, this fixes a bug where an error from rcvmsg/rcvdata would not previously propagate back to a libnetgraph consumer when the message was queued. Reviewed by: mav MFC after: 1 month Sponsored by: Sandvine Incorporated Modified: stable/9/sys/netgraph/ng_base.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_base.c ============================================================================== --- stable/9/sys/netgraph/ng_base.c Fri Mar 8 19:16:24 2013 (r248065) +++ stable/9/sys/netgraph/ng_base.c Fri Mar 8 19:36:36 2013 (r248066) @@ -2005,6 +2005,7 @@ ng_queue_rw(node_p node, item_p item, i NGI_SET_WRITER(item); else NGI_SET_READER(item); + item->depth = 1; NG_QUEUE_LOCK(ngq); /* Set OP_PENDING flag and enqueue the item. */ @@ -2283,7 +2284,6 @@ ng_snd_item(item_p item, int flags) } if (queue) { - item->depth = 1; /* Put it on the queue for that node*/ ng_queue_rw(node, item, rw); return ((flags & NG_PROGRESS) ? EINPROGRESS : 0);