From owner-svn-src-stable-10@freebsd.org Mon Jul 23 17:11:05 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 452571050640; Mon, 23 Jul 2018 17:11:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBB1D856F2; Mon, 23 Jul 2018 17:11:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id BF90510AFD2; Mon, 23 Jul 2018 13:10:57 -0400 (EDT) Subject: Re: svn commit: r336448 - stable/10 To: Peter Jeremy , rgrimes@freebsd.org References: <201807180932.w6I9WheM066205@repo.freebsd.org> <201807181441.w6IEfNMJ007767@pdx.rh.CN85.dnsmgr.net> <20180718190506.GA45754@server.rulingia.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: John Baldwin Message-ID: Date: Mon, 23 Jul 2018 10:10:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180718190506.GA45754@server.rulingia.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 23 Jul 2018 13:10:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:11:05 -0000 On 7/18/18 12:05 PM, Peter Jeremy wrote: > On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: >>> Author: peterj >>> Date: Wed Jul 18 09:32:43 2018 >>> New Revision: 336448 >>> URL: https://svnweb.freebsd.org/changeset/base/336448 >>> >>> Log: >>> Retrospectively document SVN branch point for stable-10 and its releases. >>> >>> This is a direct commit to stable/10 because the releases are taken >>> from the stable/10 branch. >>> >>> Approved by: jhb (mentor) >>> Differential Revision: D16263 >> >> Actually I see no reason not to document these in the mainline >> UPDATING file and making these MFC's. As is now when looking >> at UPDATING from head I can not easily find the branch point >> for any of these releases and that is probably the most useful >> time for this information. If I already have a branch I probably >> already know what its anchor point is. > > I only put the releng/x.y branch points into the relevant stable/x/UPDATING > because releng/x.y is branched off stable/x and I don't think it makes much > sense to document those in head/UPDATING. The stable/x branchpoints are in > both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- > point was already in head/UPDATING. I agree with this. We should document them in the source branch, but not in grandparents like head where there is no single head commit that becomes releng/X.Y. > Do you have a quick way to find branch points? The best I've found is > "svn log -r 1:HEAD --limit 1 --stop-on-copy" within a branch and that > is quite resource intensive on the SVN server. Finding a file that doesn't change often like MAINTAINERS and only doing the log against that shouldn't be as bad. -- John Baldwin From owner-svn-src-stable-10@freebsd.org Mon Jul 23 17:36:43 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295AD1050DBA; Mon, 23 Jul 2018 17:36:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8694386B29; Mon, 23 Jul 2018 17:36:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w6NHadMA032632; Mon, 23 Jul 2018 10:36:39 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w6NHadhr032631; Mon, 23 Jul 2018 10:36:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807231736.w6NHadhr032631@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336448 - stable/10 In-Reply-To: To: John Baldwin Date: Mon, 23 Jul 2018 10:36:39 -0700 (PDT) CC: Peter Jeremy , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:36:43 -0000 > On 7/18/18 12:05 PM, Peter Jeremy wrote: > > On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: > >>> Author: peterj > >>> Date: Wed Jul 18 09:32:43 2018 > >>> New Revision: 336448 > >>> URL: https://svnweb.freebsd.org/changeset/base/336448 > >>> > >>> Log: > >>> Retrospectively document SVN branch point for stable-10 and its releases. > >>> > >>> This is a direct commit to stable/10 because the releases are taken > >>> from the stable/10 branch. > >>> > >>> Approved by: jhb (mentor) > >>> Differential Revision: D16263 > >> > >> Actually I see no reason not to document these in the mainline > >> UPDATING file and making these MFC's. As is now when looking > >> at UPDATING from head I can not easily find the branch point > >> for any of these releases and that is probably the most useful > >> time for this information. If I already have a branch I probably > >> already know what its anchor point is. > > > > I only put the releng/x.y branch points into the relevant stable/x/UPDATING > > because releng/x.y is branched off stable/x and I don't think it makes much > > sense to document those in head/UPDATING. The stable/x branchpoints are in > > both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- > > point was already in head/UPDATING. > > I agree with this. We should document them in the source branch, but not > in grandparents like head where there is no single head commit that becomes > releng/X.Y. My only counter to this is that often what I am investigating is the change between ^head/ and some release, say 11.2 and I really do not want to go grovel in stable/11 to find the rXXXXXX for 11.2, that is just a PITA. Though the branch point for stable/11 is interesting, it is rarely usefull for any thing very meaningful. It would actually be useful to have a file that listed all of these for all branch points maintained in ^head/. > > Do you have a quick way to find branch points? The best I've found is > > "svn log -r 1:HEAD --limit 1 --stop-on-copy" within a branch and that > > is quite resource intensive on the SVN server. > > Finding a file that doesn't change often like MAINTAINERS and only doing the > log against that shouldn't be as bad. Thats a good tip. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-10@freebsd.org Mon Jul 23 17:38:36 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7611E1050E8D; Mon, 23 Jul 2018 17:38:36 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2128386DB7; Mon, 23 Jul 2018 17:38:36 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00E651FA52; Mon, 23 Jul 2018 17:38:36 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6NHcZtK019459; Mon, 23 Jul 2018 17:38:35 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6NHcZdL019458; Mon, 23 Jul 2018 17:38:35 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201807231738.w6NHcZdL019458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Mon, 23 Jul 2018 17:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336644 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 336644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:38:36 -0000 Author: dexuan Date: Mon Jul 23 17:38:35 2018 New Revision: 336644 URL: https://svnweb.freebsd.org/changeset/base/336644 Log: MFC: 336426 r336426 hyperv/hn: Fix panic in hypervisor code upon device detach event Submitted by: hselasky Reviewed by: dexuan Differential Revision: https://reviews.freebsd.org/D16139 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:35:20 2018 (r336643) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:38:35 2018 (r336644) @@ -1157,6 +1157,13 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne strcmp(ifp->if_dname, "vlan") == 0) return (false); + /* + * During detach events ifp->if_addr might be NULL. + * Make sure the bcmp() below doesn't panic on that: + */ + if (ifp->if_addr == NULL || hn_ifp->if_addr == NULL) + return (false); + if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) return (false); From owner-svn-src-stable-10@freebsd.org Mon Jul 23 18:47:05 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6E02105242E; Mon, 23 Jul 2018 18:47:05 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5658289CFC; Mon, 23 Jul 2018 18:47:05 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 375CC205BB; Mon, 23 Jul 2018 18:47:05 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6NIl5at055743; Mon, 23 Jul 2018 18:47:05 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6NIl4LZ055742; Mon, 23 Jul 2018 18:47:04 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201807231847.w6NIl4LZ055742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 23 Jul 2018 18:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336647 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 336647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 18:47:05 -0000 Author: dab Date: Mon Jul 23 18:47:04 2018 New Revision: 336647 URL: https://svnweb.freebsd.org/changeset/base/336647 Log: MFC r336457: Make the definition of struct kevent in event.h match what the man page for kevent(2) says. This is a trivial comment-only fix. The man page for kevent(2) gives the definition of struct kevent, including a comment on each field. The actual definition in sys/event.h omitted the comments on some fields. Add the comments in. Not only does this make the man page and include file agree, but the comments are useful in and of themselves. Sponsored by: Dell EMC Modified: stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Mon Jul 23 18:35:58 2018 (r336646) +++ stable/10/sys/sys/event.h Mon Jul 23 18:47:04 2018 (r336647) @@ -73,9 +73,9 @@ struct kevent { uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ - u_short flags; - u_int fflags; - intptr_t data; + u_short flags; /* action flags for kqueue */ + u_int fflags; /* filter flag value */ + intptr_t data; /* filter data value */ void *udata; /* opaque user data identifier */ }; From owner-svn-src-stable-10@freebsd.org Mon Jul 23 20:36:13 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3BAE1054334; Mon, 23 Jul 2018 20:36:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 581E58D276; Mon, 23 Jul 2018 20:36:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9DC8F10A87D; Mon, 23 Jul 2018 16:36:11 -0400 (EDT) Subject: Re: svn commit: r336448 - stable/10 To: rgrimes@freebsd.org References: <201807231736.w6NHadhr032631@pdx.rh.CN85.dnsmgr.net> Cc: Peter Jeremy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: John Baldwin Message-ID: <7d86153b-8442-27a3-f152-475116c6b1f5@FreeBSD.org> Date: Mon, 23 Jul 2018 11:02:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807231736.w6NHadhr032631@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 23 Jul 2018 16:36:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 20:36:13 -0000 On 7/23/18 10:36 AM, Rodney W. Grimes wrote: >> On 7/18/18 12:05 PM, Peter Jeremy wrote: >>> On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: >>>>> Author: peterj >>>>> Date: Wed Jul 18 09:32:43 2018 >>>>> New Revision: 336448 >>>>> URL: https://svnweb.freebsd.org/changeset/base/336448 >>>>> >>>>> Log: >>>>> Retrospectively document SVN branch point for stable-10 and its releases. >>>>> >>>>> This is a direct commit to stable/10 because the releases are taken >>>>> from the stable/10 branch. >>>>> >>>>> Approved by: jhb (mentor) >>>>> Differential Revision: D16263 >>>> >>>> Actually I see no reason not to document these in the mainline >>>> UPDATING file and making these MFC's. As is now when looking >>>> at UPDATING from head I can not easily find the branch point >>>> for any of these releases and that is probably the most useful >>>> time for this information. If I already have a branch I probably >>>> already know what its anchor point is. >>> >>> I only put the releng/x.y branch points into the relevant stable/x/UPDATING >>> because releng/x.y is branched off stable/x and I don't think it makes much >>> sense to document those in head/UPDATING. The stable/x branchpoints are in >>> both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- >>> point was already in head/UPDATING. >> >> I agree with this. We should document them in the source branch, but not >> in grandparents like head where there is no single head commit that becomes >> releng/X.Y. > > My only counter to this is that often what I am investigating is > the change between ^head/ and some release, say 11.2 and I really > do not want to go grovel in stable/11 to find the rXXXXXX for 11.2, > that is just a PITA. Though the branch point for stable/11 is interesting, > it is rarely usefull for any thing very meaningful. I don't ever grovel around for this in either stable/11 or head to be honest. I usually use the svnweb interface, but doing the svn log quoted previously against a little changed-file on the branch in question (such as MAINTAINERS) via the url is really the better answer. -- John Baldwin From owner-svn-src-stable-10@freebsd.org Sat Jul 28 20:38:11 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30FD1105DE04; Sat, 28 Jul 2018 20:38:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA21080695; Sat, 28 Jul 2018 20:38:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB27F3F3B; Sat, 28 Jul 2018 20:38:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6SKcASL038067; Sat, 28 Jul 2018 20:38:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6SKc9d2038061; Sat, 28 Jul 2018 20:38:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807282038.w6SKc9d2038061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 28 Jul 2018 20:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336846 - in stable/10/sys/fs: nfs nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/10/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 336846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2018 20:38:11 -0000 Author: rmacklem Date: Sat Jul 28 20:38:08 2018 New Revision: 336846 URL: https://svnweb.freebsd.org/changeset/base/336846 Log: MFC: r334492 Add the BindConnectiontoSession operation to the NFSv4.1 server. Under some fairly unusual circumstances, the Linux NFSv4.1 client is doing a BindConnectiontoSession operation for TCP connections. It is also used by the ESXi6.5 NFSv4.1 client. This patch adds this operation to the NFSv4.1 server. PR: 226493 Modified: stable/10/sys/fs/nfs/nfs.h stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfs/nfsproto.h stable/10/sys/fs/nfsserver/nfs_nfsdserv.c stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs.h ============================================================================== --- stable/10/sys/fs/nfs/nfs.h Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfs.h Sat Jul 28 20:38:08 2018 (r336846) @@ -288,6 +288,7 @@ struct nfsreferral { #define LCL_ADMINREVOKED 0x00008000 #define LCL_RECLAIMCOMPLETE 0x00010000 #define LCL_NFSV41 0x00020000 +#define LCL_DONEBINDCONN 0x00040000 #define LCL_GSS LCL_KERBV /* Or of all mechs */ Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Sat Jul 28 20:38:08 2018 (r336846) @@ -136,7 +136,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 }, /* Write */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* ReleaseLockOwner */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Backchannel Ctrl */ - { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Bind Conn to Sess */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Bind Conn to Sess */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Exchange ID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Create Session */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy Session */ Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfs_var.h Sat Jul 28 20:38:08 2018 (r336846) @@ -95,6 +95,7 @@ int nfsrv_getclient(nfsquad_t, int, struct nfsclient * nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *); int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *); int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *); +int nfsrv_bindconnsess(struct nfsrv_descript *, uint8_t *, int *); int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_teststateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *); @@ -230,6 +231,8 @@ int nfsrvd_sequence(struct nfsrv_descript *, int, int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_destroyclientid(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_bindconnsess(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_destroysession(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); Modified: stable/10/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/10/sys/fs/nfs/nfsproto.h Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfsproto.h Sat Jul 28 20:38:08 2018 (r336846) @@ -648,6 +648,15 @@ #define NFSFLAYUTIL_DENSE 0x1 #define NFSFLAYUTIL_COMMIT_THRU_MDS 0x2 +/* Enum values for Bind Connection to Session. */ +#define NFSCDFC4_FORE 0x1 +#define NFSCDFC4_BACK 0x2 +#define NFSCDFC4_FORE_OR_BOTH 0x3 +#define NFSCDFC4_BACK_OR_BOTH 0x7 +#define NFSCDFS4_FORE 0x1 +#define NFSCDFS4_BACK 0x2 +#define NFSCDFS4_BOTH 0x3 + /* Conversion macros */ #define vtonfsv2_mode(t,m) \ txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \ Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jul 28 20:38:08 2018 (r336846) @@ -4020,6 +4020,45 @@ nfsmout: } /* + * nfsv4 bind connection to session service + */ +APPLESTATIC int +nfsrvd_bindconnsess(struct nfsrv_descript *nd, __unused int isdgram, + __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) +{ + uint32_t *tl; + uint8_t sessid[NFSX_V4SESSIONID]; + int error = 0, foreaft; + + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { + nd->nd_repstat = NFSERR_WRONGSEC; + goto nfsmout; + } + NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); + NFSBCOPY(tl, sessid, NFSX_V4SESSIONID); + tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); + foreaft = fxdr_unsigned(int, *tl++); + if (*tl == newnfs_true) { + /* RDMA is not supported. */ + nd->nd_repstat = NFSERR_NOTSUPP; + goto nfsmout; + } + + nd->nd_repstat = nfsrv_bindconnsess(nd, sessid, &foreaft); + if (nd->nd_repstat == 0) { + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * + NFSX_UNSIGNED); + NFSBCOPY(sessid, tl, NFSX_V4SESSIONID); + tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(foreaft); + *tl = newnfs_false; + } +nfsmout: + NFSEXITCODE2(error, nd); + return (error); +} + +/* * nfsv4 destroy session service */ APPLESTATIC int Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jul 28 20:38:08 2018 (r336846) @@ -176,7 +176,7 @@ int (*nfsrv4_ops0[NFSV41_NOPS])(struct nfsrv_descript nfsrvd_write, nfsrvd_releaselckown, nfsrvd_notsupp, - nfsrvd_notsupp, + nfsrvd_bindconnsess, nfsrvd_exchangeid, nfsrvd_createsession, nfsrvd_destroysession, Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jul 28 20:38:08 2018 (r336846) @@ -41,6 +41,7 @@ extern struct nfsstats newnfsstats; extern int nfsrv_lease; extern struct timeval nfsboottime; extern u_int32_t newnfs_true, newnfs_false; +extern int nfsd_debuglevel; NFSV4ROOTLOCKMUTEX; NFSSTATESPINLOCK; @@ -633,10 +634,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struc if (nsep != NULL) { /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) - != 0 && clp->lc_req.nr_client == NULL) { - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + != 0) { + if (clp->lc_req.nr_client == NULL) + clp->lc_req.nr_client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); nd->nd_xprt->xp_p2 = @@ -5893,9 +5895,18 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_ /* * If this session handles the backchannel, save the nd_xprt for this * RPC, since this is the one being used. + * RFC-5661 specifies that the fore channel will be implicitly + * bound by a Sequence operation. However, since some NFSv4.1 clients + * erroneously assumed that the back channel would be implicitly + * bound as well, do the implicit binding unless a + * BindConnectiontoSession has already been done on the session. */ if (sep->sess_clp->lc_req.nr_client != NULL && - (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) { + sep->sess_cbsess.nfsess_xprt != nd->nd_xprt && + (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && + (sep->sess_clp->lc_flags & LCL_DONEBINDCONN) == 0) { + NFSD_DEBUG(2, + "nfsrv_checksequence: implicit back channel bind\n"); savxprt = sep->sess_cbsess.nfsess_xprt; SVC_ACQUIRE(nd->nd_xprt); nd->nd_xprt->xp_p2 = @@ -6025,6 +6036,80 @@ nfsrv_destroysession(struct nfsrv_descript *nd, uint8_ NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); + return (error); +} + +/* + * Bind a connection to a session. + * For now, only certain variants are supported, since the current session + * structure can only handle a single backchannel entry, which will be + * applied to all connections if it is set. + */ +int +nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) +{ + struct nfssessionhash *shp; + struct nfsdsession *sep; + struct nfsclient *clp; + SVCXPRT *savxprt; + int error; + + error = 0; + shp = NFSSESSIONHASH(sessionid); + NFSLOCKSTATE(); + NFSLOCKSESSION(shp); + sep = nfsrv_findsession(sessionid); + if (sep != NULL) { + clp = sep->sess_clp; + if (*foreaftp == NFSCDFC4_BACK || + *foreaftp == NFSCDFC4_BACK_OR_BOTH || + *foreaftp == NFSCDFC4_FORE_OR_BOTH) { + /* Try to set up a backchannel. */ + if (clp->lc_req.nr_client == NULL) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: acquire " + "backchannel\n"); + clp->lc_req.nr_client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + sep->sess_cbprogram, NFSV4_CBVERS); + } + if (clp->lc_req.nr_client != NULL) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: set up " + "backchannel\n"); + savxprt = sep->sess_cbsess.nfsess_xprt; + SVC_ACQUIRE(nd->nd_xprt); + nd->nd_xprt->xp_p2 = + clp->lc_req.nr_client->cl_private; + /* Disable idle timeout. */ + nd->nd_xprt->xp_idletimeout = 0; + sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; + if (savxprt != NULL) + SVC_RELEASE(savxprt); + sep->sess_crflags |= NFSV4CRSESS_CONNBACKCHAN; + clp->lc_flags |= LCL_DONEBINDCONN; + if (*foreaftp == NFSCDFS4_BACK) + *foreaftp = NFSCDFS4_BACK; + else + *foreaftp = NFSCDFS4_BOTH; + } else if (*foreaftp != NFSCDFC4_BACK) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: can't set " + "up backchannel\n"); + sep->sess_crflags &= ~NFSV4CRSESS_CONNBACKCHAN; + clp->lc_flags |= LCL_DONEBINDCONN; + *foreaftp = NFSCDFS4_FORE; + } else { + error = NFSERR_NOTSUPP; + printf("nfsrv_bindconnsess: Can't add " + "backchannel\n"); + } + } else { + NFSD_DEBUG(2, "nfsrv_bindconnsess: Set forechannel\n"); + clp->lc_flags |= LCL_DONEBINDCONN; + *foreaftp = NFSCDFS4_FORE; + } + } else + error = NFSERR_BADSESSION; + NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); return (error); }