svn commit: r338309 - head/stand/lua

2018-08-24 Thread Kyle Evans
Author: kevans
Date: Sat Aug 25 04:28:02 2018
New Revision: 338309
URL: https://svnweb.freebsd.org/changeset/base/338309

Log:
  lualoader: Fix override of module_path on loader prompt
  
  Earlier changes setup a config.module_path variable that was populated upon
  reading of loader.conf(5) and used for restoring module_path to pristine
  condition if multiple kernels are attempted. This broke the ability to
  override module_path at the loader prompt in case of emergency.
  
  Approved by:  re (rgrimes)

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Fri Aug 24 22:48:19 2018(r338308)
+++ head/stand/lua/config.lua   Sat Aug 25 04:28:02 2018(r338309)
@@ -479,6 +479,21 @@ function config.loadKernel(other_kernel)
return nil
end
 
+   local function getModulePath()
+   local module_path = loader.getenv("module_path")
+   local kernel_path = loader.getenv("kernel_path")
+
+   if kernel_path == nil then
+   return module_path
+   end
+
+   -- Strip the loaded kernel path from module_path. This 
currently assumes
+   -- that the kernel path will be prepended to the module_path 
when it's
+   -- found.
+   kernel_path = escapeName(kernel_path .. ';')
+   return module_path:gsub(kernel_path, '')
+   end
+
local function loadBootfile()
local bootfile = loader.getenv("bootfile")
 
@@ -507,7 +522,7 @@ function config.loadKernel(other_kernel)
else
-- Use our cached module_path, so we don't end up with multiple
-- automatically added kernel paths to our final module_path
-   local module_path = config.module_path
+   local module_path = getModulePath()
local res
 
if other_kernel ~= nil then
@@ -527,6 +542,7 @@ function config.loadKernel(other_kernel)
if module_path ~= nil then
loader.setenv("module_path", v .. ";" ..
module_path)
+   loader.setenv("kernel_path", v)
end
return true
end
@@ -563,8 +579,6 @@ function config.load(file, reloading)
 
checkNextboot()
 
-   -- Cache the provided module_path at load time for later use
-   config.module_path = loader.getenv("module_path")
local verbose = loader.getenv("verbose_loading") or "no"
config.verbose = verbose:lower() == "yes"
if not reloading then
___
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: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bi

2018-08-24 Thread Kyle Evans
On Fri, Aug 24, 2018 at 10:12 PM Alan Somers  wrote:
>
> On Fri, Aug 24, 2018 at 8:12 PM Kyle Evans  wrote:
>>
>> On Wed, Aug 8, 2018 at 2:24 PM Alan Somers  wrote:
>> >
>> > Author: asomers
>> > Date: Wed Aug  8 19:24:20 2018
>> > New Revision: 337497
>> > URL: https://svnweb.freebsd.org/changeset/base/337497
>> >
>> > Log:
>> >   Switch the default pager for most commands to less
>> >
>> >   Finally, a pager for the nineties.
>> >
>> >   MFC after:Never
>> >   Relnotes: Yes
>> >   Differential Revision:https://reviews.freebsd.org/D13465
>> >   Poll: https://reviews.freebsd.org/V7
>> >
>>
>> Hi,
>>
>> Hurray!
>>
>> > [... snip ...]
>> > --- head/usr.sbin/mergemaster/mergemaster.shWed Aug  8 19:21:08 2018   
>> >  (r337496)
>> > +++ head/usr.sbin/mergemaster/mergemaster.shWed Aug  8 19:24:20 2018   
>> >  (r337497)
>> > @@ -426,19 +426,19 @@ check_pager () {
>> >  echo ''
>> >  echo "  or you may type an absolute path to PAGER for this run"
>> >  echo ''
>> > -echo "  Default is to use plain old 'more' "
>> > +echo "  Default is to use 'less' "
>> >  echo ''
>> > -echo -n "What should I do? [Use 'more'] "
>> > +echo -n "What should I do? [Use 'less'] "
>> >  read FIXPAGER
>> >
>> >  case "${FIXPAGER}" in
>> >  [eE])
>> > exit 0
>> > ;;
>> > -[lL])
>> > +[lL]|'')
>> > PAGER=less
>> > ;;
>> > -[mM]|'')
>> > +[mM])
>> > PAGER=more
>> > ;;
>> >  /*)
>> > @@ -458,11 +458,11 @@ check_pager () {
>> >  esac
>> >
>> >  # If user has a pager defined, or got assigned one above, use it.
>> > -# If not, use more.
>> > +# If not, use less.
>> >  #
>> > -PAGER=${PAGER:-more}
>> > +PAGER=${PAGER:-less}
>> >
>> > -if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then
>> > +if [ -n "${VERBOSE}" -a ! "${PAGER}" = "less" ]; then
>> >echo " *** You have ${PAGER} defined as your pager so we will use that"
>> >echo ''
>> >sleep 3
>> > @@ -1127,7 +1127,7 @@ for COMPFILE in `find . -type f | sort`; do
>> >  else
>> ># Ok, the files are different, so show the user where they differ.
>> ># Use user's choice of diff methods; and user's pager if they have 
>> > one.
>> > -  # Use more if not.
>> > +  # Use less if not.
>> ># Use unified diffs by default.  Context diffs give me a headache. 
>> > :)
>> >#
>> ># If the user chose the -F option, test for that before proceeding
>> >
>>
>> Any chance you'd consider `less -E` for mergemaster, instead of
>> unsalted less? After going through a second round of updates since
>> this, that one feels super repetitive as you end up with two
>> keystrokes at the end per file that differs as opposed to the previous
>> one. This is pretty nit-picky, so I won't be upset if you say no. =)
>>
>> Thanks,
>>
>> Kyle Evans
>
>
> Hmm, "-E" would make sense for mergemaster, even though I hate that behavior 
> for man.  But if mergemaster's pager is going to use different options than 
> other applications, then it also should get its own variable; mergemaster 
> should use MERGEMASTERPAGER the way that man uses MANPAGER.  Agree?
>

I'm inclined to agree on both counts. While I don't like a
proliferation of things to set to override defaults like this in the
general case, it seems to make sense for mergemaster. The application
of pager here is a different use case than most.
___
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: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bi

2018-08-24 Thread Alan Somers
On Fri, Aug 24, 2018 at 8:12 PM Kyle Evans  wrote:

> On Wed, Aug 8, 2018 at 2:24 PM Alan Somers  wrote:
> >
> > Author: asomers
> > Date: Wed Aug  8 19:24:20 2018
> > New Revision: 337497
> > URL: https://svnweb.freebsd.org/changeset/base/337497
> >
> > Log:
> >   Switch the default pager for most commands to less
> >
> >   Finally, a pager for the nineties.
> >
> >   MFC after:Never
> >   Relnotes: Yes
> >   Differential Revision:https://reviews.freebsd.org/D13465
> >   Poll: https://reviews.freebsd.org/V7
> >
>
> Hi,
>
> Hurray!
>
> > [... snip ...]
> > --- head/usr.sbin/mergemaster/mergemaster.shWed Aug  8 19:21:08
> 2018(r337496)
> > +++ head/usr.sbin/mergemaster/mergemaster.shWed Aug  8 19:24:20
> 2018(r337497)
> > @@ -426,19 +426,19 @@ check_pager () {
> >  echo ''
> >  echo "  or you may type an absolute path to PAGER for this run"
> >  echo ''
> > -echo "  Default is to use plain old 'more' "
> > +echo "  Default is to use 'less' "
> >  echo ''
> > -echo -n "What should I do? [Use 'more'] "
> > +echo -n "What should I do? [Use 'less'] "
> >  read FIXPAGER
> >
> >  case "${FIXPAGER}" in
> >  [eE])
> > exit 0
> > ;;
> > -[lL])
> > +[lL]|'')
> > PAGER=less
> > ;;
> > -[mM]|'')
> > +[mM])
> > PAGER=more
> > ;;
> >  /*)
> > @@ -458,11 +458,11 @@ check_pager () {
> >  esac
> >
> >  # If user has a pager defined, or got assigned one above, use it.
> > -# If not, use more.
> > +# If not, use less.
> >  #
> > -PAGER=${PAGER:-more}
> > +PAGER=${PAGER:-less}
> >
> > -if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then
> > +if [ -n "${VERBOSE}" -a ! "${PAGER}" = "less" ]; then
> >echo " *** You have ${PAGER} defined as your pager so we will use
> that"
> >echo ''
> >sleep 3
> > @@ -1127,7 +1127,7 @@ for COMPFILE in `find . -type f | sort`; do
> >  else
> ># Ok, the files are different, so show the user where they differ.
> ># Use user's choice of diff methods; and user's pager if they
> have one.
> > -  # Use more if not.
> > +  # Use less if not.
> ># Use unified diffs by default.  Context diffs give me a
> headache. :)
> >#
> ># If the user chose the -F option, test for that before proceeding
> >
>
> Any chance you'd consider `less -E` for mergemaster, instead of
> unsalted less? After going through a second round of updates since
> this, that one feels super repetitive as you end up with two
> keystrokes at the end per file that differs as opposed to the previous
> one. This is pretty nit-picky, so I won't be upset if you say no. =)
>
> Thanks,
>
> Kyle Evans
>

Hmm, "-E" would make sense for mergemaster, even though I hate that
behavior for man.  But if mergemaster's pager is going to use different
options than other applications, then it also should get its own variable;
mergemaster should use MERGEMASTERPAGER the way that man uses MANPAGER.
Agree?

-Alan
___
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: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bi

2018-08-24 Thread Kyle Evans
On Wed, Aug 8, 2018 at 2:24 PM Alan Somers  wrote:
>
> Author: asomers
> Date: Wed Aug  8 19:24:20 2018
> New Revision: 337497
> URL: https://svnweb.freebsd.org/changeset/base/337497
>
> Log:
>   Switch the default pager for most commands to less
>
>   Finally, a pager for the nineties.
>
>   MFC after:Never
>   Relnotes: Yes
>   Differential Revision:https://reviews.freebsd.org/D13465
>   Poll: https://reviews.freebsd.org/V7
>

Hi,

Hurray!

> [... snip ...]
> --- head/usr.sbin/mergemaster/mergemaster.shWed Aug  8 19:21:08 2018  
>   (r337496)
> +++ head/usr.sbin/mergemaster/mergemaster.shWed Aug  8 19:24:20 2018  
>   (r337497)
> @@ -426,19 +426,19 @@ check_pager () {
>  echo ''
>  echo "  or you may type an absolute path to PAGER for this run"
>  echo ''
> -echo "  Default is to use plain old 'more' "
> +echo "  Default is to use 'less' "
>  echo ''
> -echo -n "What should I do? [Use 'more'] "
> +echo -n "What should I do? [Use 'less'] "
>  read FIXPAGER
>
>  case "${FIXPAGER}" in
>  [eE])
> exit 0
> ;;
> -[lL])
> +[lL]|'')
> PAGER=less
> ;;
> -[mM]|'')
> +[mM])
> PAGER=more
> ;;
>  /*)
> @@ -458,11 +458,11 @@ check_pager () {
>  esac
>
>  # If user has a pager defined, or got assigned one above, use it.
> -# If not, use more.
> +# If not, use less.
>  #
> -PAGER=${PAGER:-more}
> +PAGER=${PAGER:-less}
>
> -if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then
> +if [ -n "${VERBOSE}" -a ! "${PAGER}" = "less" ]; then
>echo " *** You have ${PAGER} defined as your pager so we will use that"
>echo ''
>sleep 3
> @@ -1127,7 +1127,7 @@ for COMPFILE in `find . -type f | sort`; do
>  else
># Ok, the files are different, so show the user where they differ.
># Use user's choice of diff methods; and user's pager if they have one.
> -  # Use more if not.
> +  # Use less if not.
># Use unified diffs by default.  Context diffs give me a headache. :)
>#
># If the user chose the -F option, test for that before proceeding
>

Any chance you'd consider `less -E` for mergemaster, instead of
unsalted less? After going through a second round of updates since
this, that one feels super repetitive as you end up with two
keystrokes at the end per file that differs as opposed to the previous
one. This is pretty nit-picky, so I won't be upset if you say no. =)

Thanks,

Kyle Evans
___
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: r338306 - head/sys/netinet6

2018-08-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Aug 24 21:49:21 2018
New Revision: 338306
URL: https://svnweb.freebsd.org/changeset/base/338306

Log:
  Unbreak RSS builds after r338257.  Folding both RSS blocks together
  I missed the closing } of the new combined block.
  
  Pointyhat to: bz
  Reported by:  np
  Approved by:  re (kib)

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Fri Aug 24 21:48:13 2018
(r338305)
+++ head/sys/netinet6/udp6_usrreq.c Fri Aug 24 21:49:21 2018
(r338306)
@@ -960,6 +960,7 @@ udp6_output(struct socket *so, int flags_arg, struct m
 * be incorrect.
 */
flags |= IP_NODEFAULTFLOWID;
+   }
 #endif
 
UDPSTAT_INC(udps_opackets);
___
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: r338305 - head/sys/net

2018-08-24 Thread Navdeep Parhar
Author: np
Date: Fri Aug 24 21:48:13 2018
New Revision: 338305
URL: https://svnweb.freebsd.org/changeset/base/338305

Log:
  Unbreak VLANs after r337943.
  
  ether_set_pcp should not be called from ether_output_frame for VLAN
  interfaces -- the vid + pcp will be inserted during vlan_transmit in
  that case. r337943 sets the VLAN's ifnet's if_pcp to a proper PCP value
  and this led to double encapsulation (once with vid 0 and second time
  with vid+pcp).
  
  PR: 230794
  Reviewed by:  kib@
  Approved by:  re@ (gjb@)
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D16887

Modified:
  head/sys/net/if_ethersubr.c

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Fri Aug 24 21:08:05 2018(r338304)
+++ head/sys/net/if_ethersubr.c Fri Aug 24 21:48:13 2018(r338305)
@@ -461,7 +461,8 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m)
uint8_t pcp;
 
pcp = ifp->if_pcp;
-   if (pcp != IFNET_PCP_NONE && !ether_set_pcp(&m, ifp, pcp))
+   if (pcp != IFNET_PCP_NONE && ifp->if_type != IFT_L2VLAN &&
+   !ether_set_pcp(&m, ifp, pcp))
return (0);
 
if (PFIL_HOOKED(&V_link_pfil_hook)) {
___
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: r338304 - head/sys/dev/mmc

2018-08-24 Thread Marius Strobl
Author: marius
Date: Fri Aug 24 21:08:05 2018
New Revision: 338304
URL: https://svnweb.freebsd.org/changeset/base/338304

Log:
  The read accessors generated by __BUS_ACCESSOR() have the problem that
  they don't check the result of BUS_READ_IVAR(9) and silently return stack
  garbage on failure in case a bus doesn't implement a particular instance
  variable for example. With MMC bridges not providing MMCBR_IVAR_RETUNE_REQ,
  yet, this in turn can cause mmc(4) to get into a state in which re-tuning
  seems to be necessary but is inappropriate, causing mmc_wait_for_request()
  to fail. Thus, don't use __BUS_ACCESSOR() for mmcbr_get_retune_req() and
  instead provide a version of the latter which returns retune_req_none if
  reading MMCBR_IVAR_RETUNE_REQ fails.
  One more straight-forward solution would have been to change mmc(4) to not
  call mmcbr_get_retune_req() if the current transfer mode doesn't require
  re-tuning to begin with. However, for modes such as SDR50, it depends on
  the controller whether periodic re-tuning is need. Therefore, knowledge of
  whether a particular transfer mode does require re-tuning should be kept
  to the bridge drivers.
  This change is the generic version of r338271, as intended not requiring
  bridge drivers to be touched (unless transfer modes beyond high speed are
  to be supported that is).
  
  Approved by:  re (gjb)

Modified:
  head/sys/dev/mmc/mmcbrvar.h

Modified: head/sys/dev/mmc/mmcbrvar.h
==
--- head/sys/dev/mmc/mmcbrvar.h Fri Aug 24 20:44:58 2018(r338303)
+++ head/sys/dev/mmc/mmcbrvar.h Fri Aug 24 21:08:05 2018(r338304)
@@ -97,7 +97,6 @@ MMCBR_ACCESSOR(host_ocr, HOST_OCR, int)
 MMCBR_ACCESSOR(mode, MODE, int)
 MMCBR_ACCESSOR(ocr, OCR, int)
 MMCBR_ACCESSOR(power_mode, POWER_MODE, int)
-MMCBR_ACCESSOR(retune_req, RETUNE_REQ, int)
 MMCBR_ACCESSOR(vdd, VDD, int)
 MMCBR_ACCESSOR(vccq, VCCQ, int)
 MMCBR_ACCESSOR(caps, CAPS, int)
@@ -105,6 +104,20 @@ MMCBR_ACCESSOR(timing, TIMING, int)
 MMCBR_ACCESSOR(max_data, MAX_DATA, int)
 MMCBR_ACCESSOR(max_busy_timeout, MAX_BUSY_TIMEOUT, u_int)
 
+static int __inline
+mmcbr_get_retune_req(device_t dev)
+{
+   uintptr_t v;
+
+   if (__predict_false(BUS_READ_IVAR(device_get_parent(dev), dev,
+   MMCBR_IVAR_RETUNE_REQ, &v) != 0))
+   return (retune_req_none);
+   return ((int)v);
+}
+
+/*
+ * Convenience wrappers for the mmcbr interface
+ */
 static int __inline
 mmcbr_update_ios(device_t dev)
 {
___
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: r338303 - in head: . lib/libbe sbin/bectl tools/build/mk

2018-08-24 Thread Kyle Evans
Author: kevans
Date: Fri Aug 24 20:44:58 2018
New Revision: 338303
URL: https://svnweb.freebsd.org/changeset/base/338303

Log:
  libbe(3)/bectl(8): Make consistent with beadm
  
  vermaden (maintainer of beadm) points out the following inconsistencies:
  - "missing command" is not printed prior to usage if the error is simply a
 missing command; this should be obvious from the context
  - "bectl rename" isn't using the "don't unmount" flag (zfs rename -u), so
 the active BE can't be renamed. It doesn't make sense in our context to
 *not* use -u, so use it.
  
  Documentation updates reflect the above and note an inconsistency with the
  'destroy' command that is consistent with other parts of the base system.
  
  A fix for libbe(3) not properly being installed to /lib is included.
  SHLIBDIR should have been added when it was moved in r337995.
  
  Approved by:  re (kib)

Modified:
  head/ObsoleteFiles.inc
  head/lib/libbe/Makefile
  head/lib/libbe/be.c
  head/lib/libbe/libbe.3
  head/sbin/bectl/bectl.8
  head/sbin/bectl/bectl.c
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Aug 24 18:47:50 2018(r338302)
+++ head/ObsoleteFiles.inc  Fri Aug 24 20:44:58 2018(r338303)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180824: libbe(3) SHLIBDIR fixed to reflect correct location
+OLD_LIBS+=usr/lib/libbe.so.1
 # 20180819: Remove deprecated arc4random(3) stir/addrandom interfaces
 OLD_FILES+=usr/share/man/man3/arc4random_addrandom.3.gz
 OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz

Modified: head/lib/libbe/Makefile
==
--- head/lib/libbe/Makefile Fri Aug 24 18:47:50 2018(r338302)
+++ head/lib/libbe/Makefile Fri Aug 24 20:44:58 2018(r338303)
@@ -2,6 +2,7 @@
 
 PACKAGE=   lib${LIB}
 LIB=   be
+SHLIBDIR?= /lib
 SHLIB_MAJOR=   1
 SHLIB_MINOR=   0
 

Modified: head/lib/libbe/be.c
==
--- head/lib/libbe/be.c Fri Aug 24 18:47:50 2018(r338302)
+++ head/lib/libbe/be.c Fri Aug 24 20:44:58 2018(r338303)
@@ -623,10 +623,6 @@ be_rename(libbe_handle_t *lbh, const char *old, const 
if ((err = be_root_concat(lbh, new, full_new)) != 0)
return (set_error(lbh, err));
 
-   /* Check if old is active BE */
-   if (strcmp(full_old, be_active_path(lbh)) == 0)
-   return (set_error(lbh, BE_ERR_MOUNTED));
-
if (!zfs_dataset_exists(lbh->lzh, full_old, ZFS_TYPE_DATASET))
return (set_error(lbh, BE_ERR_NOENT));
 
@@ -637,14 +633,10 @@ be_rename(libbe_handle_t *lbh, const char *old, const 
ZFS_TYPE_FILESYSTEM)) == NULL)
return (set_error(lbh, BE_ERR_ZFSOPEN));
 
-   /* XXX TODO: Allow a force flag */
-   if (zfs_is_mounted(zfs_hdl, NULL)) {
-   zfs_close(zfs_hdl);
-   return (set_error(lbh, BE_ERR_MOUNTED));
-   }
-
/* recurse, nounmount, forceunmount */
-   struct renameflags flags = { 0, 0, 0 };
+   struct renameflags flags = {
+   .nounmount = 1,
+   };
 
err = zfs_rename(zfs_hdl, NULL, full_new, flags);
 

Modified: head/lib/libbe/libbe.3
==
--- head/lib/libbe/libbe.3  Fri Aug 24 18:47:50 2018(r338302)
+++ head/lib/libbe/libbe.3  Fri Aug 24 20:44:58 2018(r338303)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 16, 2018
+.Dd August 24, 2018
 .Dt LIBBE 3
 .Os
 .Sh NAME
@@ -222,7 +222,12 @@ snapshot.
 .Pp
 The
 .Fn be_rename
-function renames a boot environment.
+function renames a boot environment without unmounting it, as if renamed with
+the
+.Fl u
+argument were passed to
+.Nm zfs
+.Cm rename
 .Pp
 The
 .Fn be_activate

Modified: head/sbin/bectl/bectl.8
==
--- head/sbin/bectl/bectl.8 Fri Aug 24 18:47:50 2018(r338302)
+++ head/sbin/bectl/bectl.8 Fri Aug 24 20:44:58 2018(r338303)
@@ -18,7 +18,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 22, 2018
+.Dd August 24, 2018
 .Dt BECTL 8
 .Os
 .Sh NAME
@@ -132,7 +132,8 @@ Destroys the given
 .Ar beName
 boot environment or
 .Ar beName@snapshot
-snapshot.
+snapshot without confirmation, unlike in
+.Nm beadm .
 Specifying
 .Fl F
 will automatically unmount without confirmation.
@@ -239,10 +240,11 @@ Mount at the specified
 .Ar mountpoint
 if provided.
 .It Cm rename Ar origBeName newBeName
-Renames the given nonactive
+Renames the given
 .Ar origBeName
 to the given
 .Ar newBeName .
+The boot environment will not be unmounted in order 

svn commit: r338302 - head/sys/vm

2018-08-24 Thread Gleb Smirnoff
Author: glebius
Date: Fri Aug 24 18:47:50 2018
New Revision: 338302
URL: https://svnweb.freebsd.org/changeset/base/338302

Log:
  Either "free" or "allocated" is misleading here, since an item
  in a bucket is free from perspective of UMA consumer, and it is
  allocated from perspective of keg.
  
  Discussed with:   markj
  Approved by:  re (kib)

Modified:
  head/sys/vm/uma_int.h

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Fri Aug 24 18:31:12 2018(r338301)
+++ head/sys/vm/uma_int.h   Fri Aug 24 18:47:50 2018(r338302)
@@ -188,7 +188,7 @@ struct uma_hash {
 
 struct uma_bucket {
LIST_ENTRY(uma_bucket)  ub_link;/* Link into the zone */
-   int16_t ub_cnt; /* Count of allocated items. */
+   int16_t ub_cnt; /* Count of items in bucket. */
int16_t ub_entries; /* Max items. */
void*ub_bucket[];   /* actual allocation storage */
 };
___
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: r338293 - head/sys/dev/random

2018-08-24 Thread Conrad Meyer
On Fri, Aug 24, 2018 at 7:53 AM, Mark Murray  wrote:
> Author: markm
> Date: Fri Aug 24 14:53:46 2018
> New Revision: 338293
> URL: https://svnweb.freebsd.org/changeset/base/338293
>
> Log:
>   Limit the amount of "fast" entropy. We don't need nearly as much
>   for security, and the excess just slows things down badly.
>
>   PR: 230808
>   Submitted by:   rwmailli...@googlemail.com, but tweeked by me
>   Reported by:Danilo Egea Gondolfo 

Also, initially reported by Ali Abdallah  on
freebsd-current@.

Best,
Conrad
___
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: r338296 - head/release/arm64

2018-08-24 Thread Emmanuel Vadot
Author: manu
Date: Fri Aug 24 15:01:58 2018
New Revision: 338296
URL: https://svnweb.freebsd.org/changeset/base/338296

Log:
  release: arm64: Enable overlays for PINE64 and PINE64-LTS
  
  Approved by:  re (gjb)

Modified:
  head/release/arm64/PINE64-LTS.conf
  head/release/arm64/PINE64.conf

Modified: head/release/arm64/PINE64-LTS.conf
==
--- head/release/arm64/PINE64-LTS.conf  Fri Aug 24 15:01:22 2018
(r338295)
+++ head/release/arm64/PINE64-LTS.conf  Fri Aug 24 15:01:58 2018
(r338296)
@@ -14,6 +14,7 @@ KERNEL="GENERIC"
 MD_ARGS="-x 63 -y 255"
 NODOC=1
 PART_SCHEME="MBR"
+FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer"
 export BOARDNAME="PINE64-LTS"
 
 arm_install_uboot() {

Modified: head/release/arm64/PINE64.conf
==
--- head/release/arm64/PINE64.conf  Fri Aug 24 15:01:22 2018
(r338295)
+++ head/release/arm64/PINE64.conf  Fri Aug 24 15:01:58 2018
(r338296)
@@ -14,6 +14,7 @@ KERNEL="GENERIC"
 MD_ARGS="-x 63 -y 255"
 NODOC=1
 PART_SCHEME="MBR"
+FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer"
 export BOARDNAME="PINE64"
 
 arm_install_uboot() {
___
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: r338295 - head/release/tools

2018-08-24 Thread Emmanuel Vadot
Author: manu
Date: Fri Aug 24 15:01:22 2018
New Revision: 338295
URL: https://svnweb.freebsd.org/changeset/base/338295

Log:
  release: arm: Setup overlays if board config defines some
  
  Approved by:  re (gjb)

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Fri Aug 24 15:00:36 2018(r338294)
+++ head/release/tools/arm.subr Fri Aug 24 15:01:22 2018(r338295)
@@ -140,6 +140,17 @@ arm64_setup_multicons() {
 >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
 }
 
+arm_setup_fdt_overlays() {
+   if [ -z "${FDT_OVERLAYS}" ]; then
+   return
+   fi
+
+   echo '# DTB OVERLAYS' \
+   >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
+   echo "fdt_overlays=\"${FDT_OVERLAYS}\"" \
+>> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
+}
+
 arm_install_base() {
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR}
eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \
@@ -152,6 +163,7 @@ arm_install_base() {
arm_create_user
arm_setup_usb_otg
arm64_setup_multicons
+   arm_setup_fdt_overlays
 
echo '# Custom /etc/fstab for FreeBSD embedded images' \
> ${CHROOTDIR}/${DESTDIR}/etc/fstab
___
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: r338294 - in head/sys: dts/arm64 dts/arm64/overlays modules/dtb/allwinner

2018-08-24 Thread Emmanuel Vadot
Author: manu
Date: Fri Aug 24 15:00:36 2018
New Revision: 338294
URL: https://svnweb.freebsd.org/changeset/base/338294

Log:
  arm64: Add DTS overlays for A64
  
   - sun50i-a64-sid.dtso registers the Security ID node, needed for thermal
   - sun50i-a64-ths.dtso registers the thermal node, for which we already have a
  driver
   - sun50i-a64-timer.dtso registers the timer node, needed as the generic timer
   glitch on A64 SoC.
  
  Approved by:re (gjb)

Added:
  head/sys/dts/arm64/
  head/sys/dts/arm64/Makefile   (contents, props changed)
  head/sys/dts/arm64/overlays/
  head/sys/dts/arm64/overlays/Makefile   (contents, props changed)
  head/sys/dts/arm64/overlays/sun50i-a64-sid.dtso   (contents, props changed)
  head/sys/dts/arm64/overlays/sun50i-a64-ths.dtso   (contents, props changed)
  head/sys/dts/arm64/overlays/sun50i-a64-timer.dtso   (contents, props changed)
Modified:
  head/sys/modules/dtb/allwinner/Makefile

Added: head/sys/dts/arm64/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/Makefile Fri Aug 24 15:00:36 2018(r338294)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+DTS!=ls *.dts
+
+all: test-dts
+
+.include 

Added: head/sys/dts/arm64/overlays/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/overlays/MakefileFri Aug 24 15:00:36 2018
(r338294)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+DTSO!=ls *.dtso
+
+all: test-dtso
+
+.include 

Added: head/sys/dts/arm64/overlays/sun50i-a64-sid.dtso
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/overlays/sun50i-a64-sid.dtso Fri Aug 24 15:00:36 
2018(r338294)
@@ -0,0 +1,17 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+   compatible = "allwinner,sun50i-a64";
+};
+
+&{/soc} {
+   sid: eeprom@1c14000 {
+   compatible = "allwinner,sun50i-a64-sid";
+   reg = <0x1c14000 0x400>;
+
+   ths_calib: calib@234 {
+   reg = <0x234 0x6>;
+   };
+   };
+};

Added: head/sys/dts/arm64/overlays/sun50i-a64-ths.dtso
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/overlays/sun50i-a64-ths.dtso Fri Aug 24 15:00:36 
2018(r338294)
@@ -0,0 +1,27 @@
+/dts-v1/;
+/plugin/;
+
+#include 
+#include 
+#include 
+
+/ {
+   compatible = "allwinner,sun50i-a64";
+};
+
+&{/soc} {
+   ths: thermal_sensor@1c25000 {
+   compatible = "allwinner,sun50i-a64-ths";
+   reg = <0x01c25000 0x100>;
+   interrupts = ;
+   clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
+   clock-names = "apb", "ths";
+   resets = <&ccu RST_BUS_THS>;
+   reset-names = "apb";
+   #thermal-sensor-cells = <2>;
+   status = "okay";
+
+   nvmem-cells = <&ths_calib>;
+   nvmem-cell-names = "ths-calib";
+   };
+};

Added: head/sys/dts/arm64/overlays/sun50i-a64-timer.dtso
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm64/overlays/sun50i-a64-timer.dtso   Fri Aug 24 15:00:36 
2018(r338294)
@@ -0,0 +1,17 @@
+/dts-v1/;
+/plugin/;
+
+#include 
+/ {
+   compatible = "allwinner,sun50i-a64";
+};
+
+&{/soc} {
+   timer@1c20c00 {
+   compatible = "allwinner,sun8i-a23-timer";
+   reg = <0x1c20c00 0x2C>;
+   interrupts = ,
+;
+   status = "okay";
+   };
+};

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Fri Aug 24 14:53:46 2018
(r338293)
+++ head/sys/modules/dtb/allwinner/Makefile Fri Aug 24 15:00:36 2018
(r338294)
@@ -43,6 +43,11 @@ DTS= \
allwinner/sun50i-a64-pine64.dts \
allwinner/sun50i-a64-sopine-baseboard.dts \
allwinner/sun50i-h5-orangepi-pc2.dts
+
+DTSO=  sun50i-a64-sid.dtso \
+   sun50i-a64-ths.dtso \
+   sun50i-a64-timer.dtso
+
 .endif
 
 .include 
___
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: r338293 - head/sys/dev/random

2018-08-24 Thread Mark Murray
Author: markm
Date: Fri Aug 24 14:53:46 2018
New Revision: 338293
URL: https://svnweb.freebsd.org/changeset/base/338293

Log:
  Limit the amount of "fast" entropy. We don't need nearly as much
  for security, and the excess just slows things down badly.
  
  PR: 230808
  Submitted by:   rwmailli...@googlemail.com, but tweeked by me
  Reported by:Danilo Egea Gondolfo 
  Reviewed by:  cem,delphij
  Approved by:  re(rgrimes)
  Approved by:  so(delphij)
  MFC after:  1 Month
  Differential Revision:https://reviews.freebsd.org/D16873

Modified:
  head/sys/dev/random/random_harvestq.c

Modified: head/sys/dev/random/random_harvestq.c
==
--- head/sys/dev/random/random_harvestq.c   Fri Aug 24 14:53:42 2018
(r338292)
+++ head/sys/dev/random/random_harvestq.c   Fri Aug 24 14:53:46 2018
(r338293)
@@ -57,6 +57,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
+#include 
 #include 
 #include 
 
@@ -213,8 +217,12 @@ random_sources_feed(void)
/* It's an indenting error. Yeah, Yeah. */
 #endif
local_read_rate = atomic_readandclear_32(&read_rate);
+   /* Perform at least one read per round */
+   local_read_rate = MAX(local_read_rate, 1);
+   /* But not exceeding RANDOM_KEYSIZE_WORDS */
+   local_read_rate = MIN(local_read_rate, RANDOM_KEYSIZE_WORDS);
LIST_FOREACH(rrs, &source_list, rrs_entries) {
-   for (i = 0; i < 
p_random_alg_context->ra_poolcount*(local_read_rate + 1); i++) {
+   for (i = 0; i < 
p_random_alg_context->ra_poolcount*local_read_rate; i++) {
n = rrs->rrs_source->rs_read(entropy, sizeof(entropy));
KASSERT((n <= sizeof(entropy)), ("%s: rs_read returned 
too much data (%u > %zu)", __func__, n, sizeof(entropy)));
/* It would appear that in some circumstances (e.g. 
virtualisation),
___
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: r338292 - head/sys/dev/random

2018-08-24 Thread Mark Murray
Author: markm
Date: Fri Aug 24 14:53:42 2018
New Revision: 338292
URL: https://svnweb.freebsd.org/changeset/base/338292

Log:
  Fix braino of mine where the reseeds would happen far too often,
  making the kernel process way too busy.
  
  PR: 230808
  Submitted by:   Conrad Meyer 
  Reported by:Danilo Egea Gondolfo 
  Reviewed by:  cem,delphij
  Approved by:  re(rgrimes)
  Approved by:  so(delphij)
  MFC after:  1 Month
  Security: Yes
  Differential Revision:https://reviews.freebsd.org/D16872

Modified:
  head/sys/dev/random/fortuna.c

Modified: head/sys/dev/random/fortuna.c
==
--- head/sys/dev/random/fortuna.c   Fri Aug 24 10:50:19 2018
(r338291)
+++ head/sys/dev/random/fortuna.c   Fri Aug 24 14:53:42 2018
(r338292)
@@ -371,7 +371,7 @@ random_fortuna_pre_read(void)
if (fortuna_state.fs_pool[0].fsp_length >= fortuna_state.fs_minpoolsize
 #ifdef _KERNEL
/* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */
-   && (now - fortuna_state.fs_lasttime > hz/10)
+   && (now - fortuna_state.fs_lasttime > SBT_1S/10)
 #endif
) {
 #ifdef _KERNEL
___
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: r338291 - head/sys/netinet

2018-08-24 Thread Michael Tuexen
Author: tuexen
Date: Fri Aug 24 10:50:19 2018
New Revision: 338291
URL: https://svnweb.freebsd.org/changeset/base/338291

Log:
  Fix a shadowed variable warning.
  Thanks to Peter Lei for reporting the issue.
  
  Approved by:  re(kib@)
  MFH:  1 month
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Fri Aug 24 02:23:25 2018
(r338290)
+++ head/sys/netinet/tcp_usrreq.c   Fri Aug 24 10:50:19 2018
(r338291)
@@ -1662,7 +1662,6 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
return (0);
}
if (tp->t_state != TCPS_CLOSED) {
-   int error=EINVAL;
/* 
 * The user has advanced the state
 * past the initial point, we may not
@@ -1675,7 +1674,8 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt)
 * still be possible?
 */
error = (*blk->tfb_tcp_handoff_ok)(tp);
-   }
+   } else
+   error = EINVAL;
if (error) {
refcount_release(&blk->tfb_refcnt);
INP_WUNLOCK(inp);
___
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"