svn commit: r365327 - head/tests/sys/kern

2020-09-04 Thread Konstantin Belousov
Author: kib
Date: Fri Sep  4 12:52:16 2020
New Revision: 365327
URL: https://svnweb.freebsd.org/changeset/base/365327

Log:
  Fix kern_copyin test.
  
  Main part is that kern_copyin on amd64 after LA57 should query the top
  of UVA for correct operations. In fact it should started doing that
  after the workaround for AMD bug with IRET in the last user page was
  fixed by reducing UVA by a page.
  
  Also since we started calculating top of UVA, fix MIPS according to
  the comment.
  
  Reported by:  lwhsu
  PR:   248933
  Reviewed by:  alc, markj
  Sponsored by: The FreeBSD Foundation
  Differential revision:https://reviews.freebsd.org/D26312

Modified:
  head/tests/sys/kern/kern_copyin.c

Modified: head/tests/sys/kern/kern_copyin.c
==
--- head/tests/sys/kern/kern_copyin.c   Fri Sep  4 11:22:18 2020
(r365326)
+++ head/tests/sys/kern/kern_copyin.c   Fri Sep  4 12:52:16 2020
(r365327)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 The FreeBSD Foundation
+ * Copyright (c) 2015, 2020 The FreeBSD Foundation
  * All rights reserved.
  *
  * This software was developed by Konstantin Belousov 
@@ -31,6 +31,8 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -52,21 +54,54 @@ copyin_checker(uintptr_t uaddr, size_t len)
return (ret == -1 ? errno : 0);
 }
 
+#ifdef __amd64__
+static uintptr_t
+get_maxuser_address(void)
+{
+   size_t len;
+   uintptr_t psstrings;
+   int error, mib[4];
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_PS_STRINGS;
+   mib[3] = getpid();
+   error = sysctl(mib, nitems(mib), &psstrings, &len, NULL, 0);
+   if (error != 0)
+   return (0);
+
+   if (psstrings == PS_STRINGS_LA57)
+   return (VM_MAXUSER_ADDRESS_LA57);
+   if (psstrings == PS_STRINGS_LA48)
+   return (VM_MAXUSER_ADDRESS_LA48);
+   /* AMD LA48 with clipped UVA */
+   if (psstrings == PS_STRINGS_LA48 - PAGE_SIZE)
+   return (VM_MAXUSER_ADDRESS_LA48 - PAGE_SIZE);
+   return (0);
+}
+#endif
+
 #defineFMAXULONG_MAX
 
 ATF_TC_WITHOUT_HEAD(kern_copyin);
 ATF_TC_BODY(kern_copyin, tc)
 {
char template[] = "copyin.XX";
+   uintptr_t maxuser;
 
-#ifdef __mips__
+#if defined(__mips__)
/*
 * MIPS has different VM layout: the UVA map on mips ends the
 * highest mapped entry at the VM_MAXUSER_ADDRESS - PAGE_SIZE,
 * while all other arches map either stack or shared page up
 * to the VM_MAXUSER_ADDRESS.
 */
-   atf_tc_skip("Platform is not supported.");
+   maxuser = VM_MAXUSER_ADDRESS - PAGE_SIZE;
+#elif defined(__amd64__)
+   maxuser = get_maxuser_address();
+   ATF_REQUIRE(maxuser != 0);
+#else
+   maxuser = VM_MAXUSER_ADDRESS;
 #endif
 
scratch_file = mkstemp(template);
@@ -74,15 +109,15 @@ ATF_TC_BODY(kern_copyin, tc)
unlink(template);
 
ATF_CHECK(copyin_checker(0, 0) == 0);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS - 10, 9) == 0);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS - 10, 10) == 0);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS - 10, 11) == EFAULT);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS - 1, 1) == 0);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS, 0) == 0);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS, 1) == EFAULT);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS, 2) == EFAULT);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS + 1, 0) == 0);
-   ATF_CHECK(copyin_checker(VM_MAXUSER_ADDRESS + 1, 2) == EFAULT);
+   ATF_CHECK(copyin_checker(maxuser - 10, 9) == 0);
+   ATF_CHECK(copyin_checker(maxuser - 10, 10) == 0);
+   ATF_CHECK(copyin_checker(maxuser - 10, 11) == EFAULT);
+   ATF_CHECK(copyin_checker(maxuser - 1, 1) == 0);
+   ATF_CHECK(copyin_checker(maxuser, 0) == 0);
+   ATF_CHECK(copyin_checker(maxuser, 1) == EFAULT);
+   ATF_CHECK(copyin_checker(maxuser, 2) == EFAULT);
+   ATF_CHECK(copyin_checker(maxuser + 1, 0) == 0);
+   ATF_CHECK(copyin_checker(maxuser + 1, 2) == EFAULT);
ATF_CHECK(copyin_checker(FMAX - 10, 9) == EFAULT);
ATF_CHECK(copyin_checker(FMAX - 10, 10) == EFAULT);
ATF_CHECK(copyin_checker(FMAX - 10, 11) == EFAULT);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365328 - head/usr.bin/fortune/datfiles

2020-09-04 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Fri Sep  4 13:05:00 2020
New Revision: 365328
URL: https://svnweb.freebsd.org/changeset/base/365328

Log:
  fortune(6): Grammar fix for a hint on searching ports
  
  PR:   249078
  Submitted by: PauAmma 
  Reported by:  PauAmma 
  MFC after:3 days

Modified:
  head/usr.bin/fortune/datfiles/freebsd-tips

Modified: head/usr.bin/fortune/datfiles/freebsd-tips
==
--- head/usr.bin/fortune/datfiles/freebsd-tips  Fri Sep  4 12:52:16 2020
(r365327)
+++ head/usr.bin/fortune/datfiles/freebsd-tips  Fri Sep  4 13:05:00 2020
(r365328)
@@ -304,8 +304,8 @@ been replaced with other messages, look at /var/run/dm
 Want colour in your directory listings?  Use "ls -G".  "ls -F" is also useful,
 and they can be combined as "ls -FG".
 %
-Want to find a specific port, just type the following under /usr/ports
-or one its subdirectories:
+Want to find a specific port? Just type the following under /usr/ports
+or one of its subdirectories:
 
make search name=
 or
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365331 - head/sys/kern

2020-09-04 Thread Andrew Gallatin
Author: gallatin
Date: Fri Sep  4 17:36:15 2020
New Revision: 365331
URL: https://svnweb.freebsd.org/changeset/base/365331

Log:
  ktls: Check for a NULL send tag in ktls_cleanup()
  
  When using ifnet ktls, and when ktls_reset_send_tag()
  fails to allocate a replacement tag, it leaves
  the tls session's snd_tag pointer NULL. ktls_cleanup()
  tries to release the send tag, and will trip over
  this NULL pointer and panic unless NULL is checked for.
  
  Reviewed by:  jhb
  Sponsored by: Netflix

Modified:
  head/sys/kern/uipc_ktls.c

Modified: head/sys/kern/uipc_ktls.c
==
--- head/sys/kern/uipc_ktls.c   Fri Sep  4 13:19:18 2020(r365330)
+++ head/sys/kern/uipc_ktls.c   Fri Sep  4 17:36:15 2020(r365331)
@@ -680,7 +680,8 @@ ktls_cleanup(struct ktls_session *tls)
counter_u64_add(ktls_ifnet_gcm, -1);
break;
}
-   m_snd_tag_rele(tls->snd_tag);
+   if (tls->snd_tag != NULL)
+   m_snd_tag_rele(tls->snd_tag);
break;
 #ifdef TCP_OFFLOAD
case TCP_TLS_MODE_TOE:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365332 - in head/sys: conf contrib/dev/ice modules/ice_ddp

2020-09-04 Thread Eric Joyner
Author: erj
Date: Fri Sep  4 17:37:58 2020
New Revision: 365332
URL: https://svnweb.freebsd.org/changeset/base/365332

Log:
  ice_ddp: Update package file to 1.3.16.0
  
  This package is intended to be used with ice(4) version 0.26.16. That
  update will happen in a forthcoming commit.
  
  MFC after:3 days
  Sponsored by: Intel Corporation

Added:
  head/sys/contrib/dev/ice/ice-1.3.16.0.pkg
 - copied, changed from r365331, head/sys/contrib/dev/ice/ice-1.3.9.0.pkg
Deleted:
  head/sys/contrib/dev/ice/ice-1.3.9.0.pkg
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.arm64
  head/sys/contrib/dev/ice/README
  head/sys/modules/ice_ddp/Makefile

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Fri Sep  4 17:36:15 2020(r365331)
+++ head/sys/conf/files.amd64   Fri Sep  4 17:37:58 2020(r365332)
@@ -177,7 +177,7 @@ dev/ice/ice_sriov.c optionalice pci \
 dev/ice/ice_switch.c   optionalice pci \
compile-with "${NORMAL_C} -I$S/dev/ice"
 ice_ddp.c  optional ice_ddp\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}"   \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}"   \
no-implicit-rule before-depend local\
clean   "ice_ddp.c"
 ice_ddp.fwooptional ice_ddp\
@@ -186,8 +186,8 @@ ice_ddp.fwo optional ice_ddp\
no-implicit-rule\
clean   "ice_ddp.fwo"
 ice_ddp.fw optional ice_ddp\
-   dependency  "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \
-   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \
+   dependency  "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \
+   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \
no-obj no-implicit-rule \
clean   "ice_ddp.fw"
 dev/ioat/ioat.coptionalioat pci

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Fri Sep  4 17:36:15 2020(r365331)
+++ head/sys/conf/files.arm64   Fri Sep  4 17:37:58 2020(r365332)
@@ -288,7 +288,7 @@ dev/ice/ice_sriov.c optionalice pci \
 dev/ice/ice_switch.c   optionalice pci \
compile-with "${NORMAL_C} -I$S/dev/ice"
 ice_ddp.c  optional ice_ddp\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}"   \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk 
ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}"   \
no-implicit-rule before-depend local\
clean   "ice_ddp.c"
 ice_ddp.fwooptional ice_ddp\
@@ -297,8 +297,8 @@ ice_ddp.fwo optional ice_ddp\
no-implicit-rule\
clean   "ice_ddp.fwo"
 ice_ddp.fw optional ice_ddp\
-   dependency  "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \
-   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \
+   dependency  "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \
+   compile-with"${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \
no-obj no-implicit-rule \
clean   "ice_ddp.fw"
 dev/iicbus/sy8106a.c   optionalsy8106a fdt

Modified: head/sys/contrib/dev/ice/README
==
--- head/sys/contrib/dev/ice/README Fri Sep  4 17:36:15 2020
(r365331)
+++ head/sys/contrib/dev/ice/README Fri Sep  4 17:37:58 2020
(r365332)
@@ -1,6 +1,6 @@
 Dynamic Device Personalization (DDP) Package
 
-February 21, 2020
+July 7, 2020
 
 
 Contents
@@ -59,6 +59,7 @@ The OS-default DDP package supports the following:
 - GRE
 - NVGRE
 - RoCEv2
+- MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 header group)
 
 
 Safe Mode

Copied and modified: head/sys/contrib/dev/ice/ice-1.3.16.0.pkg (from r365331, 
head/sys/contrib/dev/ice/ice-1.3.9.0.pkg)
==
Binary file (source and/or target). No diff available.

Modified: head/sys/modules/ice_ddp/Makefile
==
--- head/sys/modules/ice_ddp/Makefile   Fri Sep  4 17:36:15 2020
(r365331)
+++ head/sys/modules/ice_ddp/Makefile   Fri Sep  4 17:37:58 2020
(r365332)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
 KMOD= 

Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-04 Thread Andrew Gallatin

On 2020-09-02 22:42, Alexey Dokuchaev wrote:


I want to understand which rules have to be followed (and why).


In general, FreeBSD code we write should follow style(9); it specifically
mentions "do not add whitespace at the end of a line" and "... followed by
one blank line" but doesn't go as far as explicitly forbidding multiple
consecutive newlines.  To me it's pretty obvious, and while others might
have different sens esthe'tique, usually it is lack thereof (no offense)
or mere ignorance.

./danfe

P.S.  Old-school tools like indent(1) or `uncrustify' were never widely
popular, I guess, because they did not possess enough knowledge of the
language to always produce correct results.  Perhaps new era tools, like
clang-format, could bring this to a whole new level.



I do the upstream sync between the Netflix tree and
FreeBSD-current about every 3 weeks (unless glebius beats
me to the punch and does it first :).  I anticipate that
this blank line sweep will cause lots of conflicts for us.
I understand this is progress, and I don't object, and I'm
not asking for a revert, but please understand that cleanups
like this do have hidden costs.  I expect that other commercial
entities who contribute to FreeBSD will have the same issue,
and I also anticipate it will cause problems with MFCs

Rather than doing more sweeps like this, is it possible to
come up with a clang-format rule that's 95% of style(9), do
just one more sweep of the tree to apply that rule, add that
rule as a pre-commit hook, and be done forever with style(9)
related changes?

Thanks,
Drew

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365333 - head/sys/cam

2020-09-04 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Sep  4 18:18:05 2020
New Revision: 365333
URL: https://svnweb.freebsd.org/changeset/base/365333

Log:
  cam_sim: harmonize code related to acquiring a mtx
  
  cam_sim_free(), cam_sim_release(), and cam_sim_hold() all assign
  a mtx variable during declaration and then if NULL or the mtx is
  held may re-asign the variable and/or acquire/release a lock.
  
  Harmonize the code, avoiding double assignments and make it look
  the same for all three function (with cam_sim_free() not needing
  an extra case).
  
  No functional changes intended.
  
  Reviewed by:  imp; no-objections by: mav
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D26286

Modified:
  head/sys/cam/cam_sim.c

Modified: head/sys/cam/cam_sim.c
==
--- head/sys/cam/cam_sim.c  Fri Sep  4 17:37:58 2020(r365332)
+++ head/sys/cam/cam_sim.c  Fri Sep  4 18:18:05 2020(r365333)
@@ -124,14 +124,15 @@ cam_sim_alloc_dev(sim_action_func sim_action, sim_poll
 void
 cam_sim_free(struct cam_sim *sim, int free_devq)
 {
-   struct mtx *mtx = sim->mtx;
+   struct mtx *mtx;
int error;
 
-   if (mtx) {
-   mtx_assert(mtx, MA_OWNED);
-   } else {
+   if (sim->mtx == NULL) {
mtx = &cam_sim_free_mtx;
mtx_lock(mtx);
+   } else {
+   mtx = sim->mtx;
+   mtx_assert(mtx, MA_OWNED);
}
sim->refcount--;
if (sim->refcount > 0) {
@@ -139,7 +140,7 @@ cam_sim_free(struct cam_sim *sim, int free_devq)
KASSERT(error == 0, ("invalid error value for msleep(9)"));
}
KASSERT(sim->refcount == 0, ("sim->refcount == 0"));
-   if (sim->mtx == NULL)
+   if (mtx == &cam_sim_free_mtx)   /* sim->mtx == NULL */
mtx_unlock(mtx);
 
if (free_devq)
@@ -150,17 +151,16 @@ cam_sim_free(struct cam_sim *sim, int free_devq)
 void
 cam_sim_release(struct cam_sim *sim)
 {
-   struct mtx *mtx = sim->mtx;
+   struct mtx *mtx;
 
-   if (mtx) {
-   if (!mtx_owned(mtx))
-   mtx_lock(mtx);
-   else
-   mtx = NULL;
-   } else {
+   if (sim->mtx == NULL)
mtx = &cam_sim_free_mtx;
+   else if (!mtx_owned(sim->mtx))
+   mtx = sim->mtx;
+   else
+   mtx = NULL; /* We hold the lock. */
+   if (mtx)
mtx_lock(mtx);
-   }
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
sim->refcount--;
if (sim->refcount == 0)
@@ -172,17 +172,16 @@ cam_sim_release(struct cam_sim *sim)
 void
 cam_sim_hold(struct cam_sim *sim)
 {
-   struct mtx *mtx = sim->mtx;
+   struct mtx *mtx;
 
-   if (mtx) {
-   if (!mtx_owned(mtx))
-   mtx_lock(mtx);
-   else
-   mtx = NULL;
-   } else {
+   if (sim->mtx == NULL)
mtx = &cam_sim_free_mtx;
+   else if (!mtx_owned(sim->mtx))
+   mtx = sim->mtx;
+   else
+   mtx = NULL; /* We hold the lock. */
+   if (mtx)
mtx_lock(mtx);
-   }
KASSERT(sim->refcount >= 1, ("sim->refcount >= 1"));
sim->refcount++;
if (mtx)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-04 Thread Brandon Bergren



On Fri, Sep 4, 2020, at 1:15 PM, Andrew Gallatin wrote:
> Rather than doing more sweeps like this, is it possible to
> come up with a clang-format rule that's 95% of style(9), do
> just one more sweep of the tree to apply that rule, add that
> rule as a pre-commit hook, and be done forever with style(9)
> related changes?

Only for a subset of the tree. sys/contrib for example can't be subject to this 
sort of auto-formatting.

>

-- 
  Brandon Bergren
  bdra...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365334 - head/sys/dev/usb/storage

2020-09-04 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Sep  4 18:26:35 2020
New Revision: 365334
URL: https://svnweb.freebsd.org/changeset/base/365334

Log:
  umass: fix a cam_sim leak in error case
  
  While debugging a hang I noticed that in case of error in
  umass_cam_attach_sim() we miss a cam_sim_free() call.
  Added that to not leak resources.
  
  Reviewed by:  hselasky
  MFC after:3 days
  Differential Revision:D26287

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==
--- head/sys/dev/usb/storage/umass.cFri Sep  4 18:18:05 2020
(r365333)
+++ head/sys/dev/usb/storage/umass.cFri Sep  4 18:26:35 2020
(r365334)
@@ -2094,6 +2094,7 @@ umass_cam_attach_sim(struct umass_softc *sc)
 
if (xpt_bus_register(sc->sc_sim, sc->sc_dev,
sc->sc_unit) != CAM_SUCCESS) {
+   cam_sim_free(sc->sc_sim, /* free_devq */ TRUE);
mtx_unlock(&sc->sc_mtx);
return (ENOMEM);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365335 - head/sys/dev/usb/storage

2020-09-04 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Sep  4 18:29:59 2020
New Revision: 365335
URL: https://svnweb.freebsd.org/changeset/base/365335

Log:
  umass: enhance debugging
  
  Investigating a hang I found having some more error information
  available would be helpful, so be more verbose and also tell cam/xpt
  status in case of error/panic.
  
  Reviewed by:  hselasky
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D26287

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==
--- head/sys/dev/usb/storage/umass.cFri Sep  4 18:26:35 2020
(r365334)
+++ head/sys/dev/usb/storage/umass.cFri Sep  4 18:29:59 2020
(r365335)
@@ -2063,6 +2063,7 @@ static int
 umass_cam_attach_sim(struct umass_softc *sc)
 {
struct cam_devq *devq;  /* Per device Queue */
+   cam_status status;
 
/*
 * A HBA is attached to the CAM layer.
@@ -2091,11 +2092,12 @@ umass_cam_attach_sim(struct umass_softc *sc)
}
 
mtx_lock(&sc->sc_mtx);
-
-   if (xpt_bus_register(sc->sc_sim, sc->sc_dev,
-   sc->sc_unit) != CAM_SUCCESS) {
+   status = xpt_bus_register(sc->sc_sim, sc->sc_dev, sc->sc_unit);
+   if (status != CAM_SUCCESS) {
cam_sim_free(sc->sc_sim, /* free_devq */ TRUE);
mtx_unlock(&sc->sc_mtx);
+   printf("%s: xpt_bus_register failed with status %#x\n",
+   __func__, status);
return (ENOMEM);
}
mtx_unlock(&sc->sc_mtx);
@@ -2121,14 +2123,22 @@ umass_cam_attach(struct umass_softc *sc)
 static void
 umass_cam_detach_sim(struct umass_softc *sc)
 {
+   cam_status status;
+
if (sc->sc_sim != NULL) {
-   if (xpt_bus_deregister(cam_sim_path(sc->sc_sim))) {
+   status = xpt_bus_deregister(cam_sim_path(sc->sc_sim));
+   if (status == CAM_REQ_CMP) {
/* accessing the softc is not possible after this */
sc->sc_sim->softc = NULL;
+   DPRINTF(sc, UDMASS_SCSI, "%s: %s:%d:%d caling "
+   "cam_sim_free sim %p refc %u mtx %p\n",
+   __func__, sc->sc_name, cam_sim_path(sc->sc_sim),
+   sc->sc_unit, sc->sc_sim,
+   sc->sc_sim->refcount, sc->sc_sim->mtx);
cam_sim_free(sc->sc_sim, /* free_devq */ TRUE);
} else {
-   panic("%s: CAM layer is busy\n",
-   sc->sc_name);
+   panic("%s: %s: CAM layer is busy: %#x\n",
+   __func__, sc->sc_name, status);
}
sc->sc_sim = NULL;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365336 - head/sys/modules/zfs

2020-09-04 Thread Mark Johnston
Author: markj
Date: Fri Sep  4 18:55:03 2020
New Revision: 365336
URL: https://svnweb.freebsd.org/changeset/base/365336

Log:
  Stop setting DEBUG_FLAGS in the zfs.ko Makefile.
  
  Rely on system settings to decide whether or not to build with debug
  symbols and extract them to a separate file.
  
  Reported and tested by:   rm

Modified:
  head/sys/modules/zfs/Makefile

Modified: head/sys/modules/zfs/Makefile
==
--- head/sys/modules/zfs/Makefile   Fri Sep  4 18:29:59 2020
(r365335)
+++ head/sys/modules/zfs/Makefile   Fri Sep  4 18:55:03 2020
(r365336)
@@ -44,8 +44,6 @@ CFLAGS+= -DDEBUG_VFS_LOCKS
 CFLAGS+=-fprofile-arcs -ftest-coverage
 .endif
 
-DEBUG_FLAGS=-g
-
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
 CFLAGS+= -DBITS_PER_LONG=32
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-04 Thread Mateusz Guzik
On 9/4/20, Andrew Gallatin  wrote:
> On 2020-09-02 22:42, Alexey Dokuchaev wrote:
>
>>> I want to understand which rules have to be followed (and why).
>>
>> In general, FreeBSD code we write should follow style(9); it specifically
>> mentions "do not add whitespace at the end of a line" and "... followed
>> by
>> one blank line" but doesn't go as far as explicitly forbidding multiple
>> consecutive newlines.  To me it's pretty obvious, and while others might
>> have different sens esthe'tique, usually it is lack thereof (no offense)
>> or mere ignorance.
>>
>> ./danfe
>>
>> P.S.  Old-school tools like indent(1) or `uncrustify' were never widely
>> popular, I guess, because they did not possess enough knowledge of the
>> language to always produce correct results.  Perhaps new era tools, like
>> clang-format, could bring this to a whole new level.
>>
>
> I do the upstream sync between the Netflix tree and
> FreeBSD-current about every 3 weeks (unless glebius beats
> me to the punch and does it first :).  I anticipate that
> this blank line sweep will cause lots of conflicts for us.
> I understand this is progress, and I don't object, and I'm
> not asking for a revert, but please understand that cleanups
> like this do have hidden costs.  I expect that other commercial
> entities who contribute to FreeBSD will have the same issue,
> and I also anticipate it will cause problems with MFCs
>
> Rather than doing more sweeps like this, is it possible to
> come up with a clang-format rule that's 95% of style(9), do
> just one more sweep of the tree to apply that rule, add that
> rule as a pre-commit hook, and be done forever with style(9)
> related changes?
>

For starters I completely agree with the need for tooling to prevent
addition of more non-conformant code, but I'm leaving this for someone
else. I don't intend to do any more sweeps (modulo perhaps vfs code).

I would like to note that directories like contrib, zfs, netmap and
others which have known upstream got intentionally skipped during to
not mess with imports. Of course this does not necessary cover all
merges.

Merges regardless of the above (or going the other way) should not be
very problematic though. No design changes are needed, let alone any
testing on account of the above. Worst case this is just minor
annoyance which can be cleaned up while watching The Sopranos with one
eye.

Note that ultimately there is a hidden cost to previous state as well.
What perhaps is not clear from the commit message and wont be seen
unless you scrutinize the diffs, some lines got changed from having
tabs and/or spaces instead of just a newline. This kind of stuff is
jumps at you every time if you have an editor configured to report it
(you can find a vim snipped at the bottom of interested).

That being said, I understand this generated work for some people but
I don't think it consitutes a problem. Also I don't think a heads up
would change anything here. If I was planning more invasive work I
would definitely try to coordinate. Also note the changeset does not
interfere with git blame (unless you want to look at empty lines).

Here is vim snipped I stole from someone several years back:
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter *.{c,pl,pm} match ExtraWhitespace /^\s* \|\s\+$/
autocmd InsertEnter *.{c,pl,pm} match ExtraWhitespace /^\s* \|\s\+\%#\@
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365337 - head/tests/sys/kern

2020-09-04 Thread Li-Wen Hsu
Author: lwhsu
Date: Fri Sep  4 19:24:27 2020
New Revision: 365337
URL: https://svnweb.freebsd.org/changeset/base/365337

Log:
  Initialize len to avoid ENOMEM from sysctl(3).
  
  PR:   248933
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/kern/kern_copyin.c

Modified: head/tests/sys/kern/kern_copyin.c
==
--- head/tests/sys/kern/kern_copyin.c   Fri Sep  4 18:55:03 2020
(r365336)
+++ head/tests/sys/kern/kern_copyin.c   Fri Sep  4 19:24:27 2020
(r365337)
@@ -66,6 +66,7 @@ get_maxuser_address(void)
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PS_STRINGS;
mib[3] = getpid();
+   len = sizeof(psstrings);
error = sysctl(mib, nitems(mib), &psstrings, &len, NULL, 0);
if (error != 0)
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365338 - head/sys/fs/tmpfs

2020-09-04 Thread Mateusz Guzik
Author: mjg
Date: Fri Sep  4 19:30:15 2020
New Revision: 365338
URL: https://svnweb.freebsd.org/changeset/base/365338

Log:
  tmpfs: drop spurious cache_purge in tmpfs_reclaim
  
  vgone already performs it.

Modified:
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==
--- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Sep  4 19:24:27 2020
(r365337)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Sep  4 19:30:15 2020
(r365338)
@@ -1435,8 +1435,6 @@ tmpfs_reclaim(struct vop_reclaim_args *v)
if (vp->v_type == VREG)
tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj);
vp->v_object = NULL;
-   if (tmpfs_use_nc(vp))
-   cache_purge(vp);
 
TMPFS_NODE_LOCK(node);
tmpfs_free_vp(vp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365342 - head/libexec/rtld-elf/riscv

2020-09-04 Thread Brooks Davis
Author: brooks
Date: Fri Sep  4 21:46:10 2020
New Revision: 365342
URL: https://svnweb.freebsd.org/changeset/base/365342

Log:
  Maintain a stack alignment of 16-bytes.
  
  This violated the RISC-V 64-bit ABI.  On CheriBSD this manifested as
  a trap when attempting to store 16-byte aligned types while zeroing
  the stack.
  
  Reported by:  CHERI, jrtc27
  Reviewed by:  mhorne, br
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26327

Modified:
  head/libexec/rtld-elf/riscv/rtld_start.S

Modified: head/libexec/rtld-elf/riscv/rtld_start.S
==
--- head/libexec/rtld-elf/riscv/rtld_start.SFri Sep  4 21:34:47 2020
(r365341)
+++ head/libexec/rtld-elf/riscv/rtld_start.SFri Sep  4 21:46:10 2020
(r365342)
@@ -64,7 +64,8 @@ END(.rtld_start)
  */
 ENTRY(_rtld_bind_start)
/* Save the arguments and ra */
-   addisp, sp, -(8 * 17)
+   /* We require 17 dwords, but the stack must be aligned to 16-bytes */
+   addisp, sp, -(8 * 18)
sd  a0, (8 * 0)(sp)
sd  a1, (8 * 1)(sp)
sd  a2, (8 * 2)(sp)
@@ -122,7 +123,7 @@ ENTRY(_rtld_bind_start)
fld fa6, (8 * 15)(sp)
fld fa7, (8 * 16)(sp)
 #endif
-   addisp, sp, (8 * 17)
+   addisp, sp, (8 * 18)
 
/* Call into the correct function */
jr  t0
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365344 - head/sys/riscv/riscv

2020-09-04 Thread Brooks Davis
Author: brooks
Date: Fri Sep  4 21:55:22 2020
New Revision: 365344
URL: https://svnweb.freebsd.org/changeset/base/365344

Log:
  Round TF_SIZE up to the stack alignment (16-bytes).
  
  The kernel adjusts the stack by TF_SIZE and the RISC-V ABI requires
  that it remain 16-byte aligned.
  
  Reported by:  CHERI, jrtc27
  Reviewed by:  mhorne
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26328

Modified:
  head/sys/riscv/riscv/genassym.c

Modified: head/sys/riscv/riscv/genassym.c
==
--- head/sys/riscv/riscv/genassym.c Fri Sep  4 21:48:36 2020
(r365343)
+++ head/sys/riscv/riscv/genassym.c Fri Sep  4 21:55:22 2020
(r365344)
@@ -87,7 +87,7 @@ ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
 ASSYM(TD_MD, offsetof(struct thread, td_md));
 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
 
-ASSYM(TF_SIZE, sizeof(struct trapframe));
+ASSYM(TF_SIZE, roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1));
 ASSYM(TF_RA, offsetof(struct trapframe, tf_ra));
 ASSYM(TF_SP, offsetof(struct trapframe, tf_sp));
 ASSYM(TF_GP, offsetof(struct trapframe, tf_gp));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365347 - in head: lib/libbe sys/conf sys/contrib/openzfs sys/contrib/openzfs/cmd/zfs sys/contrib/openzfs/config sys/contrib/openzfs/etc/systemd/system sys/contrib/openzfs/etc/systemd/s...

2020-09-04 Thread Matt Macy
Author: mmacy
Date: Fri Sep  4 22:25:14 2020
New Revision: 365347
URL: https://svnweb.freebsd.org/changeset/base/365347

Log:
  ZFS: MFV 2.0-rc1-gfd20a8
  
  - fixes jail delegation
  - fixes raw kstat unsupported complaints
  - exposes dbgmsg, dbuf, and checksum benchmark stats
  - restore rename -u support

Added:
  head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h
 - copied unchanged from r365345, 
vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h
  head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_vfsops_os.h
 - copied unchanged from r365345, 
vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_vfsops_os.h
  head/sys/contrib/openzfs/include/sys/zfs_vfsops.h
 - copied unchanged from r365345, 
vendor-sys/openzfs/dist/include/sys/zfs_vfsops.h
  head/sys/contrib/openzfs/lib/libspl/os/freebsd/zone.c
 - copied unchanged from r365345, 
vendor-sys/openzfs/dist/lib/libspl/os/freebsd/zone.c
  head/sys/contrib/openzfs/lib/libspl/os/linux/zone.c
 - copied unchanged from r365345, 
vendor-sys/openzfs/dist/lib/libspl/os/linux/zone.c
  head/sys/contrib/openzfs/module/zfs/spa_stats.c
 - copied unchanged from r365346, 
vendor-sys/openzfs/dist/module/zfs/spa_stats.c
  
head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_nounmount.ksh
 - copied unchanged from r365345, 
vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_nounmount.ksh
Deleted:
  head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops.h
  head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_vfsops.h
  head/sys/contrib/openzfs/lib/libspl/zone.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/spa_stats.c
  head/sys/contrib/openzfs/module/os/linux/zfs/spa_stats.c
Modified:
  head/lib/libbe/be.c
  head/sys/conf/files
  head/sys/contrib/openzfs/cmd/zfs/zfs_main.c
  head/sys/contrib/openzfs/config/kernel-global_page_state.m4
  head/sys/contrib/openzfs/config/zfs-build.m4
  head/sys/contrib/openzfs/etc/systemd/system-generators/zfs-mount-generator.in
  head/sys/contrib/openzfs/etc/systemd/system/zfs-mount.service.in
  head/sys/contrib/openzfs/include/libzfs.h
  head/sys/contrib/openzfs/include/libzfs_impl.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cred.h
  head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zone.h
  head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/Makefile.am
  head/sys/contrib/openzfs/include/os/linux/kernel/linux/page_compat.h
  head/sys/contrib/openzfs/include/os/linux/spl/sys/vmsystm.h
  head/sys/contrib/openzfs/include/os/linux/zfs/sys/Makefile.am
  head/sys/contrib/openzfs/include/sys/Makefile.am
  head/sys/contrib/openzfs/lib/libspl/Makefile.am
  head/sys/contrib/openzfs/lib/libspl/include/limits.h
  head/sys/contrib/openzfs/lib/libspl/include/zone.h
  head/sys/contrib/openzfs/lib/libzfs/libzfs_changelist.c
  head/sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c
  head/sys/contrib/openzfs/lib/libzpool/kernel.c
  head/sys/contrib/openzfs/man/man8/zfs-rename.8
  head/sys/contrib/openzfs/module/avl/avl.c
  head/sys/contrib/openzfs/module/nvpair/nvpair.c
  head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c
  head/sys/contrib/openzfs/module/os/freebsd/spl/spl_zone.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c
  head/sys/contrib/openzfs/module/os/linux/spl/spl-kstat.c
  head/sys/contrib/openzfs/module/os/linux/zfs/Makefile.in
  head/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c
  head/sys/contrib/openzfs/module/os/linux/zfs/zfs_vfsops.c
  head/sys/contrib/openzfs/module/os/linux/zfs/zpl_super.c
  head/sys/contrib/openzfs/module/zfs/Makefile.in
  head/sys/contrib/openzfs/module/zfs/arc.c
  head/sys/contrib/openzfs/module/zfs/dsl_dir.c
  head/sys/contrib/openzfs/module/zfs/spa.c
  head/sys/contrib/openzfs/module/zfs/spa_config.c
  head/sys/contrib/openzfs/module/zfs/vdev.c
  head/sys/contrib/openzfs/module/zfs/vdev_indirect.c
  head/sys/contrib/openzfs/module/zfs/vdev_raidz.c
  head/sys/contrib/openzfs/module/zfs/zfs_fm.c
  head/sys/contrib/openzfs/module/zfs/zfs_ioctl.c
  head/sys/contrib/openzfs/module/zfs/zio.c
  head/sys/contrib/openzfs/tests/runfiles/common.run
  head/sys/contrib/openzfs/tests/zfs-tests/include/tunables.cfg
  
head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/Makefile.am
  
head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_mountpoint.ksh
Directory Properties:
  head/sys/contrib/openzfs/   (props changed)
  head/sys/contrib/openzfs/zfs.release.in   (props changed)

Modified: head/lib/libbe/be.c
==
--- head/lib/libbe/be.c Fri Sep  4 22:11:58 2020(r365346)
+++ head/lib/libbe/be.c Fri Sep  4 22:25:14 2020(r365347)
@@ -996,8 +996,11 @@ be_rename(libbe_handle_t *lbh, const char *old, const 
ZFS_TYPE_FILESYSTEM)) == N

svn commit: r365348 - head/libexec/rc/rc.d

2020-09-04 Thread Xin LI
Author: delphij
Date: Fri Sep  4 23:36:43 2020
New Revision: 365348
URL: https://svnweb.freebsd.org/changeset/base/365348

Log:
  Make zpool on GELI work again.
  
  After OpenZFS import, zpool auto import behavior was moved to an
  explicit "zpool import -a", and the zpool rc.d script was added
  as a prerequisite of zvol.
  
  However, in r299839, zvol was added as a prerequisite of dumpon,
  making it to start very early and before all 'disks' providers.
  At this time, dumping on a zvol is not supported, so remove this
  requirement and make zpool depend on disks to allow zpool on
  full disk encryption work.
  
  Reviewed by:  allanjude
  Differential Revision:https://reviews.freebsd.org/D26333

Modified:
  head/libexec/rc/rc.d/zpool
  head/libexec/rc/rc.d/zvol

Modified: head/libexec/rc/rc.d/zpool
==
--- head/libexec/rc/rc.d/zpool  Fri Sep  4 22:25:14 2020(r365347)
+++ head/libexec/rc/rc.d/zpool  Fri Sep  4 23:36:43 2020(r365348)
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: zpool
-# REQUIRE: hostid
+# REQUIRE: hostid disks
 # BEFORE: zvol mountcritlocal
 # KEYWORD: nojail
 

Modified: head/libexec/rc/rc.d/zvol
==
--- head/libexec/rc/rc.d/zvol   Fri Sep  4 22:25:14 2020(r365347)
+++ head/libexec/rc/rc.d/zvol   Fri Sep  4 23:36:43 2020(r365348)
@@ -5,7 +5,6 @@
 
 # PROVIDE: zvol
 # REQUIRE: zpool
-# BEFORE: dumpon
 # KEYWORD: nojail
 
 . /etc/rc.subr
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365349 - head/sys/kern

2020-09-04 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Sep  5 00:19:40 2020
New Revision: 365349
URL: https://svnweb.freebsd.org/changeset/base/365349

Log:
  uipc_ktls: remove unused static function
  
  m_segments() was added with r363464 but never used. Remove it to
  avoid warnings when compiling kernels.
  
  Reported by:  rmacklem (also says jhb)
  Reviewed by:  gallatin, jhb
  Differential Revision:https://reviews.freebsd.org/D26330

Modified:
  head/sys/kern/uipc_ktls.c

Modified: head/sys/kern/uipc_ktls.c
==
--- head/sys/kern/uipc_ktls.c   Fri Sep  4 23:36:43 2020(r365348)
+++ head/sys/kern/uipc_ktls.c   Sat Sep  5 00:19:40 2020(r365349)
@@ -1643,21 +1643,6 @@ out:
return (top);
 }
 
-static int
-m_segments(struct mbuf *m, int skip)
-{
-   int count;
-
-   while (skip >= m->m_len) {
-   skip -= m->m_len;
-   m = m->m_next;
-   }
-
-   for (count = 0; m != NULL; count++)
-   m = m->m_next;
-   return (count);
-}
-
 static void
 ktls_decrypt(struct socket *so)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365350 - head/sys/netinet/tcp_stacks

2020-09-04 Thread Bjoern A. Zeeb
Author: bz
Date: Sat Sep  5 00:20:32 2020
New Revision: 365350
URL: https://svnweb.freebsd.org/changeset/base/365350

Log:
  bbr: remove unused static function
  
  bbr_log_type_hrdwtso() is a file local static unused function.
  Remove it to avoid warnings on kernel compiles.
  
  Reviewed by:  gallatin
  Differential Revision:https://reviews.freebsd.org/D26331

Modified:
  head/sys/netinet/tcp_stacks/bbr.c

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Sat Sep  5 00:19:40 2020
(r365349)
+++ head/sys/netinet/tcp_stacks/bbr.c   Sat Sep  5 00:20:32 2020
(r365350)
@@ -11716,31 +11716,6 @@ done_with_input:
 }
 
 static void
-bbr_log_type_hrdwtso(struct tcpcb *tp, struct tcp_bbr *bbr, int len, int mod, 
int what_we_can_send)
-{
-   if (tp->t_logstate != TCP_LOG_STATE_OFF) {
-   union tcp_log_stackspecific log;
-   struct timeval tv;
-   uint32_t cts;
-
-   cts = tcp_get_usecs(&tv);
-   bbr_fill_in_logging_data(bbr, &log.u_bbr, cts);
-   log.u_bbr.flex1 = bbr->r_ctl.rc_pace_min_segs;
-   log.u_bbr.flex2 = what_we_can_send;
-   log.u_bbr.flex3 = bbr->r_ctl.rc_pace_max_segs;
-   log.u_bbr.flex4 = len;
-   log.u_bbr.flex5 = 0;
-   log.u_bbr.flex7 = mod;
-   log.u_bbr.flex8 = 1;
-   TCP_LOG_EVENTP(tp, NULL,
-   &tp->t_inpcb->inp_socket->so_rcv,
-   &tp->t_inpcb->inp_socket->so_snd,
-   TCP_HDWR_TLS, 0,
-   0, &log, false, &tv);
-   }
-}
-
-static void
 bbr_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
 struct tcpcb *tp, int32_t drop_hdrlen, int32_t tlen, uint8_t iptos)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365351 - head/sys/kern

2020-09-04 Thread Chuck Silvers
Author: chs
Date: Sat Sep  5 00:26:03 2020
New Revision: 365351
URL: https://svnweb.freebsd.org/changeset/base/365351

Log:
  vfs: avoid exposing partially constructed vnodes
  
  If multiple threads race calling vfs_hash_insert() while creating vnodes
  with the same identity, all of the vnodes which lose the race must be
  destroyed before any other thread can see them. Previously this was
  accomplished by the vput() in vfs_hash_insert() resulting in the vnode's
  VOP_INACTIVE() method calling vgone() before the vnode lock was unlocked,
  but at some point changes to the the vnode refcount/inactive logic have caused
  that to no longer work, leading to crashes, so instead vfs_hash_insert()
  must call vgone() itself before calling vput() on vnodes which lose the race.
  
  Reviewed by:  mjg, kib
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D26291

Modified:
  head/sys/kern/vfs_hash.c

Modified: head/sys/kern/vfs_hash.c
==
--- head/sys/kern/vfs_hash.cSat Sep  5 00:20:32 2020(r365350)
+++ head/sys/kern/vfs_hash.cSat Sep  5 00:26:03 2020(r365351)
@@ -172,6 +172,7 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flag
rw_wlock(&vfs_hash_lock);
LIST_INSERT_HEAD(&vfs_hash_side, vp, v_hashlist);
rw_wunlock(&vfs_hash_lock);
+   vgone(vp);
vput(vp);
if (!error)
*vpp = vp2;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365354 - head/libexec/rc/rc.d

2020-09-04 Thread Xin LI
Author: delphij
Date: Sat Sep  5 00:45:46 2020
New Revision: 365354
URL: https://svnweb.freebsd.org/changeset/base/365354

Log:
  Declare dependency relationship once instead of twice for zpool
  and zvol.

Modified:
  head/libexec/rc/rc.d/zpool

Modified: head/libexec/rc/rc.d/zpool
==
--- head/libexec/rc/rc.d/zpool  Sat Sep  5 00:28:21 2020(r365353)
+++ head/libexec/rc/rc.d/zpool  Sat Sep  5 00:45:46 2020(r365354)
@@ -5,7 +5,7 @@
 
 # PROVIDE: zpool
 # REQUIRE: hostid disks
-# BEFORE: zvol mountcritlocal
+# BEFORE: mountcritlocal
 # KEYWORD: nojail
 
 . /etc/rc.subr
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365355 - head/sys/rpc

2020-09-04 Thread Rick Macklem
Author: rmacklem
Date: Sat Sep  5 00:50:52 2020
New Revision: 365355
URL: https://svnweb.freebsd.org/changeset/base/365355

Log:
  Fix a potential memory leak in the NFS over TLS handling code.
  
  For the TLS case where there is a "user@domain" name specified in the
  X.509 v3 certificate presented by the client in the otherName component
  of subjectAltName, a gid list is allocated via mem_alloc().
  This needs to be free'd. Otherwise xp_gidp == NULL and free() handles that.
  (The size argument to mem_free() is not used by FreeBSD, so it can be 0.)
  
  This leak would not have occurred for any other case than NFS over TLS
  with the "user@domain" in the client's certificate.

Modified:
  head/sys/rpc/svc.c

Modified: head/sys/rpc/svc.c
==
--- head/sys/rpc/svc.c  Sat Sep  5 00:45:46 2020(r365354)
+++ head/sys/rpc/svc.c  Sat Sep  5 00:50:52 2020(r365355)
@@ -902,6 +902,8 @@ svc_xprt_free(SVCXPRT *xprt)
 {
 
mem_free(xprt->xp_p3, sizeof(SVCXPRT_EXT));
+   /* The size argument is ignored, so 0 is ok. */
+   mem_free(xprt->xp_gidp, 0);
mem_free(xprt, sizeof(SVCXPRT));
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-04 Thread Mark Linimon
On Fri, Sep 04, 2020 at 02:15:04PM -0400, Andrew Gallatin wrote:
> and I also anticipate it will cause problems with MFCs

And existing PRs and DRs.

mcl
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgrap

2020-09-04 Thread Warner Losh
On Fri, Sep 4, 2020, 7:05 PM Mark Linimon  wrote:

> On Fri, Sep 04, 2020 at 02:15:04PM -0400, Andrew Gallatin wrote:
> > and I also anticipate it will cause problems with MFCs
>
> And existing PRs and DRs.
>

Or we could just not bother we these changes at all. It's a pipe dream we
will ever be style(9) compliant in all our code, or that we can magically
have a tool to enforce in new commits. We have better things to worry
about. We should continue to ignore this non problem and for new users
point them at the 95% correct format thing to run their submitted patches
if they submit something too far out of whack.

The last sweep deleted a boatload of blank lines that were in there on
purpose. Not worth adding them back, but still annoying to no real benefit.

I just don't see the benefits at all of doing anything here. The few
reviews that I've seen mention it seem to be the right level of effort.

Warner

>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365358 - head/usr.bin/script

2020-09-04 Thread Warner Losh
Author: imp
Date: Sat Sep  5 04:20:29 2020
New Revision: 365358
URL: https://svnweb.freebsd.org/changeset/base/365358

Log:
  Fix typo in comment.
  
  Noticed by: bapt@

Modified:
  head/usr.bin/script/script.c

Modified: head/usr.bin/script/script.c
==
--- head/usr.bin/script/script.cSat Sep  5 02:22:07 2020
(r365357)
+++ head/usr.bin/script/script.cSat Sep  5 04:20:29 2020
(r365358)
@@ -119,7 +119,7 @@ main(int argc, char *argv[])
case 'd':
usesleep = 0;
break;
-   case 'e':   /* Default behaior, accepted for linux compat */
+   case 'e':   /* Default behavior, accepted for linux compat 
*/
break;
case 'F':
Fflg = 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"