svn commit: r332602 - in stable/11/sbin/dhclient: . tests

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:23:32 2018
New Revision: 332602
URL: https://svnweb.freebsd.org/changeset/base/332602

Log:
  MFC r329754:
  
  dhclient: raise WARNS to 4
  
  Mostly const-correctness fixes. There were also some variable-shadowing,
  unused variable, and a couple of sockaddr type-correctness changes. I also had
  trouble with cast-align warnings. I was able to prove that one of them was a
  false positive. But ultimately I had to disable the warning program-wide to
  deal with the others.
  
  Reviewed by:  cem
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D14460

Modified:
  stable/11/sbin/dhclient/Makefile
  stable/11/sbin/dhclient/clparse.c
  stable/11/sbin/dhclient/conflex.c
  stable/11/sbin/dhclient/dhclient.c
  stable/11/sbin/dhclient/dhcpd.h
  stable/11/sbin/dhclient/dispatch.c
  stable/11/sbin/dhclient/errwarn.c
  stable/11/sbin/dhclient/hash.c
  stable/11/sbin/dhclient/options.c
  stable/11/sbin/dhclient/privsep.c
  stable/11/sbin/dhclient/privsep.h
  stable/11/sbin/dhclient/tables.c
  stable/11/sbin/dhclient/tests/fake.c
  stable/11/sbin/dhclient/tree.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/dhclient/Makefile
==
--- stable/11/sbin/dhclient/MakefileMon Apr 16 16:22:00 2018
(r332601)
+++ stable/11/sbin/dhclient/MakefileMon Apr 16 16:23:32 2018
(r332602)
@@ -44,7 +44,8 @@ MAN=  dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp
dhclient-script.8
 LIBADD=util
 
-WARNS?=3
+WARNS?=4
+NO_WCAST_ALIGN=yes
 
 .if ${MK_TESTS} != "no"
 SUBDIR+=tests

Modified: stable/11/sbin/dhclient/clparse.c
==
--- stable/11/sbin/dhclient/clparse.c   Mon Apr 16 16:22:00 2018
(r332601)
+++ stable/11/sbin/dhclient/clparse.c   Mon Apr 16 16:23:32 2018
(r332602)
@@ -685,7 +685,7 @@ parse_option_decl(FILE *cfile, struct option_data *opt
u_int8_t hunkbuf[1024];
unsigned hunkix = 0;
char*vendor;
-   char*fmt;
+   const char  *fmt;
struct universe *universe;
struct option   *option;
struct iaddr ip_addr;

Modified: stable/11/sbin/dhclient/conflex.c
==
--- stable/11/sbin/dhclient/conflex.c   Mon Apr 16 16:22:00 2018
(r332601)
+++ stable/11/sbin/dhclient/conflex.c   Mon Apr 16 16:23:32 2018
(r332602)
@@ -53,7 +53,7 @@ int lexchar;
 char *token_line;
 char *prev_line;
 char *cur_line;
-char *tlname;
+const char *tlname;
 int eol_token;
 
 static char line1[81];
@@ -76,7 +76,7 @@ static int read_num_or_name(int, FILE *);
 static int intern(char *, int);
 
 void
-new_parse(char *name)
+new_parse(const char *name)
 {
tlname = name;
lpos = line = 1;
@@ -262,7 +262,7 @@ read_string(FILE *cfile)
 static int
 read_number(int c, FILE *cfile)
 {
-   int seenx = 0, token = NUMBER;
+   int seenx = 0, _token = NUMBER;
unsigned i = 0;
 
tokbuf[i++] = c;
@@ -284,7 +284,7 @@ read_number(int c, FILE *cfile)
tokbuf[i] = 0;
tval = tokbuf;
 
-   return (token);
+   return (_token);
 }
 
 static int

Modified: stable/11/sbin/dhclient/dhclient.c
==
--- stable/11/sbin/dhclient/dhclient.c  Mon Apr 16 16:22:00 2018
(r332601)
+++ stable/11/sbin/dhclient/dhclient.c  Mon Apr 16 16:23:32 2018
(r332602)
@@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$");
 time_t cur_time;
 time_t default_lease_time = 43200; /* 12 hours... */
 
-char *path_dhclient_conf = _PATH_DHCLIENT_CONF;
+const char *path_dhclient_conf = _PATH_DHCLIENT_CONF;
 char *path_dhclient_db = NULL;
 
 int log_perror = 1;
@@ -127,10 +127,10 @@ void   routehandler(struct protocol *);
 voidusage(void);
 int check_option(struct client_lease *l, int option);
 int check_classless_option(unsigned char *data, int len);
-int ipv4addrs(char * buf);
+int ipv4addrs(const char * buf);
 int res_hnok(const char *dn);
 int check_search(const char *srch);
-char   *option_as_string(unsigned int code, unsigned char *data, int 
len);
+const char *option_as_string(unsigned int code, unsigned char *data, int 
len);
 int fork_privchld(int, int);
 
 #defineROUNDUP(a) \
@@ -197,26 +197,25 @@ uint8_t curbssid[6];
 static void
 disassoc(void *arg)
 {
-   struct interface_info *ifi = arg;
+   struct interface_info *_ifi = arg;
 
/*
 * Clear existing state.
 */
-   if (ifi->client->active != NULL) {
+   if (_ifi->client->active != NULL) {
script_init("EXPIRE", NULL);

svn commit: r332606 - stable/11/usr.sbin/spray

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:28:23 2018
New Revision: 332606
URL: https://svnweb.freebsd.org/changeset/base/332606

Log:
  MFC r330515:
  
  spray: fix the spelling in an output string

Modified:
  stable/11/usr.sbin/spray/spray.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/spray/spray.c
==
--- stable/11/usr.sbin/spray/spray.cMon Apr 16 16:27:08 2018
(r332605)
+++ stable/11/usr.sbin/spray/spray.cMon Apr 16 16:28:23 2018
(r332606)
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
 
 
/* Spray server with packets */
-   printf ("sending %u packets of lnth %d to %s ...", count, length,
+   printf ("sending %u packets of length %d to %s ...", count, length,
*argv);
fflush (stdout);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332612 - stable/11/sys/dev/iscsi

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:08:58 2018
New Revision: 332612
URL: https://svnweb.freebsd.org/changeset/base/332612

Log:
  MFC r326730:
  
  Move the DIAGNOSTIC check for lost iSCSI PDUs from icl_conn_close()
  to icl_conn_free().  It's perfectly valid for the counter to be non-zero
  in the former.
  
  Sponsored by: playkey.net

Modified:
  stable/11/sys/dev/iscsi/icl_soft.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iscsi/icl_soft.c
==
--- stable/11/sys/dev/iscsi/icl_soft.c  Mon Apr 16 17:06:18 2018
(r332611)
+++ stable/11/sys/dev/iscsi/icl_soft.c  Mon Apr 16 17:08:58 2018
(r332612)
@@ -1172,6 +1172,11 @@ void
 icl_soft_conn_free(struct icl_conn *ic)
 {
 
+#ifdef DIAGNOSTIC
+   KASSERT(ic->ic_outstanding_pdus == 0,
+   ("destroying session with %d outstanding PDUs",
+ic->ic_outstanding_pdus));
+#endif
cv_destroy(>ic_send_cv);
cv_destroy(>ic_receive_cv);
kobj_delete((struct kobj *)ic, M_ICL_SOFT);
@@ -1412,11 +1417,6 @@ icl_soft_conn_close(struct icl_conn *ic)
 
KASSERT(STAILQ_EMPTY(>ic_to_send),
("destroying session with non-empty send queue"));
-#ifdef DIAGNOSTIC
-   KASSERT(ic->ic_outstanding_pdus == 0,
-   ("destroying session with %d outstanding PDUs",
-ic->ic_outstanding_pdus));
-#endif
ICL_CONN_UNLOCK(ic);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332630 - in head: lib/libifconfig sbin/devd sbin/etherswitchcfg sbin/ifconfig

2018-04-16 Thread Brooks Davis
Author: brooks
Date: Mon Apr 16 18:07:51 2018
New Revision: 332630
URL: https://svnweb.freebsd.org/changeset/base/332630

Log:
  Remove support for FDDI and token ring media types in userland utilities.
  
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D15077

Modified:
  head/lib/libifconfig/libifconfig_media.c
  head/sbin/devd/devd.cc
  head/sbin/etherswitchcfg/ifmedia.c
  head/sbin/ifconfig/ifmedia.c

Modified: head/lib/libifconfig/libifconfig_media.c
==
--- head/lib/libifconfig/libifconfig_media.cMon Apr 16 17:43:26 2018
(r332629)
+++ head/lib/libifconfig/libifconfig_media.cMon Apr 16 18:07:51 2018
(r332630)
@@ -373,15 +373,6 @@ ifconfig_media_get_status(const struct ifmediareq *ifm
}
break;
 
-   case IFM_FDDI:
-   case IFM_TOKEN:
-   if (ifmr->ifm_status & IFM_ACTIVE) {
-   return ("inserted");
-   } else {
-   return ("no ring");
-   }
-   break;
-
case IFM_IEEE80211:
if (ifmr->ifm_status & IFM_ACTIVE) {
/* NB: only sta mode associates */

Modified: head/sbin/devd/devd.cc
==
--- head/sbin/devd/devd.cc  Mon Apr 16 17:43:26 2018(r332629)
+++ head/sbin/devd/devd.cc  Mon Apr 16 18:07:51 2018(r332630)
@@ -333,8 +333,6 @@ media::media(config &, const char *var, const char *ty
 {
static struct ifmedia_description media_types[] = {
{ IFM_ETHER,"Ethernet" },
-   { IFM_TOKEN,"Tokenring" },
-   { IFM_FDDI, "FDDI" },
{ IFM_IEEE80211,"802.11" },
{ IFM_ATM,  "ATM" },
{ -1,   "unknown" },

Modified: head/sbin/etherswitchcfg/ifmedia.c
==
--- head/sbin/etherswitchcfg/ifmedia.c  Mon Apr 16 17:43:26 2018
(r332629)
+++ head/sbin/etherswitchcfg/ifmedia.c  Mon Apr 16 18:07:51 2018
(r332630)
@@ -159,14 +159,6 @@ media_status(int s)
printf("no carrier");
break;
 
-   case IFM_FDDI:
-   case IFM_TOKEN:
-   if (ifmr.ifm_status & IFM_ACTIVE)
-   printf("inserted");
-   else
-   printf("no ring");
-   break;
-
case IFM_IEEE80211:
if (ifmr.ifm_status & IFM_ACTIVE) {
/* NB: only sta mode associates */

Modified: head/sbin/ifconfig/ifmedia.c
==
--- head/sbin/ifconfig/ifmedia.cMon Apr 16 17:43:26 2018
(r332629)
+++ head/sbin/ifconfig/ifmedia.cMon Apr 16 18:07:51 2018
(r332630)
@@ -168,14 +168,6 @@ media_status(int s)
printf("no carrier");
break;
 
-   case IFM_FDDI:
-   case IFM_TOKEN:
-   if (ifmr.ifm_status & IFM_ACTIVE)
-   printf("inserted");
-   else
-   printf("no ring");
-   break;
-
case IFM_IEEE80211:
if (ifmr.ifm_status & IFM_ACTIVE) {
/* NB: only sta mode associates */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332598 - stable/11/sys/dev/usb

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:19:31 2018
New Revision: 332598
URL: https://svnweb.freebsd.org/changeset/base/332598

Log:
  MFC r328589:
  
  Make the handler routine for the hw.usb.template sysctl trigger the USB
  host to reprobe the bus by switching the USB pull up resistors off and
  back on.  In other words - when FreeBSD is configured as a USB device,
  changing the sysctl will be immediately noticed by the machine it's
  connected to.
  
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/sys/dev/usb/usb_device.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/usb_device.c
==
--- stable/11/sys/dev/usb/usb_device.c  Mon Apr 16 16:16:24 2018
(r332597)
+++ stable/11/sys/dev/usb/usb_device.c  Mon Apr 16 16:19:31 2018
(r332598)
@@ -85,6 +85,7 @@
 
 /* function prototypes  */
 
+static int sysctl_hw_usb_template(SYSCTL_HANDLER_ARGS);
 static voidusb_init_endpoint(struct usb_device *, uint8_t,
struct usb_endpoint_descriptor *,
struct usb_endpoint_ss_comp_descriptor *,
@@ -118,8 +119,137 @@ int   usb_template = USB_TEMPLATE;
 intusb_template;
 #endif
 
-SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RWTUN,
-_template, 0, "Selected USB device side template");
+SYSCTL_PROC(_hw_usb, OID_AUTO, template,
+CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
+NULL, 0, sysctl_hw_usb_template,
+"I", "Selected USB device side template");
+
+/**
+ * usb_trigger_reprobe_on_off
+ *
+ * This function sets the pull up resistors for all ports currently
+ * operating in device mode either on (when on_not_off is 1), or off
+ * (when it's 0).
+ **/
+static void
+usb_trigger_reprobe_on_off(int on_not_off)
+{
+   struct usb_port_status ps;
+   struct usb_bus *bus;
+   struct usb_device *udev;
+   usb_error_t err;
+   int do_unlock, max;
+
+   max = devclass_get_maxunit(usb_devclass_ptr);
+   while (max >= 0) {
+   mtx_lock(_ref_lock);
+   bus = devclass_get_softc(usb_devclass_ptr, max);
+   max--;
+
+   if (bus == NULL || bus->devices == NULL ||
+   bus->devices[USB_ROOT_HUB_ADDR] == NULL) {
+   mtx_unlock(_ref_lock);
+   continue;
+   }
+
+   udev = bus->devices[USB_ROOT_HUB_ADDR];
+
+   if (udev->refcount == USB_DEV_REF_MAX) {
+   mtx_unlock(_ref_lock);
+   continue;
+   }
+
+   udev->refcount++;
+   mtx_unlock(_ref_lock);
+
+   do_unlock = usbd_enum_lock(udev);
+   if (do_unlock > 1) {
+   do_unlock = 0;
+   goto next;
+   }
+
+   err = usbd_req_get_port_status(udev, NULL, , 1);
+   if (err != 0) {
+   DPRINTF("usbd_req_get_port_status() "
+   "failed: %s\n", usbd_errstr(err));
+   goto next;
+   }
+
+   if ((UGETW(ps.wPortStatus) & UPS_PORT_MODE_DEVICE) == 0)
+   goto next;
+
+   if (on_not_off) {
+   err = usbd_req_set_port_feature(udev, NULL, 1,
+   UHF_PORT_POWER);
+   if (err != 0) {
+   DPRINTF("usbd_req_set_port_feature() "
+   "failed: %s\n", usbd_errstr(err));
+   }
+   } else {
+   err = usbd_req_clear_port_feature(udev, NULL, 1,
+   UHF_PORT_POWER);
+   if (err != 0) {
+   DPRINTF("usbd_req_clear_port_feature() "
+   "failed: %s\n", usbd_errstr(err));
+   }
+   }
+
+next:
+   mtx_lock(_ref_lock);
+   if (do_unlock)
+   usbd_enum_unlock(udev);
+   if (--(udev->refcount) == 0)
+   cv_broadcast(>ref_cv);
+   mtx_unlock(_ref_lock);
+   }
+}
+
+/**
+ * usb_trigger_reprobe_all
+ *
+ * This function toggles the pull up resistors for all ports currently
+ * operating in device mode, causing the host machine to reenumerate them.
+ **/
+static void
+usb_trigger_reprobe_all(void)
+{
+
+   /*
+* Set the pull up resistors off for all ports in device mode.
+*/
+   usb_trigger_reprobe_on_off(0);
+
+   /*
+* According to the 

svn commit: r332603 - stable/11/usr.sbin/mptutil

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:24:36 2018
New Revision: 332603
URL: https://svnweb.freebsd.org/changeset/base/332603

Log:
  MFC r329845, r329872
  
  r329845:
  Fix numerous Coverity issues in mptutil
  
  Most are memory or file descriptor leaks. Three were unannotated
  fallthroughs in a switch/case statement. One was an integer overflow before
  widen.
  
  Reported by:  Coverity
  CID:  1007463 1007462 1007461 1007460 1007459 1007458 1007457
  CID:  1006855 1006854 1006853 1006852 1006851 1006850 1006849
  CID:  1006848 1006845 1006844 1006843 1006842 1006841 1006840
  CID:  1006839 1006838 1006837 1006836 1006835 1006834 1006833
  CID:  1006832 1006831 1006831 1006830 1006829 1008334 1008170
  CID:  1008169 1008168
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D11013
  
  r329872:
  Delete copypasta
  
  Reported by:  rpokala
  X-MFC-With:   329845
  Sponsored by: Spectra Logic Corp

Modified:
  stable/11/usr.sbin/mptutil/mpt_config.c
  stable/11/usr.sbin/mptutil/mpt_drive.c
  stable/11/usr.sbin/mptutil/mpt_evt.c
  stable/11/usr.sbin/mptutil/mpt_show.c
  stable/11/usr.sbin/mptutil/mpt_volume.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/mptutil/mpt_config.c
==
--- stable/11/usr.sbin/mptutil/mpt_config.c Mon Apr 16 16:23:32 2018
(r332602)
+++ stable/11/usr.sbin/mptutil/mpt_config.c Mon Apr 16 16:24:36 2018
(r332603)
@@ -65,12 +65,16 @@ dehumanize(const char *value)
 switch (vtp[0]) {
 case 't': case 'T':
 iv *= 1024;
+/* FALLTHROUGH */
 case 'g': case 'G':
 iv *= 1024;
+/* FALLTHROUGH */
 case 'm': case 'M':
 iv *= 1024;
+/* FALLTHROUGH */
 case 'k': case 'K':
 iv *= 1024;
+/* FALLTHROUGH */
 case '\0':
 break;
 default:
@@ -242,6 +246,7 @@ clear_config(int ac, char **av)
if (ioc2 == NULL) {
error = errno;
warn("Failed to fetch volume list");
+   close(fd);
return (error);
}
 
@@ -251,6 +256,8 @@ clear_config(int ac, char **av)
if (mpt_lock_volume(vol->VolumeBus, vol->VolumeID) < 0) {
warnx("Volume %s is busy and cannot be deleted",
mpt_volume_name(vol->VolumeBus, vol->VolumeID));
+   free(ioc2);
+   close(fd);
return (EBUSY);
}
}
@@ -261,6 +268,8 @@ clear_config(int ac, char **av)
ch = getchar();
if (ch != 'y' && ch != 'Y') {
printf("\nAborting\n");
+   free(ioc2);
+   close(fd);
return (0);
}
 
@@ -555,16 +564,16 @@ build_volume(int fd, struct volume_info *info, int rai
case RT_RAID0:
vol->VolumeType = MPI_RAID_VOL_TYPE_IS;
vol->StripeSize = stripe_size / 512;
-   MaxLBA = MinLBA * info->drive_count;
+   MaxLBA = (uint64_t)MinLBA * info->drive_count;
break;
case RT_RAID1:
vol->VolumeType = MPI_RAID_VOL_TYPE_IM;
-   MaxLBA = MinLBA * (info->drive_count / 2);
+   MaxLBA = (uint64_t)MinLBA * (info->drive_count / 2);
break;
case RT_RAID1E:
vol->VolumeType = MPI_RAID_VOL_TYPE_IME;
vol->StripeSize = stripe_size / 512;
-   MaxLBA = MinLBA * info->drive_count / 2;
+   MaxLBA = (uint64_t)MinLBA * info->drive_count / 2;
break;
default:
/* Pacify gcc. */
@@ -643,6 +652,7 @@ create_volume(int ac, char **av)
 
if (raid_type == -1) {
warnx("Unknown or unsupported volume type %s", av[1]);
+   close(fd);
return (EINVAL);
}
 
@@ -669,6 +679,7 @@ create_volume(int ac, char **av)
stripe_size = dehumanize(optarg);
if ((stripe_size < 512) || (!powerof2(stripe_size))) {
warnx("Invalid stripe size %s", optarg);
+   close(fd);
return (EINVAL);
}
break;
@@ -677,6 +688,7 @@ create_volume(int ac, char **av)
break;
case '?':
default:
+   close(fd);
return (EINVAL);
}
}
@@ -688,14 +700,18 @@ create_volume(int ac, char **av)
if (state.ioc2 == NULL) {
error = errno;
warn("Failed to read volume list");
+   close(fd);

svn commit: r332610 - in stable/10/usr.bin/tail: . tests

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:42:16 2018
New Revision: 332610
URL: https://svnweb.freebsd.org/changeset/base/332610

Log:
  MFC r329606:
  
  tail: fix "tail -r" for piped input that begins with '\n'
  
  A subtle logic bug, probably introduced in r311895, caused tail to print the
  first two lines of piped input in forward order, if the very first character
  was a newline.
  
  PR:   222671
  Reported by:  Jim Long , pproca...@gmail.com
  Sponsored by: Spectra Logic Corp

Modified:
  stable/10/usr.bin/tail/reverse.c
  stable/10/usr.bin/tail/tests/tail_test.sh
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/tail/reverse.c
==
--- stable/10/usr.bin/tail/reverse.cMon Apr 16 16:33:35 2018
(r332609)
+++ stable/10/usr.bin/tail/reverse.cMon Apr 16 16:42:16 2018
(r332610)
@@ -255,10 +255,13 @@ r_buf(FILE *fp, const char *fn)
if ((*p == '\n') || start) {
struct bfelem *tr;
 
-   if (start && llen)
+   if (llen && start && *p != '\n')
WR(p, llen + 1);
-   else if (llen)
+   else if (llen) {
WR(p + 1, llen);
+   if (start && *p == '\n')
+   WR(p, 1);
+   }
tr = TAILQ_NEXT(tl, entries);
llen = 0;
if (tr != NULL) {

Modified: stable/10/usr.bin/tail/tests/tail_test.sh
==
--- stable/10/usr.bin/tail/tests/tail_test.sh   Mon Apr 16 16:33:35 2018
(r332609)
+++ stable/10/usr.bin/tail/tests/tail_test.sh   Mon Apr 16 16:42:16 2018
(r332610)
@@ -83,6 +83,27 @@ HERE
atf_check cmp expectfile outpipe
 }
 
+# Regression test for PR 222671
+# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222671
+atf_test_case pipe_leading_newline_r
+pipe_leading_newline_r_head()
+{
+   atf_set "descr" "Reverse a pipe whose first character is a newline"
+}
+pipe_leading_newline_r_body()
+{
+   cat > expectfile << HERE
+3
+2
+1
+
+HERE
+   printf '\n1\n2\n3\n' | tail -r > outfile
+   printf '\n1\n2\n3\n' | tail -r > outpipe
+   atf_check cmp expectfile outfile
+   atf_check cmp expectfile outpipe
+}
+
 atf_test_case file_rc28
 file_rc28_head()
 {
@@ -105,6 +126,28 @@ HERE
atf_check cmp expectfile outpipe
 }
 
+atf_test_case file_rc28
+file_rc28_head()
+{
+   atf_set "descr" "Reverse a file and display the last 28 characters"
+}
+file_rc28_body()
+{
+   cat > infile < expectfile << HERE
+This is the third line
+line
+HERE
+   tail -rc28 infile > outfile
+   tail -rc28 < infile > outpipe
+   atf_check cmp expectfile outfile
+   atf_check cmp expectfile outpipe
+}
+
 atf_test_case longfile_r
 longfile_r_head()
 {
@@ -222,6 +265,7 @@ atf_init_test_cases()
atf_add_test_case file_r
atf_add_test_case file_rc28
atf_add_test_case file_rn2
+   atf_add_test_case pipe_leading_newline_r
# The longfile tests are designed to exercise behavior in r_buf(),
# which operates on 128KB blocks
atf_add_test_case longfile_r
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332619 - stable/11/sys/dev/iscsi

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:21:26 2018
New Revision: 332619
URL: https://svnweb.freebsd.org/changeset/base/332619

Log:
  MFC r330740:
  
  Check for duplicates when modifying an iSCSI session.  Previously we did
  this check on open, but "iscsictl -M", or an iSCSI redirect received by
  iscsid(8) could end up with two sessions with the same target name and
  portal.

Modified:
  stable/11/sys/dev/iscsi/iscsi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iscsi/iscsi.c
==
--- stable/11/sys/dev/iscsi/iscsi.c Mon Apr 16 17:18:06 2018
(r332618)
+++ stable/11/sys/dev/iscsi/iscsi.c Mon Apr 16 17:21:26 2018
(r332619)
@@ -1960,6 +1960,7 @@ iscsi_ioctl_session_modify(struct iscsi_softc *sc,
 struct iscsi_session_modify *ism)
 {
struct iscsi_session *is;
+   const struct iscsi_session *is2;
 
iscsi_sanitize_session_conf(>ism_conf);
if (iscsi_valid_session_conf(>ism_conf) == false)
@@ -1968,14 +1969,42 @@ iscsi_ioctl_session_modify(struct iscsi_softc *sc,
sx_xlock(>sc_lock);
TAILQ_FOREACH(is, >sc_sessions, is_next) {
ISCSI_SESSION_LOCK(is);
-   if (is->is_id == ism->ism_session_id)
+   if (is->is_id == ism->ism_session_id) {
+   /* Note that the session remains locked. */
break;
+   }
ISCSI_SESSION_UNLOCK(is);
}
if (is == NULL) {
sx_xunlock(>sc_lock);
return (ESRCH);
}
+
+   /*
+* Prevent duplicates.
+*/
+   TAILQ_FOREACH(is2, >sc_sessions, is_next) {
+   if (is == is2)
+   continue;
+
+   if (!!ism->ism_conf.isc_discovery !=
+   !!is2->is_conf.isc_discovery)
+   continue;
+
+   if (strcmp(ism->ism_conf.isc_target_addr,
+   is2->is_conf.isc_target_addr) != 0)
+   continue;
+
+   if (ism->ism_conf.isc_discovery == 0 &&
+   strcmp(ism->ism_conf.isc_target,
+   is2->is_conf.isc_target) != 0)
+   continue;
+
+   ISCSI_SESSION_UNLOCK(is);
+   sx_xunlock(>sc_lock);
+   return (EBUSY);
+   }
+
sx_xunlock(>sc_lock);
 
memcpy(>is_conf, >ism_conf, sizeof(is->is_conf));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332627 - stable/11/tools/tools/syscall_timing

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:29:50 2018
New Revision: 332627
URL: https://svnweb.freebsd.org/changeset/base/332627

Log:
  MFC r325318:
  
  Add benchmark for access(2).

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:28:59 2018(r332626)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:29:50 2018(r332627)
@@ -339,6 +339,28 @@ test_socketpair_dgram(uintmax_t num, uintmax_t int_arg
 }
 
 uintmax_t
+test_access(uintmax_t num, uintmax_t int_arg, const char *path)
+{
+   uintmax_t i;
+   int fd;
+
+   fd = access(path, O_RDONLY);
+   if (fd < 0)
+   err(-1, "test_access: %s", path);
+   close(fd);
+
+   benchmark_start();
+   for (i = 0; i < num; i++) {
+   if (alarm_fired)
+   break;
+   access(path, O_RDONLY);
+   close(fd);
+   }
+   benchmark_stop();
+   return (i);
+}
+
+uintmax_t
 test_create_unlink(uintmax_t num, uintmax_t int_arg, const char *path)
 {
uintmax_t i;
@@ -715,6 +737,7 @@ static const struct test tests[] = {
{ "socketpair_dgram", test_socketpair_dgram },
{ "socket_tcp", test_socket_stream, .t_int = PF_INET },
{ "socket_udp", test_socket_dgram, .t_int = PF_INET },
+   { "access", test_access, .t_flags = FLAG_PATH },
{ "create_unlink", test_create_unlink, .t_flags = FLAG_PATH },
{ "bad_open", test_bad_open },
{ "open_close", test_open_close, .t_flags = FLAG_PATH },
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: New study: the best & worst states at managing debt

2018-04-16 Thread Neha Chhabdiya
Hey there,

I’ve sent you a couple emails now and 1 of 2 things happened:

It went to spam
You’ve been busy

I totally get it, but I’d still love to hear from you when you get a chance :) 

Please let me know what you think of the results!

Thanks,
Neha

---

Neha Chhabdiya
Community Manager

p: 866-540-6005
e: n...@credible.com
w: credible.com

On Tue, Apr 10, 2018 at 5:42 PM, Neha Chhabdiya 
 wrote:

Hi there,

Just following up because I didn’t hear back from you. Do you have a quick 
minute to check out our report?

Here it is: https://www.credible.com/blog/best-worst-states-managing-debt/

I’m trying to spread the word and would love to share it with your audience.

If you're interested, I could even write a personalized introduction to pair 
with it for you.

What do you think of these survey results?

Thanks,
Neha



Community Manager
p: 866-540-6005
e: n...@credible.com
w: credible.com

On Fri, Apr 6, 2018 at 5:45 PM, Neha Chhabdiya 
 wrote:

Hi there,

Debt is a major issue many Americans face today and we wanted to find out where 
people are faring the worst. I wanted to share this new analysis from Credible 
because you’ve touched on debt in the past.

Here are a few highlights of the best and worst states at managing debt:

On average, people in Michigan have the least debt relative to the 
income they make
Hawaii has the highest average debt-to-income ratio of all states
On average, borrowers are paying nearly $1,500 on monthly credit card 
bills, student loan debt, and housing costs

I think it would be really interesting to see how your audience would respond 
to that.

Will you let me know what you think of this piece? :)

I can even send you a quick line of code to embed a map on your site if you’re 
interested.

Thanks,
Neha



Neha Chhabdiya
Community Manager

p: 866-540-6005
e: n...@credible.com
w: credible.comDon't want emails from us anymore? Reply to this email with the 
word "UNSUBSCRIBE" in the subject line.
Credible Labs Inc., 101 Green Street Level 2, San Francisco California, 94111, 
United States
Don't want emails from us anymore? Reply to this email with the 
word "UNSUBSCRIBE" in the subject line.
Credible Labs Inc., 101 Green Street Level 2, San Francisco California, 94111, 
United States
Don't want emails from us anymore? Reply to this email with the 
word "UNSUBSCRIBE" in the subject line.
Credible Labs Inc., 101 Green Street Level 2, San Francisco California, 94111, 
United States

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


svn commit: r332629 - head/sys/mips/mips

2018-04-16 Thread Brooks Davis
Author: brooks
Date: Mon Apr 16 17:43:26 2018
New Revision: 332629
URL: https://svnweb.freebsd.org/changeset/base/332629

Log:
  Remove unused badaddr() function.
  
  Reviewed by:  jmallett
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D15078

Modified:
  head/sys/mips/mips/support.S

Modified: head/sys/mips/mips/support.S
==
--- head/sys/mips/mips/support.SMon Apr 16 17:30:33 2018
(r332628)
+++ head/sys/mips/mips/support.SMon Apr 16 17:43:26 2018
(r332629)
@@ -105,38 +105,6 @@
.text
 
 /*
- * See if access to addr with a len type instruction causes a machine check.
- * len is length of access (1=byte, 2=short, 4=int)
- *
- * badaddr(addr, len)
- * char *addr;
- * int len;
- */
-LEAF(badaddr)
-   PTR_LA  v0, baderr
-   GET_CPU_PCPU(v1)
-   PTR_L   v1, PC_CURPCB(v1)
-   bne a1, 1, 2f
-   PTR_S   v0, U_PCB_ONFAULT(v1)
-   b   5f
-   lbu v0, (a0)
-2:
-   bne a1, 2, 4f
-   nop
-   b   5f
-   lhu v0, (a0)
-4:
-   lw  v0, (a0)
-5:
-   PTR_S   zero, U_PCB_ONFAULT(v1)
-   j   ra
-   movev0, zero# made it w/o errors
-baderr:
-   j   ra
-   li  v0, 1   # trap sends us here
-END(badaddr)
-
-/*
  * int copystr(void *kfaddr, void *kdaddr, size_t maxlen, size_t *lencopied)
  * Copy a NIL-terminated string, at most maxlen characters long.  Return the
  * number of characters copied (including the NIL) in *lencopied.  If the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332599 - stable/11/share/man/man4

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:20:21 2018
New Revision: 332599
URL: https://svnweb.freebsd.org/changeset/base/332599

Log:
  MFC r328590:
  
  Document the new hw.usb.template behaviour.

Modified:
  stable/11/share/man/man4/usb_template.4
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/usb_template.4
==
--- stable/11/share/man/man4/usb_template.4 Mon Apr 16 16:19:31 2018
(r332598)
+++ stable/11/share/man/man4/usb_template.4 Mon Apr 16 16:20:21 2018
(r332599)
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 8, 2016
+.Dd January 30, 2018
 .Dt USB_TEMPLATE 4
 .Os
 .
@@ -66,9 +66,11 @@ or by using the
 .Xr usbconfig 8
 .Cm set_template
 subcommand.
-The sysctl values can be changed at any time, but will not
-have any effect until the USB device has been re-enumerated.
-.
+Changing the
+.Va hw.usb.template
+sysctl triggers reenumeration by the USB host; changes to other sysctls
+may not be visible to the host until reenumeration is performed.
+.Pp
 Available templates are:
 .Bl -column -offset 3n "Value"
 .It Em Value Ta Em Description
@@ -93,6 +95,7 @@ tunables:
 .Bl -tag -width indent
 .It Va hw.usb.template
 Currently selected template.
+Set to -1 to make the device disappear from the USB host point of view.
 .It Va hw.usb.templates.N
 Configuration for template number
 .Va N .
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332600 - in stable/11/usr.bin/tail: . tests

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:20:39 2018
New Revision: 332600
URL: https://svnweb.freebsd.org/changeset/base/332600

Log:
  MFC r329606:
  
  tail: fix "tail -r" for piped input that begins with '\n'
  
  A subtle logic bug, probably introduced in r311895, caused tail to print the
  first two lines of piped input in forward order, if the very first character
  was a newline.
  
  PR:   222671
  Reported by:  Jim Long , pproca...@gmail.com
  Sponsored by: Spectra Logic Corp

Modified:
  stable/11/usr.bin/tail/reverse.c
  stable/11/usr.bin/tail/tests/tail_test.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/tail/reverse.c
==
--- stable/11/usr.bin/tail/reverse.cMon Apr 16 16:20:21 2018
(r332599)
+++ stable/11/usr.bin/tail/reverse.cMon Apr 16 16:20:39 2018
(r332600)
@@ -255,10 +255,13 @@ r_buf(FILE *fp, const char *fn)
if ((*p == '\n') || start) {
struct bfelem *tr;
 
-   if (start && llen)
+   if (llen && start && *p != '\n')
WR(p, llen + 1);
-   else if (llen)
+   else if (llen) {
WR(p + 1, llen);
+   if (start && *p == '\n')
+   WR(p, 1);
+   }
tr = TAILQ_NEXT(tl, entries);
llen = 0;
if (tr != NULL) {

Modified: stable/11/usr.bin/tail/tests/tail_test.sh
==
--- stable/11/usr.bin/tail/tests/tail_test.sh   Mon Apr 16 16:20:21 2018
(r332599)
+++ stable/11/usr.bin/tail/tests/tail_test.sh   Mon Apr 16 16:20:39 2018
(r332600)
@@ -83,6 +83,27 @@ HERE
atf_check cmp expectfile outpipe
 }
 
+# Regression test for PR 222671
+# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222671
+atf_test_case pipe_leading_newline_r
+pipe_leading_newline_r_head()
+{
+   atf_set "descr" "Reverse a pipe whose first character is a newline"
+}
+pipe_leading_newline_r_body()
+{
+   cat > expectfile << HERE
+3
+2
+1
+
+HERE
+   printf '\n1\n2\n3\n' | tail -r > outfile
+   printf '\n1\n2\n3\n' | tail -r > outpipe
+   atf_check cmp expectfile outfile
+   atf_check cmp expectfile outpipe
+}
+
 atf_test_case file_rc28
 file_rc28_head()
 {
@@ -105,6 +126,28 @@ HERE
atf_check cmp expectfile outpipe
 }
 
+atf_test_case file_rc28
+file_rc28_head()
+{
+   atf_set "descr" "Reverse a file and display the last 28 characters"
+}
+file_rc28_body()
+{
+   cat > infile < expectfile << HERE
+This is the third line
+line
+HERE
+   tail -rc28 infile > outfile
+   tail -rc28 < infile > outpipe
+   atf_check cmp expectfile outfile
+   atf_check cmp expectfile outpipe
+}
+
 atf_test_case longfile_r
 longfile_r_head()
 {
@@ -222,6 +265,7 @@ atf_init_test_cases()
atf_add_test_case file_r
atf_add_test_case file_rc28
atf_add_test_case file_rn2
+   atf_add_test_case pipe_leading_newline_r
# The longfile tests are designed to exercise behavior in r_buf(),
# which operates on 128KB blocks
atf_add_test_case longfile_r
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332608 - in stable/11: etc/mtree libexec/tftpd libexec/tftpd/tests

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:32:00 2018
New Revision: 332608
URL: https://svnweb.freebsd.org/changeset/base/332608

Log:
  MFC r330696, r330709, r330742, r331358
  
  r330696:
  Add some functional tests for tftpd(8)
  
  tftpd(8) is difficult to test in isolation due to its relationship with
  inetd.  Create a test program that mimics the behavior of tftp(1) and
  inetd(8) and verifies tftpd's response in several different scenarios.
  
  These test cases cover all of the basic TFTP protocol, but not the optional
  parts.
  
  PR:   157700
  PR:   225996
  PR:   226004
  PR:   226005
  Differential Revision:https://reviews.freebsd.org/D14310
  
  r330709:
  Commit missing file from r330696
  
  X-MFC-With:   330696
  
  r330742:
  tftpd: fix the build of tests on i386 after 330696
  
  It's those darn printf format specifiers again
  
  Reported by:  cy, kibab
  X-MFC-With:   330696
  
  r331358:
  tftpd: misc Coverity cleanup in the tests
  
  A bunch of unchecked return values from open(2) and read(2)
  
  Reported by:  Coverity
  CID:  1386900, 1386911, 1386926, 1386928, 1386932, 1386942
  CID:  1386961, 1386979
  X-MFC-With:   330696

Added:
  stable/11/libexec/tftpd/tests/
 - copied from r330696, head/libexec/tftpd/tests/
Modified:
  stable/11/etc/mtree/BSD.tests.dist
  stable/11/libexec/tftpd/Makefile
  stable/11/libexec/tftpd/tests/functional.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/mtree/BSD.tests.dist
==
--- stable/11/etc/mtree/BSD.tests.dist  Mon Apr 16 16:29:48 2018
(r332607)
+++ stable/11/etc/mtree/BSD.tests.dist  Mon Apr 16 16:32:00 2018
(r332608)
@@ -376,6 +376,8 @@
 ..
 rtld-elf
 ..
+tftpd
+..
 ..
 sbin
 dhclient

Modified: stable/11/libexec/tftpd/Makefile
==
--- stable/11/libexec/tftpd/MakefileMon Apr 16 16:29:48 2018
(r332607)
+++ stable/11/libexec/tftpd/MakefileMon Apr 16 16:32:00 2018
(r332608)
@@ -14,4 +14,7 @@ CFLAGS+=  -DLIBWRAP
 LIBADD=wrap
 .endif
 
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
+
 .include 

Modified: stable/11/libexec/tftpd/tests/functional.c
==
--- head/libexec/tftpd/tests/functional.c   Fri Mar  9 15:30:20 2018
(r330696)
+++ stable/11/libexec/tftpd/tests/functional.c  Mon Apr 16 16:32:00 2018
(r332608)
@@ -224,19 +224,17 @@ do { \
 static void
 cleanup(void)
 {
-   int fd = -1;
-   char buffer[80] = {0};
+   FILE *f;
pid_t pid;
 
-   fd = open(pidfile, O_RDONLY);
-   if (fd < 0)
+   f = fopen(pidfile, "r");
+   if (f == NULL)
return;
-   if (read(fd, buffer, sizeof(buffer)) > 0) {
-   sscanf(buffer, "%d", );
+   if (fscanf(f, "%d", ) == 1) {
kill(pid, SIGTERM);
waitpid(pid, NULL, 0);
}
-   close(fd);
+   fclose(f);
unlink(pidfile);
 }
 
@@ -248,10 +246,10 @@ require_bufeq(const char *expected, ssize_t expected_l
ssize_t i;
 
ATF_REQUIRE_EQ_MSG(expected_len, len,
-   "Expected %ld bytes but got %ld", expected_len, len);
+   "Expected %zd bytes but got %zd", expected_len, len);
for (i = 0; i < len; i++) {
ATF_REQUIRE_EQ_MSG(actual[i], expected[i],
-   "Expected %#hhx at position %ld; got %hhx instead",
+   "Expected %#hhx at position %zd; got %hhx instead",
expected[i], i, actual[i]);
}
 }
@@ -696,6 +694,7 @@ TFTPD_TC_DEFINE(w_flag,, w_flag = 1;)
 
atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("small.txt", O_RDONLY);
+   ATF_REQUIRE(fd >= 0);
r = read(fd, buffer, sizeof(buffer));
close(fd);
require_bufeq(contents, contents_len, buffer, r);
@@ -733,6 +732,7 @@ TFTPD_TC_DEFINE(wrq_dropped_ack,)
 
atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("medium.txt", O_RDONLY);
+   ATF_REQUIRE(fd >= 0);
r = read(fd, buffer, sizeof(buffer));
close(fd);
require_bufeq((const char*)contents, 768, buffer, r);
@@ -766,6 +766,7 @@ TFTPD_TC_DEFINE(wrq_dropped_data,)
 
atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("small.txt", O_RDONLY);
+   ATF_REQUIRE(fd >= 0);
r = read(fd, buffer, sizeof(buffer));
close(fd);
require_bufeq(contents, contents_len, buffer, r);
@@ -800,6 +801,7 @@ TFTPD_TC_DEFINE(wrq_duped_data,)
 
atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("medium.txt", O_RDONLY);
+   ATF_REQUIRE(fd >= 0);
r = 

svn commit: r332620 - stable/11/usr.bin/iscsictl

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:22:09 2018
New Revision: 332620
URL: https://svnweb.freebsd.org/changeset/base/332620

Log:
  MFC r330741:
  
  Make iscsictl(1) display "Disabled" status for disabled sessions.

Modified:
  stable/11/usr.bin/iscsictl/iscsictl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/iscsictl/iscsictl.c
==
--- stable/11/usr.bin/iscsictl/iscsictl.c   Mon Apr 16 17:21:26 2018
(r332619)
+++ stable/11/usr.bin/iscsictl/iscsictl.c   Mon Apr 16 17:22:09 2018
(r332620)
@@ -601,7 +601,8 @@ kernel_list(int iscsi_fd, const struct target *targ __
xo_emit("{V:name/%-36s/%s} {V:portal/%-16s/%s} ",
conf->isc_target, conf->isc_target_addr);
 
-   if (state->iss_reason[0] != '\0') {
+   if (state->iss_reason[0] != '\0' &&
+   conf->isc_enable != 0) {
xo_emit("{V:state/%s}\n", state->iss_reason);
} else {
if (conf->isc_discovery) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332621 - stable/11/sys/dev/iscsi

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:22:51 2018
New Revision: 332621
URL: https://svnweb.freebsd.org/changeset/base/332621

Log:
  MFC r330937:
  
  Fix typo in a warning message.

Modified:
  stable/11/sys/dev/iscsi/iscsi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iscsi/iscsi.c
==
--- stable/11/sys/dev/iscsi/iscsi.c Mon Apr 16 17:22:09 2018
(r332620)
+++ stable/11/sys/dev/iscsi/iscsi.c Mon Apr 16 17:22:51 2018
(r332621)
@@ -1279,10 +1279,10 @@ iscsi_pdu_handle_async_message(struct icl_pdu *respons
iscsi_session_terminate(is);
break;
case BHSAM_EVENT_TARGET_TERMINATES_CONNECTION:
-   ISCSI_SESSION_WARN(is, "target indicates it will drop drop the 
connection");
+   ISCSI_SESSION_WARN(is, "target indicates it will drop the 
connection");
break;
case BHSAM_EVENT_TARGET_TERMINATES_SESSION:
-   ISCSI_SESSION_WARN(is, "target indicates it will drop drop the 
session");
+   ISCSI_SESSION_WARN(is, "target indicates it will drop the 
session");
break;
default:
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332628 - stable/11/tools/tools/syscall_timing

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:30:33 2018
New Revision: 332628
URL: https://svnweb.freebsd.org/changeset/base/332628

Log:
  MFC r325313:
  
  Make syscall_timing(1) default to a temporary file when run without -p.

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:29:50 2018(r332627)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:30:33 2018(r332628)
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -792,15 +793,17 @@ main(int argc, char *argv[])
struct timespec ts_res;
const struct test *the_test;
const char *path;
+   char *tmp_dir, *tmp_path;
long long ll;
char *endp;
-   int ch, error, i, j, k;
+   int ch, fd, error, i, j, k, rv;
uintmax_t iterations, loops;
 
alarm_timeout = 1;
iterations = 0;
loops = 10;
path = NULL;
+   tmp_path = NULL;
while ((ch = getopt(argc, argv, "i:l:p:s:")) != -1) {
switch (ch) {
case 'i':
@@ -859,7 +862,15 @@ main(int argc, char *argv[])
if (the_test == NULL)
usage();
if ((the_test->t_flags & FLAG_PATH) && (path == NULL)) {
-   errx(-1, "%s requires -p", the_test->t_name);
+   tmp_dir = strdup("/tmp/syscall_timing.");
+   if (tmp_dir == NULL)
+   err(1, "strdup");
+   tmp_dir = mkdtemp(tmp_dir);
+   if (tmp_dir == NULL)
+   err(1, "mkdtemp");
+   rv = asprintf(_path, "%s/testfile", tmp_dir);
+   if (rv <= 0)
+   err(1, "asprintf");
}
}
 
@@ -878,6 +889,19 @@ main(int argc, char *argv[])
the_test = [i];
}
 
+   if (tmp_path != NULL) {
+   fd = open(tmp_path, O_WRONLY | O_CREAT, 0700);
+   if (fd < 0)
+   err(1, "cannot open %s", tmp_path);
+   error = ftruncate(fd, 100);
+   if (error != 0)
+   err(1, "ftruncate");
+   error = close(fd);
+   if (error != 0)
+   err(1, "close");
+   path = tmp_path;
+   }
+
/*
 * Run one warmup, then do the real thing (loops) times.
 */
@@ -903,5 +927,15 @@ main(int argc, char *argv[])
printf("0.%09ju\n", (uintmax_t)nsecsperit);
}
}
+
+   if (tmp_path != NULL) {
+   error = unlink(tmp_path);
+   if (error != 0 && errno != ENOENT)
+   warn("cannot unlink %s", tmp_path);
+   error = rmdir(tmp_dir);
+   if (error != 0)
+   warn("cannot rmdir %s", tmp_dir);
+   }
+
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332597 - stable/11/usr.sbin/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:16:24 2018
New Revision: 332597
URL: https://svnweb.freebsd.org/changeset/base/332597

Log:
  MFC r328338:
  
  Add SPDX tags for automount(8) et al.

Modified:
  stable/11/usr.sbin/autofs/automount.c
  stable/11/usr.sbin/autofs/automountd.c
  stable/11/usr.sbin/autofs/autounmountd.c
  stable/11/usr.sbin/autofs/common.c
  stable/11/usr.sbin/autofs/common.h
  stable/11/usr.sbin/autofs/defined.c
  stable/11/usr.sbin/autofs/log.c
  stable/11/usr.sbin/autofs/popen.c
  stable/11/usr.sbin/autofs/token.l
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/autofs/automount.c
==
--- stable/11/usr.sbin/autofs/automount.c   Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/automount.c   Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/automountd.c
==
--- stable/11/usr.sbin/autofs/automountd.c  Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/automountd.c  Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/autounmountd.c
==
--- stable/11/usr.sbin/autofs/autounmountd.cMon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/autounmountd.cMon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/common.c
==
--- stable/11/usr.sbin/autofs/common.c  Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/common.c  Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/common.h
==
--- stable/11/usr.sbin/autofs/common.h  Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/common.h  Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/defined.c
==
--- stable/11/usr.sbin/autofs/defined.c Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/defined.c Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/log.c
==
--- stable/11/usr.sbin/autofs/log.c Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/log.c Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2012 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/autofs/popen.c
==
--- stable/11/usr.sbin/autofs/popen.c   Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/popen.c   Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,4 +1,6 @@
 /*
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
  * Copyright (c) 1988, 1993
  * The Regents of the University of California.  All rights reserved.
  * Copyright (c) 2014 The FreeBSD Foundation

Modified: stable/11/usr.sbin/autofs/token.l
==
--- stable/11/usr.sbin/autofs/token.l   Mon Apr 16 16:15:31 2018
(r332596)
+++ stable/11/usr.sbin/autofs/token.l   Mon Apr 16 16:16:24 2018
(r332597)
@@ -1,5 +1,7 @@
 %{
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332601 - stable/11/sys/dev/iscsi

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:22:00 2018
New Revision: 332601
URL: https://svnweb.freebsd.org/changeset/base/332601

Log:
  MFC r328341:
  
  Add SPDX tags to iscsi(4).

Modified:
  stable/11/sys/dev/iscsi/icl_conn_if.m
  stable/11/sys/dev/iscsi/icl_soft.c
  stable/11/sys/dev/iscsi/icl_wrappers.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iscsi/icl_conn_if.m
==
--- stable/11/sys/dev/iscsi/icl_conn_if.m   Mon Apr 16 16:20:39 2018
(r332600)
+++ stable/11/sys/dev/iscsi/icl_conn_if.m   Mon Apr 16 16:22:00 2018
(r332601)
@@ -1,4 +1,6 @@
 #-
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
 # Copyright (c) 2014 The FreeBSD Foundation
 # All rights reserved.
 #

Modified: stable/11/sys/dev/iscsi/icl_soft.c
==
--- stable/11/sys/dev/iscsi/icl_soft.c  Mon Apr 16 16:20:39 2018
(r332600)
+++ stable/11/sys/dev/iscsi/icl_soft.c  Mon Apr 16 16:22:00 2018
(r332601)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2012 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/sys/dev/iscsi/icl_wrappers.h
==
--- stable/11/sys/dev/iscsi/icl_wrappers.h  Mon Apr 16 16:20:39 2018
(r332600)
+++ stable/11/sys/dev/iscsi/icl_wrappers.h  Mon Apr 16 16:22:00 2018
(r332601)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332607 - stable/11/share/man/man9

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:29:48 2018
New Revision: 332607
URL: https://svnweb.freebsd.org/changeset/base/332607

Log:
  MFC r330627:
  
  g_bio(9): fix a documentation oversight from r163870

Modified:
  stable/11/share/man/man9/g_bio.9
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/g_bio.9
==
--- stable/11/share/man/man9/g_bio.9Mon Apr 16 16:28:23 2018
(r332606)
+++ stable/11/share/man/man9/g_bio.9Mon Apr 16 16:29:48 2018
(r332607)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 17, 2016
+.Dd Mar 7, 2018
 .Dt G_BIO 9
 .Os
 .Sh NAME
@@ -59,7 +59,7 @@ most important fields are described below:
 .Bl -tag -width ".Va bio_attribute"
 .It Va bio_cmd
 I/O request command.
-There are four I/O requests available in GEOM:
+There are five I/O requests available in GEOM:
 .Bl -tag -width ".Dv BIO_GETATTR"
 .It Dv BIO_READ
 A read request.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332605 - stable/11/libexec/rpc.sprayd

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:27:08 2018
New Revision: 332605
URL: https://svnweb.freebsd.org/changeset/base/332605

Log:
  MFC r330514:
  
  rpc.sprayd: raise WARNS to 6

Modified:
  stable/11/libexec/rpc.sprayd/Makefile
  stable/11/libexec/rpc.sprayd/sprayd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rpc.sprayd/Makefile
==
--- stable/11/libexec/rpc.sprayd/Makefile   Mon Apr 16 16:25:42 2018
(r332604)
+++ stable/11/libexec/rpc.sprayd/Makefile   Mon Apr 16 16:27:08 2018
(r332605)
@@ -6,6 +6,4 @@ MAN =   rpc.sprayd.8
 
 LIBADD=rpcsvc
 
-WARNS?=2
-
 .include 

Modified: stable/11/libexec/rpc.sprayd/sprayd.c
==
--- stable/11/libexec/rpc.sprayd/sprayd.c   Mon Apr 16 16:25:42 2018
(r332604)
+++ stable/11/libexec/rpc.sprayd/sprayd.c   Mon Apr 16 16:27:08 2018
(r332605)
@@ -61,21 +61,21 @@ static int from_inetd = 1;
 
 #define TIMEOUT 120
 
-void
+static void
 cleanup(int sig __unused)
 {
(void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL);
exit(0);
 }
 
-void
+static void
 die(int sig __unused)
 {
exit(0);
 }
 
 int
-main(int argc, char *argv[])
+main(int argc __unused, char *argv[] __unused)
 {
SVCXPRT *transp;
int ok;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332609 - in stable/11: libexec/tftpd libexec/tftpd/tests usr.bin/tftp

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:33:35 2018
New Revision: 332609
URL: https://svnweb.freebsd.org/changeset/base/332609

Log:
  MFC r330710, r330718-r330720
  
  r330710:
  tftpd: Flush files as soon as they are fully received
  
  On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file.
  Instead, it waits five seconds just in case the client didn't receive the
  server's last ACK and decides to resend the final DATA packet.
  Unfortunately, this created a 5 second delay from when the client thinks
  it's done sending the file, and when the file is available for other
  processes.
  
  Fix this bug by closing the file as soon as receipt is finished.
  
  PR:   157700
  Reported by:  Barry Mishler 
  
  r330718:
  tftpd: Verify world-writability for WRQ when using relative paths
  
  tftpd(8) says that files may only be written if they already exist and are
  publicly writable.  tftpd.c verifies that a file is publicly writable if it
  uses an absolute pathname.  However, if the pathname is relative, that check
  is skipped.  Fix it.
  
  Note that this is not a security vulnerability, because the transfer
  ultimately doesn't work unless the file already exists and is owned by user
  nobody.  Also, this bug does not affect the default configuration, because
  the default uses the "-s" option which makes all pathnames absolute.
  
  PR:   226004
  
  r330719:
  tftpd: Abort on an WRQ access violation
  
  On a WRQ (write request) tftpd checks whether the client has access
  permission for the file in question.  If not, then the write is prevented.
  However, tftpd doesn't reply with an ERROR packet, nor does it abort.
  Instead, it tries to receive the packet anyway.
  
  The symptom is slightly different depending on the nature of the error.  If
  the target file is nonexistent and tftpd lacks permission to create it, then
  tftpd will willingly receive the file, but not write it anywhere.  If the
  file exists but is not writable, then tftpd will fail to ACK to WRQ.
  
  PR:   225996
  
  r330720:
  tftpd: reject unknown opcodes
  
  If tftpd receives a command with an unknown opcode, it simply exits 1.  It
  doesn't send an ERROR packet, and the client will hang waiting for one.  Fix
  it.
  
  PR:   226005

Modified:
  stable/11/libexec/tftpd/tests/functional.c
  stable/11/libexec/tftpd/tftp-transfer.c
  stable/11/libexec/tftpd/tftpd.c
  stable/11/usr.bin/tftp/tftp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/tftpd/tests/functional.c
==
--- stable/11/libexec/tftpd/tests/functional.c  Mon Apr 16 16:32:00 2018
(r332608)
+++ stable/11/libexec/tftpd/tests/functional.c  Mon Apr 16 16:33:35 2018
(r332609)
@@ -348,6 +348,10 @@ setup(struct sockaddr_storage *to, uint16_t idx)
ATF_REQUIRE((client_s = socket(protocol, SOCK_DGRAM, 0)) > 0);
break;
}
+
+   /* Clear the client's umask.  Test cases will specify exact modes */
+   umask();
+
return (client_s);
 }
 
@@ -671,7 +675,6 @@ TFTPD_TC_DEFINE(unknown_opcode,)
 {
/* Looks like an RRQ or WRQ request, but with a bad opcode */
SEND_STR("\0\007foo.txt\0octet\0");
-   atf_tc_expect_timeout("PR 226005 tftpd ignores bad opcodes but doesn't 
reject them");
RECV_ERROR(4, "Illegal TFTP operation");
 }
 
@@ -692,7 +695,6 @@ TFTPD_TC_DEFINE(w_flag,, w_flag = 1;)
send_data(1, contents, contents_len);
recv_ack(1);
 
-   atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("small.txt", O_RDONLY);
ATF_REQUIRE(fd >= 0);
r = read(fd, buffer, sizeof(buffer));
@@ -714,7 +716,7 @@ TFTPD_TC_DEFINE(wrq_dropped_ack,)
for (i = 0; i < nitems(contents); i++)
contents[i] = i;
 
-   fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
+   fd = open("medium.txt", O_RDWR | O_CREAT, 0666);
ATF_REQUIRE(fd >= 0);
close(fd);
 
@@ -730,7 +732,6 @@ TFTPD_TC_DEFINE(wrq_dropped_ack,)
send_data(2, (const char*)[128], 256);
recv_ack(2);
 
-   atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("medium.txt", O_RDONLY);
ATF_REQUIRE(fd >= 0);
r = read(fd, buffer, sizeof(buffer));
@@ -749,7 +750,7 @@ TFTPD_TC_DEFINE(wrq_dropped_data,)
size_t contents_len;
char buffer[1024];
 
-   fd = open("small.txt", O_RDWR | O_CREAT, 0644);
+   fd = open("small.txt", O_RDWR | O_CREAT, 0666);
ATF_REQUIRE(fd >= 0);
close(fd);
contents_len = strlen(contents) + 1;
@@ -764,7 +765,6 @@ TFTPD_TC_DEFINE(wrq_dropped_data,)
send_data(1, contents, contents_len);
recv_ack(1);
 
-   atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF");
fd = open("small.txt", 

svn commit: r332611 - stable/11/share/man/man5

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:06:18 2018
New Revision: 332611
URL: https://svnweb.freebsd.org/changeset/base/332611

Log:
  MFC r326471:
  
  Document autofs(6) sysctl variables.
  
  PR:   219414

Modified:
  stable/11/share/man/man5/autofs.5
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man5/autofs.5
==
--- stable/11/share/man/man5/autofs.5   Mon Apr 16 16:42:16 2018
(r332610)
+++ stable/11/share/man/man5/autofs.5   Mon Apr 16 17:06:18 2018
(r332611)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 3, 2014
+.Dd December 2, 2017
 .Dt AUTOFS 5
 .Os
 .Sh NAME
@@ -67,6 +67,45 @@ file systems:
 Mount options for all filesystems specified in the map entry.
 .It Cm master_prefix
 Filesystem mountpoint prefix.
+.El
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width indent
+.It Va vfs.autofs.debug
+Verbosity level for log messages from the
+.Nm
+driver.
+Set to 0 to disable logging or 1 to warn about potential problems.
+Larger values enable debugging output.
+Defaults to 1.
+.It Va vfs.autofs.interruptible
+Set to 1 to allow mount requests to be interrupted by signal.
+Defaults to 1.
+.It Va vfs.autofs.retry_delay
+Number of seconds before retrying mount requests.
+Defaults to 1.
+.It Va vfs.autofs.retry_attempts
+Number of attempts before failing mount.
+Defaults to 3.
+.It Va vfs.autofs.cache
+Number of seconds to wait before reinvoking
+.Xr automountd 8
+for any given file or directory.
+Defaults to 600.
+.It Va vfs.autofs.timeout
+Number of seconds to wait for
+.Xr automountd 8
+to handle the mount request.
+Defaults to 30.
+.It Va vfs.autofs.mount_on_stat
+Set to 1 to trigger mount on
+.Xr stat 2
+on mountpoint.
+Defaults to 0.
 .El
 .Sh EXAMPLES
 To unmount all mounted
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332613 - stable/11/sys/fs/nullfs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:12:18 2018
New Revision: 332613
URL: https://svnweb.freebsd.org/changeset/base/332613

Log:
  MFC r32:
  
  Make nullfs properly report MNT_AUTOMOUNTED set on the nullfs mount itself,
  instead of copying from the underlying filesystem.
  
  PR:   224851

Modified:
  stable/11/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nullfs/null_vfsops.c
==
--- stable/11/sys/fs/nullfs/null_vfsops.c   Mon Apr 16 17:08:58 2018
(r332612)
+++ stable/11/sys/fs/nullfs/null_vfsops.c   Mon Apr 16 17:12:18 2018
(r332613)
@@ -318,7 +318,8 @@ nullfs_statfs(mp, sbp)
/* now copy across the "interesting" information and fake the rest */
sbp->f_type = mstat->f_type;
sbp->f_flags = (sbp->f_flags & (MNT_RDONLY | MNT_NOEXEC | MNT_NOSUID |
-   MNT_UNION | MNT_NOSYMFOLLOW)) | (mstat->f_flags & ~MNT_ROOTFS);
+   MNT_UNION | MNT_NOSYMFOLLOW | MNT_AUTOMOUNTED)) |
+   (mstat->f_flags & ~(MNT_ROOTFS | MNT_AUTOMOUNTED));
sbp->f_bsize = mstat->f_bsize;
sbp->f_iosize = mstat->f_iosize;
sbp->f_blocks = mstat->f_blocks;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332617 - in stable/11/sys: amd64/linux dev/usb/storage

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:15:26 2018
New Revision: 332617
URL: https://svnweb.freebsd.org/changeset/base/332617

Log:
  MFC r328342:
  
  Add SPDX identifiers to linux_ptrace.c and cfumass.c.

Modified:
  stable/11/sys/amd64/linux/linux_ptrace.c
  stable/11/sys/dev/usb/storage/cfumass.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/linux/linux_ptrace.c
==
--- stable/11/sys/amd64/linux/linux_ptrace.cMon Apr 16 17:14:42 2018
(r332616)
+++ stable/11/sys/amd64/linux/linux_ptrace.cMon Apr 16 17:15:26 2018
(r332617)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2017 Edward Tomasz Napierala 
  * All rights reserved.
  *

Modified: stable/11/sys/dev/usb/storage/cfumass.c
==
--- stable/11/sys/dev/usb/storage/cfumass.c Mon Apr 16 17:14:42 2018
(r332616)
+++ stable/11/sys/dev/usb/storage/cfumass.c Mon Apr 16 17:15:26 2018
(r332617)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2016 The FreeBSD Foundation
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332616 - stable/11/usr.sbin/iscsid

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:14:42 2018
New Revision: 332616
URL: https://svnweb.freebsd.org/changeset/base/332616

Log:
  MFC r328336:
  
  Add missing SPDX identifier in iscsid(8).

Modified:
  stable/11/usr.sbin/iscsid/chap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/iscsid/chap.c
==
--- stable/11/usr.sbin/iscsid/chap.cMon Apr 16 17:13:54 2018
(r332615)
+++ stable/11/usr.sbin/iscsid/chap.cMon Apr 16 17:14:42 2018
(r332616)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332622 - stable/11/sys/cam/ctl

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:24:33 2018
New Revision: 332622
URL: https://svnweb.freebsd.org/changeset/base/332622

Log:
  MFC r331013:
  
  Fix iSCSI target crash on session reinstation.
  
  The crash scenario goes like this: there's a thread waiting on "reinstate";
  because it doesn't update the timeout counter it gets terminated by the
  callout; at this point the maintenance thread starts the termination routine.
  The first thread finishes waiting, proceeds to icl_conn_handoff(), and drops
  the refcount, which allows the maintenance thread to free its resources.  At
  this point another thread receives a PDU.  Boom.
  
  PR:   222898, 219866
  Sponsored by: playkey.net

Modified:
  stable/11/sys/cam/ctl/ctl_frontend_iscsi.c
  stable/11/sys/cam/ctl/ctl_frontend_iscsi.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- stable/11/sys/cam/ctl/ctl_frontend_iscsi.c  Mon Apr 16 17:22:51 2018
(r332621)
+++ stable/11/sys/cam/ctl/ctl_frontend_iscsi.c  Mon Apr 16 17:24:33 2018
(r332622)
@@ -1162,11 +1162,11 @@ cfiscsi_maintenance_thread(void *arg)
 
for (;;) {
CFISCSI_SESSION_LOCK(cs);
-   if (cs->cs_terminating == false)
+   if (cs->cs_terminating == false || cs->cs_handoff_in_progress)
cv_wait(>cs_maintenance_cv, >cs_lock);
CFISCSI_SESSION_UNLOCK(cs);
 
-   if (cs->cs_terminating) {
+   if (cs->cs_terminating && cs->cs_handoff_in_progress == false) {
 
/*
 * We used to wait up to 30 seconds to deliver queued
@@ -1194,8 +1194,6 @@ static void
 cfiscsi_session_terminate(struct cfiscsi_session *cs)
 {
 
-   if (cs->cs_terminating)
-   return;
cs->cs_terminating = true;
cv_signal(>cs_maintenance_cv);
 #ifdef ICL_KERNEL_PROXY
@@ -1266,6 +1264,13 @@ cfiscsi_session_new(struct cfiscsi_softc *softc, const
cv_init(>cs_login_cv, "cfiscsi_login");
 #endif
 
+   /*
+* The purpose of this is to avoid racing with session shutdown.
+* Otherwise we could have the maintenance thread call icl_conn_close()
+* before we call icl_conn_handoff().
+*/
+   cs->cs_handoff_in_progress = true;
+
cs->cs_conn = icl_new_conn(offload, false, "cfiscsi", >cs_lock);
if (cs->cs_conn == NULL) {
free(cs, M_CFISCSI);
@@ -1376,8 +1381,18 @@ cfiscsi_accept(struct socket *so, struct sockaddr *sa,
icl_conn_handoff_sock(cs->cs_conn, so);
cs->cs_initiator_sa = sa;
cs->cs_portal_id = portal_id;
+   cs->cs_handoff_in_progress = false;
cs->cs_waiting_for_ctld = true;
cv_signal(_softc.accept_cv);
+
+   CFISCSI_SESSION_LOCK(cs);
+   /*
+* Wake up the maintenance thread if we got scheduled for termination
+* somewhere between cfiscsi_session_new() and icl_conn_handoff_sock().
+*/
+   if (cs->cs_terminating)
+   cfiscsi_session_terminate(cs);
+   CFISCSI_SESSION_UNLOCK(cs);
 }
 #endif
 
@@ -1556,6 +1571,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
mtx_lock(>lock);
if (ct->ct_online == 0) {
mtx_unlock(>lock);
+   cs->cs_handoff_in_progress = false;
cfiscsi_session_terminate(cs);
cfiscsi_target_release(ct);
ci->status = CTL_ISCSI_ERROR;
@@ -1566,7 +1582,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
cs->cs_target = ct;
mtx_unlock(>lock);
 
-   refcount_acquire(>cs_outstanding_ctl_pdus);
 restart:
if (!cs->cs_terminating) {
mtx_lock(>lock);
@@ -1603,8 +1618,8 @@ restart:
 #endif
error = icl_conn_handoff(cs->cs_conn, cihp->socket);
if (error != 0) {
+   cs->cs_handoff_in_progress = false;
cfiscsi_session_terminate(cs);
-   refcount_release(>cs_outstanding_ctl_pdus);
ci->status = CTL_ISCSI_ERROR;
snprintf(ci->error_str, sizeof(ci->error_str),
"%s: icl_conn_handoff failed with error %d",
@@ -1629,7 +1644,16 @@ restart:
}
 #endif
 
-   refcount_release(>cs_outstanding_ctl_pdus);
+   CFISCSI_SESSION_LOCK(cs);
+   cs->cs_handoff_in_progress = false;
+
+   /*
+* Wake up the maintenance thread if we got scheduled for termination.
+*/
+   if (cs->cs_terminating)
+   cfiscsi_session_terminate(cs);
+   CFISCSI_SESSION_UNLOCK(cs);
+
ci->status = CTL_ISCSI_OK;
 }
 

Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.h
==
--- stable/11/sys/cam/ctl/ctl_frontend_iscsi.h  Mon Apr 16 17:22:51 2018 

svn commit: r332625 - stable/11/tools/tools/syscall_timing

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:27:13 2018
New Revision: 332625
URL: https://svnweb.freebsd.org/changeset/base/332625

Log:
  MFC r325315:
  
  Add select(2) benchmark.  It takes four pointers; unfortunately it's
  somewhat heavy.

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:26:32 2018(r332624)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:27:13 2018(r332625)
@@ -177,7 +177,6 @@ test_getpriority(uintmax_t num, uintmax_t int_arg, con
return (i);
 }
 
-
 uintmax_t
 test_pipe(uintmax_t num, uintmax_t int_arg, const char *path)
 {
@@ -207,6 +206,31 @@ test_pipe(uintmax_t num, uintmax_t int_arg, const char
 }
 
 uintmax_t
+test_select(uintmax_t num, uintmax_t int_arg, const char *path)
+{
+   fd_set readfds, writefds, exceptfds;
+   struct timeval tv;
+   uintmax_t i;
+   int error;
+
+   FD_ZERO();
+   FD_ZERO();
+   FD_ZERO();
+
+   tv.tv_sec = 0;
+   tv.tv_usec = 0;
+
+   benchmark_start();
+   for (i = 0; i < num; i++) {
+   if (alarm_fired)
+   break;
+   (void)select(0, , , , );
+   }
+   benchmark_stop();
+   return (i);
+}
+
+uintmax_t
 test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path)
 {
uintmax_t i;
@@ -667,6 +691,7 @@ static const struct test tests[] = {
{ "gettimeofday", test_gettimeofday },
{ "getpriority", test_getpriority },
{ "pipe", test_pipe },
+   { "select", test_select },
{ "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL },
{ "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL },
{ "socketpair_stream", test_socketpair_stream },
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332624 - stable/11/tools/tools/syscall_timing

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:26:32 2018
New Revision: 332624
URL: https://svnweb.freebsd.org/changeset/base/332624

Log:
  MFC r325314:
  
  Add getpriority(2) benchmark; it's a lightweight syscall which does pretty
  much nothing - just like getuid(2) - but takes arguments.

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:25:52 2018(r332623)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:26:32 2018(r332624)
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -162,6 +163,22 @@ test_gettimeofday(uintmax_t num, uintmax_t int_arg, co
 }
 
 uintmax_t
+test_getpriority(uintmax_t num, uintmax_t int_arg, const char *path)
+{
+   uintmax_t i;
+
+   benchmark_start();
+   for (i = 0; i < num; i++) {
+   if (alarm_fired)
+   break;
+   (void)getpriority(PRIO_PROCESS, 0);
+   }
+   benchmark_stop();
+   return (i);
+}
+
+
+uintmax_t
 test_pipe(uintmax_t num, uintmax_t int_arg, const char *path)
 {
int fd[2], i;
@@ -648,6 +665,7 @@ static const struct test tests[] = {
{ "getppid", test_getppid },
{ "clock_gettime", test_clock_gettime },
{ "gettimeofday", test_gettimeofday },
+   { "getpriority", test_getpriority },
{ "pipe", test_pipe },
{ "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL },
{ "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL },
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332626 - stable/11/tools/tools/syscall_timing

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:28:59 2018
New Revision: 332626
URL: https://svnweb.freebsd.org/changeset/base/332626

Log:
  MFC r325316:
  
  Add benchmark for getresuid(2) - three pointers, although only "output" ones,
  and quite lightwait.
  
  The purpose of this commit, and the previous one, is to be able to measure
  overhead of pointer arguments - in case you're running a strange architecture
  where pointers and integers are quite different things at the hardware level.

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:27:13 2018(r332625)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:28:59 2018(r332626)
@@ -131,6 +131,22 @@ test_getppid(uintmax_t num, uintmax_t int_arg, const c
 }
 
 uintmax_t
+test_getresuid(uintmax_t num, uintmax_t int_arg, const char *path)
+{
+   uid_t ruid, euid, suid;
+   uintmax_t i;
+
+   benchmark_start();
+   for (i = 0; i < num; i++) {
+   if (alarm_fired)
+   break;
+   (void)getresuid(, , );
+   }
+   benchmark_stop();
+   return (i);
+}
+
+uintmax_t
 test_clock_gettime(uintmax_t num, uintmax_t int_arg, const char *path)
 {
struct timespec ts;
@@ -687,6 +703,7 @@ struct test {
 static const struct test tests[] = {
{ "getuid", test_getuid },
{ "getppid", test_getppid },
+   { "getresuid", test_getresuid },
{ "clock_gettime", test_clock_gettime },
{ "gettimeofday", test_gettimeofday },
{ "getpriority", test_getpriority },
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332631 - in head: sys/kern tests/sys/aio

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 18:12:15 2018
New Revision: 332631
URL: https://svnweb.freebsd.org/changeset/base/332631

Log:
  lio_listio: return EAGAIN instead of EIO when out of resources
  
  This behavior is already documented by the man page, and suggested by POSIX.
  
  Reviewed by:  jhb
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D15099

Modified:
  head/sys/kern/vfs_aio.c
  head/tests/sys/aio/Makefile
  head/tests/sys/aio/lio_test.c

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Mon Apr 16 18:07:51 2018(r332630)
+++ head/sys/kern/vfs_aio.c Mon Apr 16 18:12:15 2018(r332631)
@@ -2131,7 +2131,7 @@ kern_lio_listio(struct thread *td, int mode, struct ai
struct aioliojob *lj;
struct kevent kev;
int error;
-   int nerror;
+   int nagain, nerror;
int i;
 
if ((mode != LIO_NOWAIT) && (mode != LIO_WAIT))
@@ -2200,12 +2200,15 @@ kern_lio_listio(struct thread *td, int mode, struct ai
/*
 * Get pointers to the list of I/O requests.
 */
+   nagain = 0;
nerror = 0;
for (i = 0; i < nent; i++) {
job = acb_list[i];
if (job != NULL) {
error = aio_aqueue(td, job, lj, LIO_NOP, ops);
-   if (error != 0)
+   if (error == EAGAIN)
+   nagain++;
+   else if (error != 0)
nerror++;
}
}
@@ -2252,7 +2255,10 @@ kern_lio_listio(struct thread *td, int mode, struct ai
 
if (nerror)
return (EIO);
-   return (error);
+   else if (nagain)
+   return (EAGAIN);
+   else
+   return (error);
 }
 
 /* syscall - list directed I/O (REALTIME) */

Modified: head/tests/sys/aio/Makefile
==
--- head/tests/sys/aio/Makefile Mon Apr 16 18:07:51 2018(r332630)
+++ head/tests/sys/aio/Makefile Mon Apr 16 18:12:15 2018(r332631)
@@ -6,6 +6,8 @@ ATF_TESTS_C+=   aio_test
 ATF_TESTS_C+=  lio_test
 TEST_METADATA.aio_test+= timeout="30"
 TEST_METADATA.lio_test+= timeout="10"
+# Some lio_test testcases involve system resource limitations, so cannot run 
concurrently
+TEST_METADATA.lio_test+= is_exclusive=true
 
 PLAIN_TESTS_C+=aio_kqueue_test
 PLAIN_TESTS_C+=lio_kqueue_test

Modified: head/tests/sys/aio/lio_test.c
==
--- head/tests/sys/aio/lio_test.c   Mon Apr 16 18:07:51 2018
(r332630)
+++ head/tests/sys/aio/lio_test.c   Mon Apr 16 18:12:15 2018
(r332631)
@@ -30,10 +30,13 @@
 #include 
 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 
+#include "local.h"
 #include "freebsd_test_suite/macros.h"
 
 static sem_t completions; 
@@ -51,6 +54,73 @@ thr_handler(union sigval sv __unused)
ATF_REQUIRE_EQ(0, sem_post());
 }
 
+/* 
+ * If lio_listio is unable to enqueue any requests at all, it should return
+ * EAGAIN.
+ */
+ATF_TC_WITHOUT_HEAD(lio_listio_eagain_kevent);
+ATF_TC_BODY(lio_listio_eagain_kevent, tc)
+{
+   int fd, i, j, kq, max_queue_per_proc, ios_per_call;
+   size_t max_queue_per_proc_size;
+   struct aiocb *aiocbs[2];
+   struct aiocb **list[2];
+   struct sigevent sev[2];
+   char *buffer;
+   const char *path="tempfile";
+   void *udata[2];
+
+   ATF_REQUIRE_KERNEL_MODULE("aio");
+   ATF_REQUIRE_UNSAFE_AIO();
+
+   max_queue_per_proc_size = sizeof(max_queue_per_proc);
+   ATF_REQUIRE_EQ(sysctlbyname("vfs.aio.max_aio_queue_per_proc",
+   _queue_per_proc, _queue_per_proc_size, NULL, 0), 0);
+   ios_per_call = max_queue_per_proc;
+
+   fd = open(path, O_RDWR|O_CREAT, 0666);
+   ATF_REQUIRE(fd >= 0);
+
+   kq = kqueue();
+   ATF_REQUIRE(kq > 0);
+
+   buffer = calloc(1, 4096);
+   ATF_REQUIRE(buffer != NULL);
+
+   /*
+* Call lio_listio twice, each with the maximum number of operations.
+* The first call should succeed and the second should fail.
+*/
+   for (i = 0; i < 2; i++) {
+   aiocbs[i] = calloc(ios_per_call, sizeof(struct aiocb));
+   ATF_REQUIRE(aiocbs[i] != NULL);
+   list[i] = calloc(ios_per_call, sizeof(struct aiocb*));
+   ATF_REQUIRE(list[i] != NULL);
+   udata[i] = (void*)((caddr_t)0xdead + i);
+   sev[i].sigev_notify = SIGEV_KEVENT;
+   sev[i].sigev_notify_kqueue = kq;
+   sev[i].sigev_value.sival_ptr = udata[i];
+   for (j = 0; j < ios_per_call; j++) {
+   aiocbs[i][j].aio_fildes = fd;
+   aiocbs[i][j].aio_offset = (i * ios_per_call + j) * 4096;
+ 

svn commit: r332604 - in stable/11: etc/mtree tests/sys/net

2018-04-16 Thread Alan Somers
Author: asomers
Date: Mon Apr 16 16:25:42 2018
New Revision: 332604
URL: https://svnweb.freebsd.org/changeset/base/332604

Log:
  MFC r329874:
  
  Add tests for lagg(4) and other cloned network interfaces
  
  Unfortunately, most of the tests are disabled because they fairly frequently
  trigger panics.
  
  Sponsored by: Spectra Logic Corp

Added:
  stable/11/tests/sys/net/
 - copied from r329874, head/tests/sys/net/
Modified:
  stable/11/etc/mtree/BSD.tests.dist
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/mtree/BSD.tests.dist
==
--- stable/11/etc/mtree/BSD.tests.dist  Mon Apr 16 16:24:36 2018
(r332603)
+++ stable/11/etc/mtree/BSD.tests.dist  Mon Apr 16 16:25:42 2018
(r332604)
@@ -474,6 +474,8 @@
 ..
 mqueue
 ..
+net
+..
 netinet
 ..
 opencrypto
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332615 - stable/11/usr.sbin/uefisign

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:13:54 2018
New Revision: 332615
URL: https://svnweb.freebsd.org/changeset/base/332615

Log:
  MFC r328335:
  
  Add SPDX identifiers for uefisign(8) sources.

Modified:
  stable/11/usr.sbin/uefisign/child.c
  stable/11/usr.sbin/uefisign/magic.h
  stable/11/usr.sbin/uefisign/pe.c
  stable/11/usr.sbin/uefisign/uefisign.c
  stable/11/usr.sbin/uefisign/uefisign.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/uefisign/child.c
==
--- stable/11/usr.sbin/uefisign/child.c Mon Apr 16 17:13:09 2018
(r332614)
+++ stable/11/usr.sbin/uefisign/child.c Mon Apr 16 17:13:54 2018
(r332615)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/uefisign/magic.h
==
--- stable/11/usr.sbin/uefisign/magic.h Mon Apr 16 17:13:09 2018
(r332614)
+++ stable/11/usr.sbin/uefisign/magic.h Mon Apr 16 17:13:54 2018
(r332615)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/uefisign/pe.c
==
--- stable/11/usr.sbin/uefisign/pe.cMon Apr 16 17:13:09 2018
(r332614)
+++ stable/11/usr.sbin/uefisign/pe.cMon Apr 16 17:13:54 2018
(r332615)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/uefisign/uefisign.c
==
--- stable/11/usr.sbin/uefisign/uefisign.c  Mon Apr 16 17:13:09 2018
(r332614)
+++ stable/11/usr.sbin/uefisign/uefisign.c  Mon Apr 16 17:13:54 2018
(r332615)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/uefisign/uefisign.h
==
--- stable/11/usr.sbin/uefisign/uefisign.h  Mon Apr 16 17:13:09 2018
(r332614)
+++ stable/11/usr.sbin/uefisign/uefisign.h  Mon Apr 16 17:13:54 2018
(r332615)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332614 - stable/11/sys/arm/conf

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:13:09 2018
New Revision: 332614
URL: https://svnweb.freebsd.org/changeset/base/332614

Log:
  MFC r328195:
  
  Add usb_template(4) to RPI-B kernel config.  This is to support the USB OTG
  functionality on Raspberry Pi 0.

Modified:
  stable/11/sys/arm/conf/RPI-B
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/conf/RPI-B
==
--- stable/11/sys/arm/conf/RPI-BMon Apr 16 17:12:18 2018
(r332613)
+++ stable/11/sys/arm/conf/RPI-BMon Apr 16 17:13:09 2018
(r332614)
@@ -47,6 +47,9 @@ devicepty
 device snp
 device pl011
 
+# Device mode support
+device usb_template# Control of the gadget
+
 # Comment following lines for boot console on serial port
 device vt
 device kbdmux
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332618 - in stable/11/usr.bin: cpuset rctl

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:18:06 2018
New Revision: 332618
URL: https://svnweb.freebsd.org/changeset/base/332618

Log:
  MFC r330024:
  
  .Xr rctl(8) and cpuset(1).
  
  PR:   225935

Modified:
  stable/11/usr.bin/cpuset/cpuset.1
  stable/11/usr.bin/rctl/rctl.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/cpuset/cpuset.1
==
--- stable/11/usr.bin/cpuset/cpuset.1   Mon Apr 16 17:15:26 2018
(r332617)
+++ stable/11/usr.bin/cpuset/cpuset.1   Mon Apr 16 17:18:06 2018
(r332618)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 1, 2016
+.Dd February 26, 2018
 .Dt CPUSET 1
 .Os
 .Sh NAME
@@ -187,7 +187,8 @@ Create a new cpuset that is restricted to CPUs 0 and 2
 into the new set:
 .Dl cpuset -C -c -l 0,2 -p 
 .Sh SEE ALSO
-.Xr cpuset 2
+.Xr cpuset 2 ,
+.Xr rctl 8
 .Sh HISTORY
 The
 .Nm

Modified: stable/11/usr.bin/rctl/rctl.8
==
--- stable/11/usr.bin/rctl/rctl.8   Mon Apr 16 17:15:26 2018
(r332617)
+++ stable/11/usr.bin/rctl/rctl.8   Mon Apr 16 17:18:06 2018
(r332618)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 28, 2017
+.Dd February 26, 2018
 .Dt RCTL 8
 .Os
 .Sh NAME
@@ -261,6 +261,7 @@ Display all rules matching user "joe":
 Display all rules matching login classes:
 .Dl Nm Ar loginclass:
 .Sh SEE ALSO
+.Xr cpuset 1 ,
 .Xr rctl 4 ,
 .Xr rctl.conf 5
 .Sh HISTORY
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332623 - stable/11/tools/tools/syscall_timing

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 17:25:52 2018
New Revision: 332623
URL: https://svnweb.freebsd.org/changeset/base/332623

Log:
  MFC r325317:
  
  Add bad_open benchmark, which measures failed opens by calling
  open("", O_RDONLY);.

Modified:
  stable/11/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c
==
--- stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:24:33 2018(r332622)
+++ stable/11/tools/tools/syscall_timing/syscall_timing.c   Mon Apr 16 
17:25:52 2018(r332623)
@@ -334,6 +334,21 @@ test_open_close(uintmax_t num, uintmax_t int_arg, cons
 }
 
 uintmax_t
+test_bad_open(uintmax_t num, uintmax_t int_arg, const char *path)
+{
+   uintmax_t i;
+
+   benchmark_start();
+   for (i = 0; i < num; i++) {
+   if (alarm_fired)
+   break;
+   open("", O_RDONLY);
+   }
+   benchmark_stop();
+   return (i);
+}
+
+uintmax_t
 test_read(uintmax_t num, uintmax_t int_arg, const char *path)
 {
char buf[int_arg];
@@ -641,6 +656,7 @@ static const struct test tests[] = {
{ "socket_tcp", test_socket_stream, .t_int = PF_INET },
{ "socket_udp", test_socket_dgram, .t_int = PF_INET },
{ "create_unlink", test_create_unlink, .t_flags = FLAG_PATH },
+   { "bad_open", test_bad_open },
{ "open_close", test_open_close, .t_flags = FLAG_PATH },
{ "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH,
.t_int = 1 },
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332572 - stable/11/sys/vm

2018-04-16 Thread Gleb Smirnoff
Author: glebius
Date: Mon Apr 16 15:07:19 2018
New Revision: 332572
URL: https://svnweb.freebsd.org/changeset/base/332572

Log:
  Merge r331871:
Handle a special case when a slab can fit only one allocation,
and zone has a large alignment. With alignment taken into
account uk_rsize will be greater than space in a slab. However,
since we have only one item per slab, it is always naturally
aligned.
  
Code that will panic before this change with 4k page:
  
  z = uma_zcreate("test", 3984, NULL, NULL, NULL, NULL, 31, 0);
  uma_zalloc(z, M_WAITOK);
  
A practical scenario to hit the panic is a machine with 56 CPUs
and 2 NUMA domains, which yields in zone size of 3984 (on head).
  
  PR:   227116

Modified:
  stable/11/sys/vm/uma_core.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/uma_core.c
==
--- stable/11/sys/vm/uma_core.c Mon Apr 16 14:46:02 2018(r332571)
+++ stable/11/sys/vm/uma_core.c Mon Apr 16 15:07:19 2018(r332572)
@@ -1249,7 +1249,15 @@ keg_small_init(uma_keg_t keg)
else 
shsize = sizeof(struct uma_slab);
 
-   keg->uk_ipers = (slabsize - shsize) / rsize;
+   if (rsize <= slabsize - shsize)
+   keg->uk_ipers = (slabsize - shsize) / rsize;
+   else {
+   /* Handle special case when we have 1 item per slab, so
+* alignment requirement can be relaxed. */
+   KASSERT(keg->uk_size <= slabsize - shsize,
+   ("%s: size %u greater than slab", __func__, keg->uk_size));
+   keg->uk_ipers = 1;
+   }
KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE,
("%s: keg->uk_ipers %u", __func__, keg->uk_ipers));
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332576 - stable/11/sys/dev/usb/template

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:44:03 2018
New Revision: 332576
URL: https://svnweb.freebsd.org/changeset/base/332576

Log:
  MFC r328196:
  
  Add missing SPDX tags; the rest of the license text is the same as in other
  USB templates.

Modified:
  stable/11/sys/dev/usb/template/usb_template_midi.c
  stable/11/sys/dev/usb/template/usb_template_phone.c
  stable/11/sys/dev/usb/template/usb_template_serialnet.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/template/usb_template_midi.c
==
--- stable/11/sys/dev/usb/template/usb_template_midi.c  Mon Apr 16 15:42:26 
2018(r332575)
+++ stable/11/sys/dev/usb/template/usb_template_midi.c  Mon Apr 16 15:44:03 
2018(r332576)
@@ -1,5 +1,7 @@
 /* $FreeBSD$ */
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Hans Petter Selasky
  * Copyright (c) 2018 The FreeBSD Foundation
  * All rights reserved.

Modified: stable/11/sys/dev/usb/template/usb_template_phone.c
==
--- stable/11/sys/dev/usb/template/usb_template_phone.c Mon Apr 16 15:42:26 
2018(r332575)
+++ stable/11/sys/dev/usb/template/usb_template_phone.c Mon Apr 16 15:44:03 
2018(r332576)
@@ -1,5 +1,7 @@
 /* $FreeBSD$ */
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 Hans Petter Selasky
  * Copyright (c) 2018 The FreeBSD Foundation
  * All rights reserved.

Modified: stable/11/sys/dev/usb/template/usb_template_serialnet.c
==
--- stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Apr 16 
15:42:26 2018(r332575)
+++ stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Apr 16 
15:44:03 2018(r332576)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 Ruslan Bukin 
  * Copyright (c) 2018 The FreeBSD Foundation
  * All rights reserved.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332579 - stable/11/usr.sbin/usbconfig

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:49:16 2018
New Revision: 332579
URL: https://svnweb.freebsd.org/changeset/base/332579

Log:
  MFC r327382:
  
  Improve usbconfig(8) manual page by adding descriptions for subcommands.

Modified:
  stable/11/usr.sbin/usbconfig/usbconfig.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/usbconfig/usbconfig.8
==
--- stable/11/usr.sbin/usbconfig/usbconfig.8Mon Apr 16 15:48:15 2018
(r332578)
+++ stable/11/usr.sbin/usbconfig/usbconfig.8Mon Apr 16 15:49:16 2018
(r332579)
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd January 6, 2010
+.Dd December 30, 2017
 .Dt USBCONFIG 8
 .Os
 .Sh NAME
@@ -56,45 +56,124 @@ The unit and address coordinates may be prefixed by th
 Show help and available commands.
 .El
 .Pp
-When called without options,
+The following commands may be used with
+.Nm :
+.Bl -tag -width indent
+.It Cm set_config Ar cfg_index
+Choose the configuration for the USB device.
+Valid values range from zero to the number reported as the
+.Ar bNumConfigurations
+in
+.Cm dump_device_desc
+output.
+The special value of 255 unconfigures the device, detaching
+the interface drivers and reducing the power consumption to minimum,
+but without going into power saving mode or detaching from the bus.
+In some cases, it prevents the device from charging.
+.It Cm set_alt Ar alt_index
+Choose the alternate interface for the USB device.
+Alternative settings for the current configuration are available as the
+.Ar bAlternateSetting
+in
+.Cm dump_curr_config_desc
+output.
+Usually there is no need to adjust this setting.
+.It Cm set_template Ar template
+Set the global USB device side template.
+See
+.Xr usb_template 4
+for more information.
+.It Cm get_template
+Get the current USB device side template.
+.It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
+Add a quirk by specifying the Vendor ID, Product ID, low and high
+revision numbers, and the quirk name.
+See
+.Xr usb_quirk 4
+for more information.
+.It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
+Remove a quirk.
+.It Cm add_quirk Ar quirk_name
+Add quirk for the currently selected USB device.
+.It Cm remove_quirk Ar quirk_name
+Remove a quirk for the currently selected USB device.
+.It Cm dump_quirk_names
+Display the list of supported quirk names.
+.It Cm dump_device_quirks
+Display the list of current device quirks.
+.It Cm dump_device_desc
+Display the device descriptor.
+.It Cm dump_curr_config_desc
+Display current configuration descriptor.
+.It Cm dump_all_config_desc
+Display all the configuration descriptors.
+.It Cm dump_string Ar index
+Display string descriptor at selected index.
+.It Cm dump_info
+Display summary information about the device.
+.It Cm show_ifdrv
+Display the list of interface drivers (such as
+.Xr ukbd 4
+or
+.Xr u3g 4 )
+currently attached to the device.
+.It Cm suspend
+Force the device to suspend.
+.It Cm resume
+Force the device to resume.
+.It Cm power_off
+Turn the device off.
+.It Cm power_save
+Turn the automatic suspend and resume on.
+This is the default for USB hubs.
+.It Cm power_on
+Turn the device on and disable automatic suspend and resume.
+This is the default for non-hub devices.
+.It Cm reset
+Reset the device.
+This forces the USB stack to reenumerate the bus.
+.It Cm list
+List all available USB devices.
+This is the default if
 .Nm
-prints a list of all available USB devices.
+is called without specifying a command.
+.It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data...
+Perform a synchronous control request on the specified device.
+See
+.Xr libusb20_dev_request_sync 3
+for more information.
+.El
 .Sh EXAMPLES
+.Pp
 Show information about the device on USB bus 1 at address 2:
 .Pp
-.Dl usbconfig -u 1 -a 2 dump_info
+.Dl usbconfig -d ugen1.2 dump_info
 .Pp
 Dump HID descriptor for device on USB bus 1 at address 2:
 .Pp
-.Dl usbconfig -u 1 -a 2 do_request 0x81 0x06 0x2200 0 0x100
+.Dl usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100
 .Pp
 Dump string descriptor at index Z for device on USB bus 1 at address 2:
 .Pp
-.Dl usbconfig -u 1 -a 2 dump_string Z
+.Dl usbconfig -d ugen1.2 dump_string Z
 .Pp
 Dump current configuration descriptor for device on USB bus 1 at address 2:
 .Pp
-.Dl usbconfig -u 1 -a 2 dump_curr_config_desc
+.Dl usbconfig -d ugen1.2 dump_curr_config_desc
 .Pp
 Dump device descriptor for device on USB bus 1 at address 2:
 .Pp
-.Dl usbconfig -u 1 -a 2 dump_device_desc
+.Dl usbconfig -d ugen1.2 dump_device_desc
 .Pp
 Program the device on USB bus 1 at address 2 to suspend, resume, power off, go 
into power save, or power on:
 .Pp
-.Dl usbconfig -u 1 -a 2 suspend
-.Dl usbconfig -u 1 -a 2 resume
-.Dl usbconfig -u 1 -a 2 power_off
-.Dl usbconfig -u 1 -a 2 power_save
-.Dl usbconfig -u 1 -a 2 

svn commit: r332581 - stable/11/usr.sbin/usbconfig

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:51:19 2018
New Revision: 332581
URL: https://svnweb.freebsd.org/changeset/base/332581

Log:
  MFC r330875:
  
  Add "usbconfig dump_all_desc", a subcommand to dump all device and config
  descriptors.

Modified:
  stable/11/usr.sbin/usbconfig/usbconfig.8
  stable/11/usr.sbin/usbconfig/usbconfig.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/usbconfig/usbconfig.8
==
--- stable/11/usr.sbin/usbconfig/usbconfig.8Mon Apr 16 15:50:10 2018
(r332580)
+++ stable/11/usr.sbin/usbconfig/usbconfig.8Mon Apr 16 15:51:19 2018
(r332581)
@@ -97,6 +97,8 @@ Remove a quirk.
 Add quirk for the currently selected USB device.
 .It Cm remove_quirk Ar quirk_name
 Remove a quirk for the currently selected USB device.
+.It Cm dump_all_desc
+Display the device and configuration descriptors.
 .It Cm dump_quirk_names
 Display the list of supported quirk names.
 .It Cm dump_device_quirks

Modified: stable/11/usr.sbin/usbconfig/usbconfig.c
==
--- stable/11/usr.sbin/usbconfig/usbconfig.cMon Apr 16 15:50:10 2018
(r332580)
+++ stable/11/usr.sbin/usbconfig/usbconfig.cMon Apr 16 15:51:19 2018
(r332581)
@@ -77,6 +77,7 @@ struct options {
uint8_t got_power_on:1;
uint8_t got_dump_device_quirks:1;
uint8_t got_dump_quirk_names:1;
+   uint8_t got_dump_all_desc:1;
uint8_t got_dump_device_desc:1;
uint8_t got_dump_curr_config:1;
uint8_t got_dump_all_config:1;
@@ -112,6 +113,7 @@ enum {
T_SHOW_IFACE_DRIVER,
T_DUMP_QUIRK_NAMES,
T_DUMP_DEVICE_QUIRKS,
+   T_DUMP_ALL_DESC,
T_DUMP_DEVICE_DESC,
T_DUMP_CURR_CONFIG_DESC,
T_DUMP_ALL_CONFIG_DESC,
@@ -144,6 +146,7 @@ static const struct token token[] = {
{"remove_quirk", T_REMOVE_QUIRK, 1},
{"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0},
{"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0},
+   {"dump_all_desc", T_DUMP_ALL_DESC, 0},
{"dump_device_desc", T_DUMP_DEVICE_DESC, 0},
{"dump_curr_config_desc", T_DUMP_CURR_CONFIG_DESC, 0},
{"dump_all_config_desc", T_DUMP_ALL_CONFIG_DESC, 0},
@@ -283,6 +286,7 @@ usage(void)
"  remove_quirk " "\n"
"  dump_quirk_names" "\n"
"  dump_device_quirks" "\n"
+   "  dump_all_desc" "\n"
"  dump_device_desc" "\n"
"  dump_curr_config_desc" "\n"
"  dump_all_config_desc" "\n"
@@ -489,7 +493,8 @@ flush_command(struct libusb20_backend *pbe, struct opt
}
}
dump_any =
-   (opt->got_dump_device_desc ||
+   (opt->got_dump_all_desc ||
+   opt->got_dump_device_desc ||
opt->got_dump_curr_config ||
opt->got_dump_all_config ||
opt->got_dump_info);
@@ -508,6 +513,10 @@ flush_command(struct libusb20_backend *pbe, struct opt
} else if (opt->got_dump_curr_config) {
printf("\n");
dump_config(pdev, 0);
+   } else if (opt->got_dump_all_desc) {
+   printf("\n");
+   dump_device_desc(pdev);
+   dump_config(pdev, 1);
}
if (dump_any) {
printf("\n");
@@ -694,6 +703,12 @@ main(int argc, char **argv)
if (opt->got_get_template)
duplicate_option(argv[n]);
opt->got_get_template = 1;
+   opt->got_any++;
+   break;
+   case T_DUMP_ALL_DESC:
+   if (opt->got_dump_all_desc)
+   duplicate_option(argv[n]);
+   opt->got_dump_all_desc = 1;
opt->got_any++;
break;
case T_DUMP_DEVICE_DESC:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332585 - stable/11/etc/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:57:18 2018
New Revision: 332585
URL: https://svnweb.freebsd.org/changeset/base/332585

Log:
  MFC r325392:
  
  Add NIS automounter map, which supports rewriting of self-hosted locations
  to make them nullfs.
  
  PR:   221010

Added:
  stable/11/etc/autofs/include_nis
 - copied unchanged from r325392, head/etc/autofs/include_nis
Modified:
  stable/11/etc/autofs/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/Makefile
==
--- stable/11/etc/autofs/Makefile   Mon Apr 16 15:54:38 2018
(r332584)
+++ stable/11/etc/autofs/Makefile   Mon Apr 16 15:57:18 2018
(r332585)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-FILES= include_ldap special_hosts special_media special_noauto 
special_null
+FILES= include_ldap include_nis special_hosts special_media 
special_noauto special_null
 
 NO_OBJ=
 FILESDIR=  /etc/autofs

Copied: stable/11/etc/autofs/include_nis (from r325392, 
head/etc/autofs/include_nis)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/etc/autofs/include_nisMon Apr 16 15:57:18 2018
(r332585, copy of r325392, head/etc/autofs/include_nis)
@@ -0,0 +1,180 @@
+#!/usr/bin/awk -f
+#-
+# Copyright (c) 2017 G. Paul Ziemba
+# All rights reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#  1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+#  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+#  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+#  SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+#
+# /etc/autofs/include_nis
+#
+# automountd Directory Services script for NIS
+#
+# SYNOPSIS
+#   include_nis 
+#
+#   include_nis  
+#
+# DESCRIPTION
+#
+#   This script provides a Directory Services map for automountd
+#   based on NIS. Please see auto_master(5) for general information.
+#
+#   The first form, with one argument, emits the entire named NIS map.
+#   The second form, with two arguments, emits the map entry for the
+#   key given in the second argument. 
+#
+#   This script attempts to determine the names and IP addresses
+#   of the local host. Map entries matching the local host are
+#   rewritten to specify nullfs mounts (instead of the default
+#   NFS) to reduce access overhead in the kernel.
+#
+#  If a map entry contains multiple location fields, it is not changed.
+#
+
+
+# Populate list of names and IP addrs thet mean "this host"
+# into myhostnames array
+BEGIN {
+#
+# Set self hostnames
+#
+
+"hostname -s" | getline;
+myhostnames[$0] = 1;
+
+"hostname -f" | getline;
+myhostnames[$0] = 1;
+
+myhostnames["localhost"] = 1
+
+"hostname -f" | getline;
+localdomain=$0
+myhostnames["localhost."localdomain] = 1
+
+while ("ifconfig" | getline) {
+   if ($1 == "inet") {
+   myhostnames[$2] = 1;
+   }
+}
+
+# debug
+#print "--- hostname list start "
+#for (i in myhostnames) {
+#print i
+#}
+#print "--- hostname list end "
+
+if (ARGC == 2) {
+   # mapname only
+   while ("ypcat -k " ARGV[1] | getline) {
+   proc_mapline(1)
+   }
+}
+if (ARGC == 3) {
+   # mapname and keyname
+   while ("ypmatch " ARGV[2] " " ARGV[1] | getline) {
+   proc_mapline(0)
+   }
+}
+exit 0
+}
+
+function is_self(hostname)
+{
+if (myhostnames[hostname]) {
+   return 1
+}
+return 0
+}
+
+#
+# Lines are of the form [key] [-opts] location1 [... locationN]
+#
+# indicate index of key field with first positional parameter
+# 1 means keyfield is the first field
+# 0 means keyfield is not present
+#

svn commit: r332586 - stable/11/etc/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:58:02 2018
New Revision: 332586
URL: https://svnweb.freebsd.org/changeset/base/332586

Log:
  MFC r326250:
  
  Change formatting; no functional changes.

Modified:
  stable/11/etc/autofs/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/Makefile
==
--- stable/11/etc/autofs/Makefile   Mon Apr 16 15:57:18 2018
(r332585)
+++ stable/11/etc/autofs/Makefile   Mon Apr 16 15:58:02 2018
(r332586)
@@ -1,6 +1,11 @@
 # $FreeBSD$
 
-FILES= include_ldap include_nis special_hosts special_media 
special_noauto special_null
+FILES= include_ldap \
+   include_nis \
+   special_hosts \
+   special_media \
+   special_noauto \
+   special_null
 
 NO_OBJ=
 FILESDIR=  /etc/autofs
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332559 - head/usr.sbin/mountd

2018-04-16 Thread Julian Elischer

On 16/4/18 6:56 pm, Konstantin Belousov wrote:

On Mon, Apr 16, 2018 at 09:17:36AM +, Andriy Gapon wrote:

Author: avg
Date: Mon Apr 16 09:17:36 2018
New Revision: 332559
URL: https://svnweb.freebsd.org/changeset/base/332559

Log:
   mountd: fix a crash when getgrouplist reports too many groups
   
   Previously the code only warned about the condition and then happily

   proceeded to use the too large value resulting in the array
   out-of-bounds access.
   
   Obtained from:	Panzura (Chuanbo Zheng)

   MFC after:   10 days
   Sponsored by:Panzura

Modified:
   head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Mon Apr 16 08:41:44 2018
(r332558)
+++ head/usr.sbin/mountd/mountd.c   Mon Apr 16 09:17:36 2018
(r332559)
@@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr)
}
cr->cr_uid = pw->pw_uid;
ngroups = XU_NGROUPS + 1;
-   if (getgrouplist(pw->pw_name, pw->pw_gid, groups, ))
+   if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) {
syslog(LOG_ERR, "too many groups");
+   ngroups = XU_NGROUPS + 1;

Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ?

valid question.. because that is how many are allocated?
it was a "minimally invasive patch".. whoever used XU_NGROUPS before 
should have fixed it.
Having said that, thanks for drawing out attention to it.. will 
probably fix.





+   }
+
/*
 * Compress out duplicate.
 */




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


Re: svn commit: r332510 - in head: usr.bin/wall usr.sbin/syslogd

2018-04-16 Thread Pintér , Olivér
On Sun, Apr 15, 2018 at 10:34 AM, Ed Schouten  wrote:

> Author: ed
> Date: Sun Apr 15 08:34:16 2018
> New Revision: 332510
> URL: https://svnweb.freebsd.org/changeset/base/332510
>
> Log:
>   Add RFC 5424 syslog message output to syslogd.
>
>   - Move all of the code responsible for transmitting log messages into a
> separate function, fprintlog_write().
>   - Instead of manually modifying a list of iovecs, add a structure
> iovlist with some helper functions.
>   - Alter the F_FORW (UDP message forwarding) case to also use iovecs like
> the other cases. Use sendmsg() instead of sendto().
>   - In the case of F_FORW, truncate the message to a size dependent on the
> address family (AF_INET, AF_INET6), as proposed by RFC 5426.
>   - Move all traditional message formatting into fprintlog_bsd(). Get rid
> of some of the string copying and snprintf()'ing. Simply emit more
> iovecs to get the job done.
>   - Increase ttymsg()'s limit of 7 iovecs to 32. Add a definition for this
> limit, so it can be reused by iovlist.
>   - Add fprintlog_rfc5424() to emit RFC 5424 formatted log entries.
>   - Add a "-O" command line option to enable RFC 5424 formatting. It would
> have been nicer if we supported "-o rfc5424", just like on NetBSD.
> Unfortunately, the "-o" flag is already used for a different purpose
> on FreeBSD.
>   - Don't truncate hostnames in the RFC 5424 case, as suggested by that
> specific RFC.
>
>   For people interested in using this, this feature can be enabled by
>   adding the following line to /etc/rc.conf:
>
> syslogd_flags="-s -O rfc5424"
>
>   Differential Revision:https://reviews.freebsd.org/D15011

Release notes: yes

>
>
> Modified:
>   head/usr.bin/wall/ttymsg.c
>   head/usr.bin/wall/ttymsg.h
>   head/usr.sbin/syslogd/syslogd.8
>   head/usr.sbin/syslogd/syslogd.c
>
> Modified: head/usr.bin/wall/ttymsg.c
> 
> ==
> --- head/usr.bin/wall/ttymsg.c  Sat Apr 14 22:14:18 2018(r332509)
> +++ head/usr.bin/wall/ttymsg.c  Sun Apr 15 08:34:16 2018(r332510)
> @@ -61,7 +61,7 @@ static const char sccsid[] = "@(#)ttymsg.c8.2 (Berkel
>  const char *
>  ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout)
>  {
> -   struct iovec localiov[7];
> +   struct iovec localiov[TTYMSG_IOV_MAX];
> ssize_t left, wret;
> int cnt, fd;
> char device[MAXNAMLEN] = _PATH_DEV;
>
> Modified: head/usr.bin/wall/ttymsg.h
> 
> ==
> --- head/usr.bin/wall/ttymsg.h  Sat Apr 14 22:14:18 2018(r332509)
> +++ head/usr.bin/wall/ttymsg.h  Sun Apr 15 08:34:16 2018(r332510)
> @@ -1,3 +1,5 @@
>  /* $FreeBSD$ */
>
> +#defineTTYMSG_IOV_MAX  32
> +
>  const char *ttymsg(struct iovec *, int, const char *, int);
>
> Modified: head/usr.sbin/syslogd/syslogd.8
> 
> ==
> --- head/usr.sbin/syslogd/syslogd.8 Sat Apr 14 22:14:18 2018
> (r332509)
> +++ head/usr.sbin/syslogd/syslogd.8 Sun Apr 15 08:34:16 2018
> (r332510)
> @@ -28,7 +28,7 @@
>  .\" @(#)syslogd.8  8.1 (Berkeley) 6/6/93
>  .\" $FreeBSD$
>  .\"
> -.Dd November 28, 2017
> +.Dd April 9, 2018
>  .Dt SYSLOGD 8
>  .Os
>  .Sh NAME
> @@ -42,6 +42,7 @@
>  .Op Fl f Ar config_file
>  .Op Fl l Oo Ar mode Ns \&: Oc Ns Ar path
>  .Op Fl m Ar mark_interval
> +.Op Fl O Ar format
>  .Op Fl P Ar pid_file
>  .Op Fl p Ar log_socket
>  .Op Fl S Ar logpriv_socket
> @@ -242,6 +243,20 @@ Usually the
>  .Dq kern
>  facility is reserved for messages read directly from
>  .Pa /dev/klog .
> +.It Fl O Ar format
> +Select the output format of generated log messages.
> +The values
> +.Ar bsd
> +and
> +.Ar rfc3164
> +are used to generate RFC 3164 log messages.
> +The values
> +.Ar syslog
> +and
> +.Ar rfc5424
> +are used to generate RFC 5424 log messages,
> +having RFC 3339 timestamps with microsecond precision.
> +The default is to generate RFC 3164 log messages.
>  .It Fl m Ar mark_interval
>  Select the number of minutes between
>  .Dq mark
>
> Modified: head/usr.sbin/syslogd/syslogd.c
> 
> ==
> --- head/usr.sbin/syslogd/syslogd.c Sat Apr 14 22:14:18 2018
> (r332509)
> +++ head/usr.sbin/syslogd/syslogd.c Sun Apr 15 08:34:16 2018
> (r332510)
> @@ -136,6 +136,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -367,9 +368,12 @@ static int KeepKernFac;/* Keep remotely logged
> kernel
>  static int needdofsync = 0; /* Are any file(s) waiting to be fsynced?
> */
>  static struct pidfh *pfh;
>  static int sigpipe[2]; /* Pipe to catch a signal during select().
> */
> +static boolRFC3164OutputFormat = true; /* Use legacy format by
> default. */
>
>  

svn commit: r332566 - in stable/11/sys: cddl/dev/dtrace/mips cddl/dev/fbt/mips mips/conf modules/dtrace modules/dtrace/dtraceall

2018-04-16 Thread Kurt Lidl
Author: lidl
Date: Mon Apr 16 14:39:04 2018
New Revision: 332566
URL: https://svnweb.freebsd.org/changeset/base/332566

Log:
  MFC r323206: Enable dtrace support for mips64 and the ERL kernel config
  
  Turn on the required options in the ERL config file, and ensure
  that the fbt module is listed as a dependency for mips in
  the modules/dtrace/dtraceall/dtraceall.c file.

Modified:
  stable/11/sys/cddl/dev/dtrace/mips/dtrace_asm.S
  stable/11/sys/cddl/dev/dtrace/mips/dtrace_subr.c
  stable/11/sys/cddl/dev/fbt/mips/fbt_isa.c
  stable/11/sys/mips/conf/ERL
  stable/11/sys/modules/dtrace/Makefile
  stable/11/sys/modules/dtrace/dtraceall/Makefile
  stable/11/sys/modules/dtrace/dtraceall/dtraceall.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/dev/dtrace/mips/dtrace_asm.S
==
--- stable/11/sys/cddl/dev/dtrace/mips/dtrace_asm.S Mon Apr 16 14:10:19 
2018(r332565)
+++ stable/11/sys/cddl/dev/dtrace/mips/dtrace_asm.S Mon Apr 16 14:39:04 
2018(r332566)
@@ -37,8 +37,6 @@
 #include 
 #include 
 
-#include "assym.s"
-
 .setnoreorder   # Noreorder is default style!
 
 /*

Modified: stable/11/sys/cddl/dev/dtrace/mips/dtrace_subr.c
==
--- stable/11/sys/cddl/dev/dtrace/mips/dtrace_subr.cMon Apr 16 14:10:19 
2018(r332565)
+++ stable/11/sys/cddl/dev/dtrace/mips/dtrace_subr.cMon Apr 16 14:39:04 
2018(r332566)
@@ -50,6 +50,8 @@ extern int (*dtrace_invop_jump_addr)(struct trapframe 
 extern dtrace_id_t dtrace_probeid_error;
 
 int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
+void dtrace_invop_init(void);
+void dtrace_invop_uninit(void);
 
 typedef struct dtrace_invop_hdlr {
int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t);

Modified: stable/11/sys/cddl/dev/fbt/mips/fbt_isa.c
==
--- stable/11/sys/cddl/dev/fbt/mips/fbt_isa.c   Mon Apr 16 14:10:19 2018
(r332565)
+++ stable/11/sys/cddl/dev/fbt/mips/fbt_isa.c   Mon Apr 16 14:39:04 2018
(r332566)
@@ -82,7 +82,6 @@ fbt_provide_module_function(linker_file_t lf, int symi
 linker_symval_t *symval, void *opaque)
 {
fbt_probe_t *fbt, *retfbt;
-   uint32_t *target, *start;
uint32_t *instr, *limit;
const char *name;
char *modname;

Modified: stable/11/sys/mips/conf/ERL
==
--- stable/11/sys/mips/conf/ERL Mon Apr 16 14:10:19 2018(r332565)
+++ stable/11/sys/mips/conf/ERL Mon Apr 16 14:39:04 2018(r332566)
@@ -85,15 +85,16 @@ options PRINTF_BUFR_SIZE=128# Prevent printf output 
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 optionsAUDIT   # Security event auditing
 optionsMAC # TrustedBSD MAC Framework
-#options   KDTRACE_FRAME   # Ensure frames are compiled in
-#options   KDTRACE_HOOKS   # Kernel DTrace hooks
-optionsINCLUDE_CONFIG_FILE # Include this file in kernel
+optionsKDTRACE_FRAME   # Ensure frames are compiled in
+optionsKDTRACE_HOOKS   # Kernel DTrace hooks
+optionsDDB_CTF # Kernel ELF linker loads CTF data
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 optionsNO_SWAPPING # Disable support for paging
 optionsTMPFS   # Temporary file system
 
 # Debugging for use in -current
 #options   KDB # Enable kernel debugger support.
-#options   DDB # Support DDB.
+optionsDDB # Support DDB.
 #options   GDB # Support remote GDB.
 #options   DEADLKRES   # Enable the deadlock resolver
 #options   INVARIANTS  # Enable calls of extra sanity checking

Modified: stable/11/sys/modules/dtrace/Makefile
==
--- stable/11/sys/modules/dtrace/Makefile   Mon Apr 16 14:10:19 2018
(r332565)
+++ stable/11/sys/modules/dtrace/Makefile   Mon Apr 16 14:39:04 2018
(r332566)
@@ -21,10 +21,14 @@ SUBDIR+=systrace_linux32
 .if ${MACHINE_CPUARCH} == "powerpc"
 SUBDIR+=   fbt fasttrap
 .endif
-.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
+.if ${MACHINE_CPUARCH} == "amd64" || \
+${MACHINE_ARCH} == "mips64" || \
+${MACHINE_ARCH} == "powerpc64"
 SUBDIR+=   systrace_freebsd32
 .endif
-.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "aarch64" || \
+${MACHINE_CPUARCH} == "arm" || \
+${MACHINE_CPUARCH} == "mips"
 SUBDIR+=   fbt
 .endif
 

svn commit: r332575 - in stable/11: share/man/man4 sys/dev/usb/template

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:42:26 2018
New Revision: 332575
URL: https://svnweb.freebsd.org/changeset/base/332575

Log:
  MFC r328194:
  
  Add sysctls to control device side USB identifiers. This makes it
  possible to change string and numeric vendor and product identifiers,
  as well as anything else there might be to change for a particular
  device side template, eg the MAC address.
  
  Relnotes: yes

Modified:
  stable/11/share/man/man4/usb_template.4
  stable/11/sys/dev/usb/template/usb_template.c
  stable/11/sys/dev/usb/template/usb_template.h
  stable/11/sys/dev/usb/template/usb_template_audio.c
  stable/11/sys/dev/usb/template/usb_template_cdce.c
  stable/11/sys/dev/usb/template/usb_template_kbd.c
  stable/11/sys/dev/usb/template/usb_template_midi.c
  stable/11/sys/dev/usb/template/usb_template_modem.c
  stable/11/sys/dev/usb/template/usb_template_mouse.c
  stable/11/sys/dev/usb/template/usb_template_msc.c
  stable/11/sys/dev/usb/template/usb_template_mtp.c
  stable/11/sys/dev/usb/template/usb_template_phone.c
  stable/11/sys/dev/usb/template/usb_template_serialnet.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/usb_template.4
==
--- stable/11/share/man/man4/usb_template.4 Mon Apr 16 15:39:34 2018
(r332574)
+++ stable/11/share/man/man4/usb_template.4 Mon Apr 16 15:42:26 2018
(r332575)
@@ -61,11 +61,12 @@ descriptors.
 .
 USB templates are selected using the
 .Va hw.usb.template
-sysctl and tunable.
-.
-The
-.Va hw.usb.template
-value can be changed at any time, but will not
+sysctl and tunable,
+or by using the
+.Xr usbconfig 8
+.Cm set_template
+subcommand.
+The sysctl values can be changed at any time, but will not
 have any effect until the USB device has been re-enumerated.
 .
 Available templates are:
@@ -83,10 +84,32 @@ Available templates are:
 .It Dv 9 Ta USB MIDI
 .El
 .
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width indent
+.It Va hw.usb.template
+Currently selected template.
+.It Va hw.usb.templates.N
+Configuration for template number
+.Va N .
+.It Va hw.usb.templates.N.vendor_id
+16-bit vendor identifier (VID), usually assigned by USB-IF.
+.It Va hw.usb.templates.N.product_id
+16-bit product identifier (PID).
+.It Va hw.usb.templates.N.manufacturer
+String containing human-readable manufacturer name.
+.It Va hw.usb.templates.N.product
+String containing human-readable product name.
+.El
 .Sh SEE ALSO
 .Xr cfumass 4 ,
 .Xr usb 4 ,
-.Xr usfs 4
+.Xr usfs 4 ,
+.Xr usbconfig 8
 .Sh STANDARDS
 The
 .Nm

Modified: stable/11/sys/dev/usb/template/usb_template.c
==
--- stable/11/sys/dev/usb/template/usb_template.c   Mon Apr 16 15:39:34 
2018(r332574)
+++ stable/11/sys/dev/usb/template/usb_template.c   Mon Apr 16 15:42:26 
2018(r332575)
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #defineUSB_DEBUG_VAR usb_debug
 #include 
@@ -73,6 +74,9 @@
 #include 
 #endif /* USB_GLOBAL_INCLUDE_FILE */
 
+SYSCTL_NODE(_hw_usb, OID_AUTO, templates, CTLFLAG_RW, 0,
+"USB device side templates");
+
 MODULE_DEPEND(usb_template, usb, 1, 1, 1);
 MODULE_VERSION(usb_template, 1);
 
@@ -110,6 +114,50 @@ static usb_error_t usb_temp_get_desc(struct usb_device
 static usb_error_t usb_temp_setup_by_index(struct usb_device *,
uint16_t index);
 static voidusb_temp_init(void *);
+
+/**
+ * usb_decode_str_desc
+ *
+ * Helper function to decode string descriptors into a C string.
+ **/
+void
+usb_decode_str_desc(struct usb_string_descriptor *sd, char *buf, size_t buflen)
+{
+   size_t i;
+
+   for (i = 0; i < buflen - 1 && i < sd->bLength / 2; i++)
+   buf[i] = UGETW(sd->bString[i]);
+
+   buf[i] = '\0';
+}
+
+/**
+ * usb_temp_sysctl
+ *
+ * Callback for SYSCTL_PROC(9), to set and retrieve template string
+ * descriptors.
+ **/
+int
+usb_temp_sysctl(SYSCTL_HANDLER_ARGS)
+{
+   char buf[128];
+   struct usb_string_descriptor *sd = arg1;
+   size_t len, sdlen = arg2;
+   int error;
+
+   usb_decode_str_desc(sd, buf, sizeof(buf));
+
+   error = sysctl_handle_string(oidp, buf, sizeof(buf), req);
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+
+   len = usb_make_str_desc(sd, sdlen, buf);
+   if (len == 0)
+   return (EINVAL);
+
+   return (0);
+}
+
 
 /**
  

svn commit: r332587 - stable/11/etc/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:58:53 2018
New Revision: 332587
URL: https://svnweb.freebsd.org/changeset/base/332587

Log:
  MFC r326251:
  
  Rename /etc/autofs/include_nis to /etc/autofs/include_nis_nullfs, to indicate
  that this script provides nullfs map rewriting for local mounts.

Added:
  stable/11/etc/autofs/include_nis_nullfs
 - copied unchanged from r326251, head/etc/autofs/include_nis_nullfs
Deleted:
  stable/11/etc/autofs/include_nis
Modified:
  stable/11/etc/autofs/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/Makefile
==
--- stable/11/etc/autofs/Makefile   Mon Apr 16 15:58:02 2018
(r332586)
+++ stable/11/etc/autofs/Makefile   Mon Apr 16 15:58:53 2018
(r332587)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 FILES= include_ldap \
-   include_nis \
+   include_nis_nullfs \
special_hosts \
special_media \
special_noauto \

Copied: stable/11/etc/autofs/include_nis_nullfs (from r326251, 
head/etc/autofs/include_nis_nullfs)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/etc/autofs/include_nis_nullfs Mon Apr 16 15:58:53 2018
(r332587, copy of r326251, head/etc/autofs/include_nis_nullfs)
@@ -0,0 +1,180 @@
+#!/usr/bin/awk -f
+#-
+# Copyright (c) 2017 G. Paul Ziemba
+# All rights reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#  1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+#  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+#  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+#  SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+#
+# /etc/autofs/include_nis_nullfs
+#
+# automountd Directory Services script for NIS
+#
+# SYNOPSIS
+#   include_nis_nullfs 
+#
+#   include_nis_nullfs  
+#
+# DESCRIPTION
+#
+#   This script provides a Directory Services map for automountd
+#   based on NIS. Please see auto_master(5) for general information.
+#
+#   The first form, with one argument, emits the entire named NIS map.
+#   The second form, with two arguments, emits the map entry for the
+#   key given in the second argument. 
+#
+#   This script attempts to determine the names and IP addresses
+#   of the local host. Map entries matching the local host are
+#   rewritten to specify nullfs mounts (instead of the default
+#   NFS) to reduce access overhead in the kernel.
+#
+#  If a map entry contains multiple location fields, it is not changed.
+#
+
+
+# Populate list of names and IP addrs thet mean "this host"
+# into myhostnames array
+BEGIN {
+#
+# Set self hostnames
+#
+
+"hostname -s" | getline;
+myhostnames[$0] = 1;
+
+"hostname -f" | getline;
+myhostnames[$0] = 1;
+
+myhostnames["localhost"] = 1
+
+"hostname -f" | getline;
+localdomain=$0
+myhostnames["localhost."localdomain] = 1
+
+while ("ifconfig" | getline) {
+   if ($1 == "inet") {
+   myhostnames[$2] = 1;
+   }
+}
+
+# debug
+#print "--- hostname list start "
+#for (i in myhostnames) {
+#print i
+#}
+#print "--- hostname list end "
+
+if (ARGC == 2) {
+   # mapname only
+   while ("ypcat -k " ARGV[1] | getline) {
+   proc_mapline(1)
+   }
+}
+if (ARGC == 3) {
+   # mapname and keyname
+   while ("ypmatch " ARGV[2] " " ARGV[1] | getline) {
+   proc_mapline(0)
+   }
+}
+exit 0
+}
+
+function is_self(hostname)
+{
+if (myhostnames[hostname]) {
+   return 1
+}
+return 0
+}
+
+#
+# Lines are of the form [key] [-opts] location1 [... locationN]
+#
+# indicate index of key field with first 

svn commit: r332592 - stable/11/share/man/man9

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:06:27 2018
New Revision: 332592
URL: https://svnweb.freebsd.org/changeset/base/332592

Log:
  MFC r325403:
  
  Add missing MLINKS for disk_add_alias(9).

Modified:
  stable/11/share/man/man9/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/Makefile
==
--- stable/11/share/man/man9/Makefile   Mon Apr 16 16:02:54 2018
(r332591)
+++ stable/11/share/man/man9/Makefile   Mon Apr 16 16:06:27 2018
(r332592)
@@ -722,7 +722,8 @@ MLINKS+=devstat.9 devicestat.9 \
devstat.9 devstat_end_transaction.9 \
devstat.9 devstat_remove_entry.9 \
devstat.9 devstat_start_transaction.9
-MLINKS+=disk.9 disk_alloc.9 \
+MLINKS+=disk.9 disk_add_alias.9 \
+   disk.9 disk_alloc.9 \
disk.9 disk_create.9 \
disk.9 disk_destroy.9 \
disk.9 disk_gone.9 \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332596 - stable/11/sys/fs/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:15:31 2018
New Revision: 332596
URL: https://svnweb.freebsd.org/changeset/base/332596

Log:
  MFC r328339:
  
  Add SPDX tags to autofs(5).

Modified:
  stable/11/sys/fs/autofs/autofs.h
  stable/11/sys/fs/autofs/autofs_ioctl.h
  stable/11/sys/fs/autofs/autofs_vfsops.c
  stable/11/sys/fs/autofs/autofs_vnops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/autofs/autofs.h
==
--- stable/11/sys/fs/autofs/autofs.hMon Apr 16 16:14:05 2018
(r332595)
+++ stable/11/sys/fs/autofs/autofs.hMon Apr 16 16:15:31 2018
(r332596)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/sys/fs/autofs/autofs_ioctl.h
==
--- stable/11/sys/fs/autofs/autofs_ioctl.h  Mon Apr 16 16:14:05 2018
(r332595)
+++ stable/11/sys/fs/autofs/autofs_ioctl.h  Mon Apr 16 16:15:31 2018
(r332596)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2013 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/sys/fs/autofs/autofs_vfsops.c
==
--- stable/11/sys/fs/autofs/autofs_vfsops.c Mon Apr 16 16:14:05 2018
(r332595)
+++ stable/11/sys/fs/autofs/autofs_vfsops.c Mon Apr 16 16:15:31 2018
(r332596)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/sys/fs/autofs/autofs_vnops.c
==
--- stable/11/sys/fs/autofs/autofs_vnops.c  Mon Apr 16 16:14:05 2018
(r332595)
+++ stable/11/sys/fs/autofs/autofs_vnops.c  Mon Apr 16 16:15:31 2018
(r332596)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332577 - stable/11/sys/dev/usb/template

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:46:24 2018
New Revision: 332577
URL: https://svnweb.freebsd.org/changeset/base/332577

Log:
  MFC r328197:
  
  Remove unused index.

Modified:
  stable/11/sys/dev/usb/template/usb_template_serialnet.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/template/usb_template_serialnet.c
==
--- stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Apr 16 
15:44:03 2018(r332576)
+++ stable/11/sys/dev/usb/template/usb_template_serialnet.c Mon Apr 16 
15:46:24 2018(r332577)
@@ -81,7 +81,6 @@ enum {
SERIALNET_ETH_MAC_INDEX,
SERIALNET_ETH_CONTROL_INDEX,
SERIALNET_ETH_DATA_INDEX,
-   SERIALNET_ETH_CONFIG_INDEX,
SERIALNET_CONFIGURATION_INDEX,
SERIALNET_MANUFACTURER_INDEX,
SERIALNET_PRODUCT_INDEX,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332583 - stable/11/usr.sbin/ctld

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:53:44 2018
New Revision: 332583
URL: https://svnweb.freebsd.org/changeset/base/332583

Log:
  MFC r325390:
  
  Use proper naming in a debug message.

Modified:
  stable/11/usr.sbin/ctld/login.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/ctld/login.c
==
--- stable/11/usr.sbin/ctld/login.c Mon Apr 16 15:52:52 2018
(r332582)
+++ stable/11/usr.sbin/ctld/login.c Mon Apr 16 15:53:44 2018
(r332583)
@@ -437,7 +437,7 @@ login_chap(struct connection *conn, struct auth_group 
 * Yay, authentication succeeded!
 */
log_debugx("authentication succeeded for user \"%s\"; "
-   "transitioning to Negotiation Phase", auth->a_user);
+   "transitioning to operational parameter negotiation", auth->a_user);
login_send_chap_success(request, auth);
pdu_delete(request);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332595 - stable/11/usr.sbin/ctld

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:14:05 2018
New Revision: 332595
URL: https://svnweb.freebsd.org/changeset/base/332595

Log:
  MFC r328337:
  
  Add missing SPDX tags for ctld(8).

Modified:
  stable/11/usr.sbin/ctld/chap.c
  stable/11/usr.sbin/ctld/isns.c
  stable/11/usr.sbin/ctld/uclparse.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/ctld/chap.c
==
--- stable/11/usr.sbin/ctld/chap.c  Mon Apr 16 16:12:30 2018
(r332594)
+++ stable/11/usr.sbin/ctld/chap.c  Mon Apr 16 16:14:05 2018
(r332595)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/ctld/isns.c
==
--- stable/11/usr.sbin/ctld/isns.c  Mon Apr 16 16:12:30 2018
(r332594)
+++ stable/11/usr.sbin/ctld/isns.c  Mon Apr 16 16:14:05 2018
(r332595)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2014 Alexander Motin 
  * All rights reserved.
  *

Modified: stable/11/usr.sbin/ctld/uclparse.c
==
--- stable/11/usr.sbin/ctld/uclparse.c  Mon Apr 16 16:12:30 2018
(r332594)
+++ stable/11/usr.sbin/ctld/uclparse.c  Mon Apr 16 16:14:05 2018
(r332595)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2015 iXsystems Inc.
  * All rights reserved.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332569 - stable/11/sys/sparc64/sparc64

2018-04-16 Thread Kurt Lidl
Author: lidl
Date: Mon Apr 16 14:42:25 2018
New Revision: 332569
URL: https://svnweb.freebsd.org/changeset/base/332569

Log:
  MFC r324512: Don't use a non-zero argument for __builtin_frame_address
  
  Mirror the change made for powerpc64 in r323687.  With this
  change, gcc 6.4.0 can successfully compile and link a kernel
  that runs on sparc64.

Modified:
  stable/11/sys/sparc64/sparc64/stack_machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sparc64/sparc64/stack_machdep.c
==
--- stable/11/sys/sparc64/sparc64/stack_machdep.c   Mon Apr 16 14:41:12 
2018(r332568)
+++ stable/11/sys/sparc64/sparc64/stack_machdep.c   Mon Apr 16 14:42:25 
2018(r332569)
@@ -93,5 +93,5 @@ void
 stack_save(struct stack *st)
 {
 
-   stack_capture(st, (struct frame *)__builtin_frame_address(1));
+   stack_capture(st, (struct frame *)__builtin_frame_address(0));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332574 - stable/11/sys/dev/usb/template

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:39:34 2018
New Revision: 332574
URL: https://svnweb.freebsd.org/changeset/base/332574

Log:
  MFC r324626:
  
  Replace some magic numbers in usb_template(4) code with #defines.
  There should be no functional changes.

Modified:
  stable/11/sys/dev/usb/template/usb_template_audio.c
  stable/11/sys/dev/usb/template/usb_template_kbd.c
  stable/11/sys/dev/usb/template/usb_template_midi.c
  stable/11/sys/dev/usb/template/usb_template_modem.c
  stable/11/sys/dev/usb/template/usb_template_mouse.c
  stable/11/sys/dev/usb/template/usb_template_phone.c
  stable/11/sys/dev/usb/template/usb_template_serialnet.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/template/usb_template_audio.c
==
--- stable/11/sys/dev/usb/template/usb_template_audio.c Mon Apr 16 15:13:18 
2018(r332573)
+++ stable/11/sys/dev/usb/template/usb_template_audio.c Mon Apr 16 15:39:34 
2018(r332574)
@@ -199,8 +199,8 @@ static const void *audio_raw_iface_0_desc[] = {
 static const struct usb_temp_interface_desc audio_iface_0 = {
.ppEndpoints = NULL,/* no endpoints */
.ppRawDesc = audio_raw_iface_0_desc,
-   .bInterfaceClass = 1,
-   .bInterfaceSubClass = 1,
+   .bInterfaceClass = UICLASS_AUDIO,
+   .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL,
.bInterfaceProtocol = 0,
.iInterface = INDEX_AUDIO_MIXER,
 };
@@ -257,8 +257,8 @@ static const struct usb_temp_endpoint_desc *audio_ifac
 static const struct usb_temp_interface_desc audio_iface_1_alt_0 = {
.ppEndpoints = NULL,/* no endpoints */
.ppRawDesc = NULL,  /* no raw descriptors */
-   .bInterfaceClass = 1,
-   .bInterfaceSubClass = 2,
+   .bInterfaceClass = UICLASS_AUDIO,
+   .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM,
.bInterfaceProtocol = 0,
.iInterface = INDEX_AUDIO_PLAYBACK,
 };
@@ -266,8 +266,8 @@ static const struct usb_temp_interface_desc audio_ifac
 static const struct usb_temp_interface_desc audio_iface_1_alt_1 = {
.ppEndpoints = audio_iface_1_ep,
.ppRawDesc = audio_raw_iface_1_desc,
-   .bInterfaceClass = 1,
-   .bInterfaceSubClass = 2,
+   .bInterfaceClass = UICLASS_AUDIO,
+   .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM,
.bInterfaceProtocol = 0,
.iInterface = INDEX_AUDIO_PLAYBACK,
.isAltInterface = 1,/* this is an alternate setting */
@@ -315,8 +315,8 @@ static const struct usb_temp_endpoint_desc *audio_ifac
 static const struct usb_temp_interface_desc audio_iface_2_alt_0 = {
.ppEndpoints = NULL,/* no endpoints */
.ppRawDesc = NULL,  /* no raw descriptors */
-   .bInterfaceClass = 1,
-   .bInterfaceSubClass = 2,
+   .bInterfaceClass = UICLASS_AUDIO,
+   .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM,
.bInterfaceProtocol = 0,
.iInterface = INDEX_AUDIO_RECORD,
 };
@@ -324,8 +324,8 @@ static const struct usb_temp_interface_desc audio_ifac
 static const struct usb_temp_interface_desc audio_iface_2_alt_1 = {
.ppEndpoints = audio_iface_2_ep,
.ppRawDesc = audio_raw_iface_2_desc,
-   .bInterfaceClass = 1,
-   .bInterfaceSubClass = 2,
+   .bInterfaceClass = UICLASS_AUDIO,
+   .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM,
.bInterfaceProtocol = 0,
.iInterface = INDEX_AUDIO_RECORD,
.isAltInterface = 1,/* this is an alternate setting */

Modified: stable/11/sys/dev/usb/template/usb_template_kbd.c
==
--- stable/11/sys/dev/usb/template/usb_template_kbd.c   Mon Apr 16 15:13:18 
2018(r332573)
+++ stable/11/sys/dev/usb/template/usb_template_kbd.c   Mon Apr 16 15:39:34 
2018(r332574)
@@ -130,9 +130,9 @@ static const void *keyboard_iface_0_desc[] = {
 static const struct usb_temp_interface_desc keyboard_iface_0 = {
.ppRawDesc = keyboard_iface_0_desc,
.ppEndpoints = keyboard_endpoints,
-   .bInterfaceClass = 3,
-   .bInterfaceSubClass = 1,
-   .bInterfaceProtocol = 1,
+   .bInterfaceClass = UICLASS_HID,
+   .bInterfaceSubClass = UISUBCLASS_BOOT,
+   .bInterfaceProtocol = UIPROTO_BOOT_KEYBOARD,
.iInterface = INDEX_KEYBOARD,
 };
 

Modified: stable/11/sys/dev/usb/template/usb_template_midi.c
==
--- stable/11/sys/dev/usb/template/usb_template_midi.c  Mon Apr 16 15:13:18 
2018(r332573)
+++ stable/11/sys/dev/usb/template/usb_template_midi.c  Mon Apr 16 15:39:34 
2018(r332574)
@@ -89,8 +89,8 @@ static const void *midi_descs_0[] = {
 static const struct usb_temp_interface_desc midi_iface_0 = {
.ppEndpoints = NULL,/* no endpoints */
.ppRawDesc = midi_descs_0,
-  

svn commit: r332578 - stable/11/sys/dev/usb/template

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:48:15 2018
New Revision: 332578
URL: https://svnweb.freebsd.org/changeset/base/332578

Log:
  MFC r328219:
  
  Add missing manufacturer/serial number string descriptors.

Modified:
  stable/11/sys/dev/usb/template/usb_template_audio.c
  stable/11/sys/dev/usb/template/usb_template_kbd.c
  stable/11/sys/dev/usb/template/usb_template_midi.c
  stable/11/sys/dev/usb/template/usb_template_modem.c
  stable/11/sys/dev/usb/template/usb_template_mouse.c
  stable/11/sys/dev/usb/template/usb_template_phone.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/template/usb_template_audio.c
==
--- stable/11/sys/dev/usb/template/usb_template_audio.c Mon Apr 16 15:46:24 
2018(r332577)
+++ stable/11/sys/dev/usb/template/usb_template_audio.c Mon Apr 16 15:48:15 
2018(r332578)
@@ -70,19 +70,25 @@ enum {
AUDIO_MIXER_INDEX,
AUDIO_RECORD_INDEX,
AUDIO_PLAYBACK_INDEX,
+   AUDIO_MANUFACTURER_INDEX,
AUDIO_PRODUCT_INDEX,
+   AUDIO_SERIAL_NUMBER_INDEX,
AUDIO_MAX_INDEX,
 };
 
-#defineAUDIO_DEFAULT_PRODUCT   "Audio Test Device"
 #defineAUDIO_DEFAULT_MIXER "Mixer interface"
 #defineAUDIO_DEFAULT_RECORD"Record interface"
 #defineAUDIO_DEFAULT_PLAYBACK  "Playback interface"
+#defineAUDIO_DEFAULT_MANUFACTURER  "FreeBSD foundation"
+#defineAUDIO_DEFAULT_PRODUCT   "Audio Test Device"
+#defineAUDIO_DEFAULT_SERIAL_NUMBER "March 2008"
 
 static struct usb_string_descriptoraudio_mixer;
 static struct usb_string_descriptoraudio_record;
 static struct usb_string_descriptoraudio_playback;
+static struct usb_string_descriptoraudio_manufacturer;
 static struct usb_string_descriptoraudio_product;
+static struct usb_string_descriptoraudio_serial_number;
 
 static struct sysctl_ctx_list  audio_ctx_list;
 
@@ -362,7 +368,9 @@ struct usb_temp_device_desc usb_template_audio = {
.bDeviceClass = UDCLASS_COMM,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
+   .iManufacturer = AUDIO_MANUFACTURER_INDEX,
.iProduct = AUDIO_PRODUCT_INDEX,
+   .iSerialNumber = AUDIO_SERIAL_NUMBER_INDEX,
 };
 
 /**
@@ -380,7 +388,9 @@ audio_get_string_desc(uint16_t lang_id, uint8_t string
[AUDIO_MIXER_INDEX] = _mixer,
[AUDIO_RECORD_INDEX] = _record,
[AUDIO_PLAYBACK_INDEX] = _playback,
+   [AUDIO_MANUFACTURER_INDEX] = _manufacturer,
[AUDIO_PRODUCT_INDEX] = _product,
+   [AUDIO_SERIAL_NUMBER_INDEX] = _serial_number,
};
 
if (string_index == 0) {
@@ -407,8 +417,12 @@ audio_init(void *arg __unused)
AUDIO_DEFAULT_RECORD);
usb_make_str_desc(_playback, sizeof(audio_playback),
AUDIO_DEFAULT_PLAYBACK);
+   usb_make_str_desc(_manufacturer, sizeof(audio_manufacturer),
+   AUDIO_DEFAULT_MANUFACTURER);
usb_make_str_desc(_product, sizeof(audio_product),
AUDIO_DEFAULT_PRODUCT);
+   usb_make_str_desc(_serial_number, sizeof(audio_serial_number),
+   AUDIO_DEFAULT_SERIAL_NUMBER);
 
snprintf(parent_name, sizeof(parent_name), "%d", USB_TEMP_AUDIO);
sysctl_ctx_init(_ctx_list);
@@ -438,9 +452,17 @@ audio_init(void *arg __unused)
"A", "Playback interface string");
 #endif
SYSCTL_ADD_PROC(_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
+   "manufacturer", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
+   _manufacturer, sizeof(audio_manufacturer), usb_temp_sysctl,
+   "A", "Manufacturer string");
+   SYSCTL_ADD_PROC(_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
_product, sizeof(audio_product), usb_temp_sysctl,
"A", "Product string");
+   SYSCTL_ADD_PROC(_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
+   "serial_number", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
+   _serial_number, sizeof(audio_serial_number), usb_temp_sysctl,
+   "A", "Serial number string");
 }
 
 static void

Modified: stable/11/sys/dev/usb/template/usb_template_kbd.c
==
--- stable/11/sys/dev/usb/template/usb_template_kbd.c   Mon Apr 16 15:46:24 
2018(r332577)
+++ stable/11/sys/dev/usb/template/usb_template_kbd.c   Mon Apr 16 15:48:15 
2018(r332578)
@@ -68,15 +68,21 @@
 enum {
KBD_LANG_INDEX,
KBD_INTERFACE_INDEX,
+   KBD_MANUFACTURER_INDEX,
KBD_PRODUCT_INDEX,
+   KBD_SERIAL_NUMBER_INDEX,
KBD_MAX_INDEX,
 };
 
 #defineKBD_DEFAULT_INTERFACE   "Keyboard Interface"
+#define   

svn commit: r332588 - stable/11/etc/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:59:51 2018
New Revision: 332588
URL: https://svnweb.freebsd.org/changeset/base/332588

Log:
  MFC r326252:
  
  Add /etc/autofs/include_nis, a non-rewriting NIS map.

Added:
  stable/11/etc/autofs/include_nis
 - copied unchanged from r326252, head/etc/autofs/include_nis
Modified:
  stable/11/etc/autofs/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/Makefile
==
--- stable/11/etc/autofs/Makefile   Mon Apr 16 15:58:53 2018
(r332587)
+++ stable/11/etc/autofs/Makefile   Mon Apr 16 15:59:51 2018
(r332588)
@@ -1,6 +1,7 @@
 # $FreeBSD$
 
 FILES= include_ldap \
+   include_nis \
include_nis_nullfs \
special_hosts \
special_media \

Copied: stable/11/etc/autofs/include_nis (from r326252, 
head/etc/autofs/include_nis)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/etc/autofs/include_nisMon Apr 16 15:59:51 2018
(r332588, copy of r326252, head/etc/autofs/include_nis)
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+if [ -n "$2" ]; then
+   ypmatch $2 $1
+   exit 0
+fi
+
+if [ -n "$1" ]; then
+   ypcat -k $1
+   exit 0
+fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332590 - stable/11/etc/rc.d

2018-04-16 Thread Kristof Provost
Author: kp
Date: Mon Apr 16 16:02:09 2018
New Revision: 332590
URL: https://svnweb.freebsd.org/changeset/base/332590

Log:
  MFC r331546:
  
  pf: reload and resync do the same thing
  
  The reload and resync commands for the startup script do exactly the same
  thing, so implement one as a call to the other.

Modified:
  stable/11/etc/rc.d/pf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.d/pf
==
--- stable/11/etc/rc.d/pf   Mon Apr 16 16:01:06 2018(r332589)
+++ stable/11/etc/rc.d/pf   Mon Apr 16 16:02:09 2018(r332590)
@@ -53,12 +53,12 @@ pf_check()
 pf_reload()
 {
echo "Reloading pf rules."
-   $pf_program -n -f "$pf_rules" $pf_flags || return 1
-   $pf_program -f "$pf_rules" $pf_flags
+   pf_resync
 }
 
 pf_resync()
 {
+   $pf_program -n -f "$pf_rules" $pf_flags || return 1
$pf_program -f "$pf_rules" $pf_flags
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332591 - stable/10/etc/rc.d

2018-04-16 Thread Kristof Provost
Author: kp
Date: Mon Apr 16 16:02:54 2018
New Revision: 332591
URL: https://svnweb.freebsd.org/changeset/base/332591

Log:
  MFC r331546:
  
  pf: reload and resync do the same thing
  
  The reload and resync commands for the startup script do exactly the same
  thing, so implement one as a call to the other.

Modified:
  stable/10/etc/rc.d/pf
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/etc/rc.d/pf
==
--- stable/10/etc/rc.d/pf   Mon Apr 16 16:02:09 2018(r332590)
+++ stable/10/etc/rc.d/pf   Mon Apr 16 16:02:54 2018(r332591)
@@ -52,12 +52,12 @@ pf_check()
 pf_reload()
 {
echo "Reloading pf rules."
-   $pf_program -n -f "$pf_rules" $pf_flags || return 1
-   $pf_program -f "$pf_rules" $pf_flags
+   pf_resync
 }
 
 pf_resync()
 {
+   $pf_program -n -f "$pf_rules" $pf_flags || return 1
$pf_program -f "$pf_rules" $pf_flags
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332594 - stable/11/bin/ps

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:12:30 2018
New Revision: 332594
URL: https://svnweb.freebsd.org/changeset/base/332594

Log:
  MFC r326430:
  
  Add "vmaddr" ps(1) keyword.

Modified:
  stable/11/bin/ps/keyword.c
  stable/11/bin/ps/ps.1
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/ps/keyword.c
==
--- stable/11/bin/ps/keyword.c  Mon Apr 16 16:10:16 2018(r332593)
+++ stable/11/bin/ps/keyword.c  Mon Apr 16 16:12:30 2018(r332594)
@@ -225,6 +225,8 @@ static VAR var[] = {
{"usertime", "USERTIME", NULL, "user-time", USER, usertime, 0, CHAR,
NULL, 0},
{"usrpri", "", "upr", NULL, 0, NULL, 0, CHAR, NULL, 0},
+   {"vmaddr", "VMADDR", NULL, "vmspace-address", 0, kvar, KOFF(ki_vmspace),
+   KPTR, "lx", 0},
{"vsize", "", "vsz", NULL, 0, NULL, 0, CHAR, NULL, 0},
{"vsz", "VSZ", NULL, "virtual-size", 0, vsize, 0, CHAR, NULL, 0},
{"wchan", "WCHAN", NULL, "wait-channel", LJUST, wchan, 0, CHAR, NULL,

Modified: stable/11/bin/ps/ps.1
==
--- stable/11/bin/ps/ps.1   Mon Apr 16 16:10:16 2018(r332593)
+++ stable/11/bin/ps/ps.1   Mon Apr 16 16:12:30 2018(r332594)
@@ -708,6 +708,8 @@ process pointer
 user name (from UID)
 .It Cm usertime
 accumulated user CPU time
+.It Cm vmaddr
+vmspace pointer
 .It Cm vsz
 virtual size in Kbytes (alias
 .Cm vsize )
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332571 - stable/11/contrib/blacklist/libexec

2018-04-16 Thread Kurt Lidl
Author: lidl
Date: Mon Apr 16 14:46:02 2018
New Revision: 332571
URL: https://svnweb.freebsd.org/changeset/base/332571

Log:
  MFC r328861: Update blacklist-helper to not emit messages from pf during 
operation.
  
  Use 'pfctl -k' when blocking a site to kill active tcp connections
  from the blocked address.
  
  Fix 'purge' operation for pf, which must dynamically determine which
  filters have been created, so the filters can be flushed by name.

Modified:
  stable/11/contrib/blacklist/libexec/blacklistd-helper
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/blacklist/libexec/blacklistd-helper
==
--- stable/11/contrib/blacklist/libexec/blacklistd-helper   Mon Apr 16 
14:43:01 2018(r332570)
+++ stable/11/contrib/blacklist/libexec/blacklistd-helper   Mon Apr 16 
14:46:02 2018(r332571)
@@ -80,8 +80,8 @@ add)
echo "block in quick $proto from  to any $port" | \
/sbin/pfctl -a "$2/$6" -f -
# insert $ip/$mask into per-protocol/port anchored table
-   /sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \
-   echo OK
+   /sbin/pfctl -qa "$2/$6" -t "port$6" -T add "$addr/$mask" && \
+   /sbin/pfctl -q -k $addr && echo OK
;;
esac
;;
@@ -101,7 +101,7 @@ rem)
/sbin/npfctl rule "$2" rem-id "$7"
;;
pf)
-   /sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \
+   /sbin/pfctl -qa "$2/$6" -t "port$6" -T delete "$addr/$mask" && \
echo OK
;;
esac
@@ -118,7 +118,13 @@ flush)
/sbin/npfctl rule "$2" flush
;;
pf)
-   /sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK
+   # dynamically determine which anchors exist
+   anchors=$(/sbin/pfctl -a $2 -s Anchors)
+   for anchor in $anchors; do
+   /sbin/pfctl -a $anchor -t "port${anchor##*/}" -T flush
+   /sbin/pfctl -a $anchor -F rules
+   done
+   echo OK
;;
esac
;;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332561 - head/stand/efi/boot1

2018-04-16 Thread Ed Maste
On 16 April 2018 at 09:18, Kyle Evans  wrote:
> Author: kevans
> Date: Mon Apr 16 13:18:18 2018
> New Revision: 332561
> URL: https://svnweb.freebsd.org/changeset/base/332561
>
> Log:
>   Rename volume label for ESP

The desire to remove boot1.efifat notwithstanding, you'll also need to
regenerate and commit the FAT templates for this change to take
effect.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332573 - head/stand/efi/boot1

2018-04-16 Thread Kyle Evans
Author: kevans
Date: Mon Apr 16 15:13:18 2018
New Revision: 332573
URL: https://svnweb.freebsd.org/changeset/base/332573

Log:
  Regenerate FAT templates after r332561

Modified:
  head/stand/efi/boot1/fat-amd64.tmpl.xz
  head/stand/efi/boot1/fat-arm.tmpl.xz
  head/stand/efi/boot1/fat-arm64.tmpl.xz
  head/stand/efi/boot1/fat-i386.tmpl.xz

Modified: head/stand/efi/boot1/fat-amd64.tmpl.xz
==
Binary file (source and/or target). No diff available.

Modified: head/stand/efi/boot1/fat-arm.tmpl.xz
==
Binary file (source and/or target). No diff available.

Modified: head/stand/efi/boot1/fat-arm64.tmpl.xz
==
Binary file (source and/or target). No diff available.

Modified: head/stand/efi/boot1/fat-i386.tmpl.xz
==
Binary file (source and/or target). No diff available.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332580 - stable/11/usr.sbin/usbconfig

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:50:10 2018
New Revision: 332580
URL: https://svnweb.freebsd.org/changeset/base/332580

Log:
  MFC r327522:
  
  Fix warnings from "mandoc -Tlint -Wwarning".

Modified:
  stable/11/usr.sbin/usbconfig/usbconfig.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/usbconfig/usbconfig.8
==
--- stable/11/usr.sbin/usbconfig/usbconfig.8Mon Apr 16 15:49:16 2018
(r332579)
+++ stable/11/usr.sbin/usbconfig/usbconfig.8Mon Apr 16 15:50:10 2018
(r332580)
@@ -144,7 +144,6 @@ See
 for more information.
 .El
 .Sh EXAMPLES
-.Pp
 Show information about the device on USB bus 1 at address 2:
 .Pp
 .Dl usbconfig -d ugen1.2 dump_info
@@ -172,7 +171,6 @@ Program the device on USB bus 1 at address 2 to suspen
 .Dl usbconfig -d ugen1.2 power_off
 .Dl usbconfig -d ugen1.2 power_save
 .Dl usbconfig -d ugen1.2 power_on
-.Pp
 .Sh SEE ALSO
 .Xr usb 4 ,
 .Xr usb_quirk 4 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332584 - stable/11/etc/rc.d

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:54:38 2018
New Revision: 332584
URL: https://svnweb.freebsd.org/changeset/base/332584

Log:
  MFC r325400:
  
  Make autofs(5) rc scripts run earlier, matching those for amd(8).
  
  This helps when you have some daemons that need to access automounted shares.
  
  PR:   221011

Modified:
  stable/11/etc/rc.d/automount
  stable/11/etc/rc.d/automountd
  stable/11/etc/rc.d/autounmountd
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/rc.d/automount
==
--- stable/11/etc/rc.d/automountMon Apr 16 15:53:44 2018
(r332583)
+++ stable/11/etc/rc.d/automountMon Apr 16 15:54:38 2018
(r332584)
@@ -5,6 +5,7 @@
 
 # PROVIDE: automount
 # REQUIRE: nfsclient automountd
+# BEFORE: DAEMON
 # KEYWORD: nojail shutdown
 
 . /etc/rc.subr

Modified: stable/11/etc/rc.d/automountd
==
--- stable/11/etc/rc.d/automountd   Mon Apr 16 15:53:44 2018
(r332583)
+++ stable/11/etc/rc.d/automountd   Mon Apr 16 15:54:38 2018
(r332584)
@@ -4,7 +4,8 @@
 #
 
 # PROVIDE: automountd
-# REQUIRE: DAEMON
+# REQUIRE: rpcbind ypset nfsclient FILESYSTEMS ldconfig
+# BEFORE: DAEMON
 # KEYWORD: nojail
 
 . /etc/rc.subr

Modified: stable/11/etc/rc.d/autounmountd
==
--- stable/11/etc/rc.d/autounmountd Mon Apr 16 15:53:44 2018
(r332583)
+++ stable/11/etc/rc.d/autounmountd Mon Apr 16 15:54:38 2018
(r332584)
@@ -4,7 +4,8 @@
 #
 
 # PROVIDE: autounmountd
-# REQUIRE: DAEMON
+# REQUIRE: FILESYSTEMS
+# BEFORE: DAEMON
 # KEYWORD: nojail
 
 . /etc/rc.subr
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332582 - stable/11/tools/tools/fetchbench

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 15:52:52 2018
New Revision: 332582
URL: https://svnweb.freebsd.org/changeset/base/332582

Log:
  MFC r325312:
  
  Add fetchbench, a trivial HTTP benchmark based on fetch(1).

Added:
  stable/11/tools/tools/fetchbench/
 - copied from r325312, head/tools/tools/fetchbench/
Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332589 - stable/11/etc/autofs

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:01:06 2018
New Revision: 332589
URL: https://svnweb.freebsd.org/changeset/base/332589

Log:
  MFC r329312 by eadler@:
  
  etc: clean up trailing whitespace in autofs

Modified:
  stable/11/etc/autofs/special_media
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/autofs/special_media
==
--- stable/11/etc/autofs/special_media  Mon Apr 16 15:59:51 2018
(r332588)
+++ stable/11/etc/autofs/special_media  Mon Apr 16 16:01:06 2018
(r332589)
@@ -41,7 +41,7 @@ print_map_entry() {
case "${_fstype}" in
"exfat")
if [ -f "/usr/local/sbin/mount.exfat" ]; then
-   echo 
"-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},nosuid   :/dev/${_p}" 
+   echo 
"-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},nosuid   :/dev/${_p}"
else
/usr/bin/logger -p info -t "special_media[$$]" \
"Cannot mount ${_fstype} formatted device 
/dev/${_p}: Install sysutils/fusefs-exfat first"
@@ -50,7 +50,7 @@ print_map_entry() {
;;
"ntfs")
if [ -f "/usr/local/bin/ntfs-3g" ]; then
-   echo 
"-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid:/dev/${_p}" 
+   echo 
"-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid:/dev/${_p}"
else
/usr/bin/logger -p info -t "special_media[$$]" \
"Cannot mount ${_fstype} formatted device 
/dev/${_p}: Install sysutils/fusefs-ntfs first"
@@ -58,10 +58,10 @@ print_map_entry() {
fi
;;
"ext2fs" | "msdosfs")
-   echo "-fstype=${_fstype},nosuid,async   :/dev/${_p}" 
+   echo "-fstype=${_fstype},nosuid,async   :/dev/${_p}"
;;
*)
-   echo "-fstype=${_fstype},nosuid :/dev/${_p}" 
+   echo "-fstype=${_fstype},nosuid :/dev/${_p}"
;;
esac
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332593 - in stable/11: usr.bin/gprof usr.sbin/kgmon

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 16:10:16 2018
New Revision: 332593
URL: https://svnweb.freebsd.org/changeset/base/332593

Log:
  MFC r326248:
  
  .Xr pmcstat(8) from kgmon(8) and gprof(1).

Modified:
  stable/11/usr.bin/gprof/gprof.1
  stable/11/usr.sbin/kgmon/kgmon.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/gprof/gprof.1
==
--- stable/11/usr.bin/gprof/gprof.1 Mon Apr 16 16:06:27 2018
(r332592)
+++ stable/11/usr.bin/gprof/gprof.1 Mon Apr 16 16:10:16 2018
(r332593)
@@ -28,7 +28,7 @@
 .\"@(#)gprof.1 8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd December 25, 2008
+.Dd November 27, 2017
 .Dt GPROF 1
 .Os
 .Sh NAME
@@ -272,7 +272,8 @@ Summarized dynamic call graph and profile.
 .Sh SEE ALSO
 .Xr cc 1 ,
 .Xr profil 2 ,
-.Xr clocks 7
+.Xr clocks 7 ,
+.Xr pmcstat 8
 .\" .Xr monitor 3 ,
 .\" .Xr prof 1
 .Rs

Modified: stable/11/usr.sbin/kgmon/kgmon.8
==
--- stable/11/usr.sbin/kgmon/kgmon.8Mon Apr 16 16:06:27 2018
(r332592)
+++ stable/11/usr.sbin/kgmon/kgmon.8Mon Apr 16 16:10:16 2018
(r332593)
@@ -28,7 +28,7 @@
 .\" @(#)kgmon.88.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd June 6, 1993
+.Dd November 27, 2017
 .Dt KGMON 8
 .Os
 .Sh NAME
@@ -121,7 +121,8 @@ file with the warning that the data may be
 inconsistent if profiling is in progress.
 .Sh SEE ALSO
 .Xr gprof 1 ,
-.Xr config 8
+.Xr config 8 ,
+.Xr pmcstat 8
 .Sh HISTORY
 The
 .Nm
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332559 - head/usr.sbin/mountd

2018-04-16 Thread Rick Macklem
Julian Elischer wrote:
>On 16/4/18 6:56 pm, Konstantin Belousov wrote:
[stuff snipped]
>>> +ngroups = XU_NGROUPS + 1;
>> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ?
>valid question.. because that is how many are allocated?
>it was a "minimally invasive patch".. whoever used XU_NGROUPS before
>should have fixed it.
>Having said that, thanks for drawing out attention to it.. will
>probably fix.
16 is the limit specified in the RFCs for Sun RPC, so that is the "on the wire"
limit.
I haven't looked at the code. It might make sense to handle more here and then
set the limit at 16 after getting rid of duplicates, but I have no idea if it 
matters?

rick
[more stuff snipped]

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


svn commit: r332560 - head/stand/common

2018-04-16 Thread Toomas Soome
Author: tsoome
Date: Mon Apr 16 12:46:14 2018
New Revision: 332560
URL: https://svnweb.freebsd.org/changeset/base/332560

Log:
  loader: make sure we do not return garbage from help_getnext
  
  Since we do free subtopic and desc in help_getnext(), we need to set them also
  NULL, so we make sure we dont get double free().
  
  Approved by:  bapt
  Differential Revision:https://reviews.freebsd.org/D15082

Modified:
  head/stand/common/commands.c

Modified: head/stand/common/commands.c
==
--- head/stand/common/commands.cMon Apr 16 09:17:36 2018
(r332559)
+++ head/stand/common/commands.cMon Apr 16 12:46:14 2018
(r332560)
@@ -74,7 +74,6 @@ help_getnext(int fd, char **topic, char **subtopic, ch
if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' '))
continue;
 
-   *topic = *subtopic = *desc = NULL;
cp = line + 2;
while((cp != NULL) && (*cp != 0)) {
ep = strchr(cp, ' ');
@@ -95,6 +94,7 @@ help_getnext(int fd, char **topic, char **subtopic, ch
if (*topic == NULL) {
free(*subtopic);
free(*desc);
+   *subtopic = *desc = NULL;
continue;
}
return(1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332561 - head/stand/efi/boot1

2018-04-16 Thread Kyle Evans
Author: kevans
Date: Mon Apr 16 13:18:18 2018
New Revision: 332561
URL: https://svnweb.freebsd.org/changeset/base/332561

Log:
  Rename volume label for ESP
  
  Harry Schmalzbauer reports that some firmware, in his experience, trips
  over the ESP we install due to the volume label. It has been theorized that
  this is due to some confusion with the label and the path on the ESP to
  boot1.efi.
  
  Regardless, Harry found that renaming the label seems to fix it.
  
  PR:   214282
  MFC after:3 days

Modified:
  head/stand/efi/boot1/generate-fat.sh

Modified: head/stand/efi/boot1/generate-fat.sh
==
--- head/stand/efi/boot1/generate-fat.shMon Apr 16 12:46:14 2018
(r332560)
+++ head/stand/efi/boot1/generate-fat.shMon Apr 16 13:18:18 2018
(r332561)
@@ -42,7 +42,7 @@ while read ARCH FILENAME; do
 
dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$FAT_SIZE
DEVICE=`mdconfig -a -f $OUTPUT_FILE`
-   newfs_msdos -F 12 -L EFI $DEVICE
+   newfs_msdos -F 12 -L EFISYS $DEVICE
mkdir stub
mount -t msdosfs /dev/$DEVICE stub
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332565 - head/stand/common

2018-04-16 Thread Toomas Soome
Author: tsoome
Date: Mon Apr 16 14:10:19 2018
New Revision: 332565
URL: https://svnweb.freebsd.org/changeset/base/332565

Log:
  loader: cstyle cleanup of command.c
  
  just clean it up. no functional changes intended.
  
  Reviewed by:  imp
  Differential Revision:https://reviews.freebsd.org/D15087

Modified:
  head/stand/common/commands.c

Modified: head/stand/common/commands.c
==
--- head/stand/common/commands.cMon Apr 16 13:52:40 2018
(r332564)
+++ head/stand/common/commands.cMon Apr 16 14:10:19 2018
(r332565)
@@ -61,155 +61,160 @@ here
 COMMAND_SET(help, "help", "detailed help", command_help);
 
 static int
-help_getnext(int fd, char **topic, char **subtopic, char **desc) 
+help_getnext(int fd, char **topic, char **subtopic, char **desc)
 {
-char   line[81], *cp, *ep;
+   charline[81], *cp, *ep;
 
-/* Make sure we provide sane values. */
-*topic = *subtopic = *desc = NULL;
-for (;;) {
-   if (fgetstr(line, 80, fd) < 0)
-   return(0);
-   
-   if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' '))
-   continue;
+   /* Make sure we provide sane values. */
+   *topic = *subtopic = *desc = NULL;
+   for (;;) {
+   if (fgetstr(line, 80, fd) < 0)
+   return (0);
 
-   cp = line + 2;
-   while((cp != NULL) && (*cp != 0)) {
-   ep = strchr(cp, ' ');
-   if ((*cp == 'T') && (*topic == NULL)) {
-   if (ep != NULL)
-   *ep++ = 0;
-   *topic = strdup(cp + 1);
-   } else if ((*cp == 'S') && (*subtopic == NULL)) {
-   if (ep != NULL)
-   *ep++ = 0;
-   *subtopic = strdup(cp + 1);
-   } else if (*cp == 'D') {
-   *desc = strdup(cp + 1);
-   ep = NULL;
-   }
-   cp = ep;
+   if (strlen(line) < 3 || line[0] != '#' || line[1] != ' ')
+   continue;
+
+   cp = line + 2;
+   while (cp != NULL && *cp != 0) {
+   ep = strchr(cp, ' ');
+   if (*cp == 'T' && *topic == NULL) {
+   if (ep != NULL)
+   *ep++ = 0;
+   *topic = strdup(cp + 1);
+   } else if (*cp == 'S' && *subtopic == NULL) {
+   if (ep != NULL)
+   *ep++ = 0;
+   *subtopic = strdup(cp + 1);
+   } else if (*cp == 'D') {
+   *desc = strdup(cp + 1);
+   ep = NULL;
+   }
+   cp = ep;
+   }
+   if (*topic == NULL) {
+   free(*subtopic);
+   free(*desc);
+   *subtopic = *desc = NULL;
+   continue;
+   }
+   return (1);
}
-   if (*topic == NULL) {
-   free(*subtopic);
-   free(*desc);
-   *subtopic = *desc = NULL;
-   continue;
-   }
-   return(1);
-}
 }
 
 static int
 help_emitsummary(char *topic, char *subtopic, char *desc)
 {
-inti;
-
-pager_output("");
-pager_output(topic);
-i = strlen(topic);
-if (subtopic != NULL) {
-   pager_output(" ");
-   pager_output(subtopic);
-   i += strlen(subtopic) + 1;
-}
-if (desc != NULL) {
-   do {
-   pager_output(" ");
-   } while (i++ < 30);
-   pager_output(desc);
-}
-return (pager_output("\n"));
+   int i;
+
+   pager_output("");
+   pager_output(topic);
+   i = strlen(topic);
+   if (subtopic != NULL) {
+   pager_output(" ");
+   pager_output(subtopic);
+   i += strlen(subtopic) + 1;
+   }
+   if (desc != NULL) {
+   do {
+   pager_output(" ");
+   } while (i++ < 30);
+   pager_output(desc);
+   }
+   return (pager_output("\n"));
 }
 
-   
+
 static int
-command_help(int argc, char *argv[]) 
+command_help(int argc, char *argv[])
 {
-char   buf[81];/* XXX buffer size? */
-inthfd, matched, doindex;
-char   *topic, *subtopic, *t, *s, *d;
+   charbuf[81];/* XXX buffer size? */
+   int hfd, matched, doindex;
+   char*topic, *subtopic, *t, *s, *d;
 
-/* page the help text from our load path */
-snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev"));
-if ((hfd = open(buf, O_RDONLY)) < 0) {
-   printf("Verbose help not available, use '?' to list commands\n");
-   return(CMD_OK);
-}
+   /* page the help text from our load 

Re: svn commit: r332559 - head/usr.sbin/mountd

2018-04-16 Thread Konstantin Belousov
On Mon, Apr 16, 2018 at 09:17:36AM +, Andriy Gapon wrote:
> Author: avg
> Date: Mon Apr 16 09:17:36 2018
> New Revision: 332559
> URL: https://svnweb.freebsd.org/changeset/base/332559
> 
> Log:
>   mountd: fix a crash when getgrouplist reports too many groups
>   
>   Previously the code only warned about the condition and then happily
>   proceeded to use the too large value resulting in the array
>   out-of-bounds access.
>   
>   Obtained from:  Panzura (Chuanbo Zheng)
>   MFC after:  10 days
>   Sponsored by:   Panzura
> 
> Modified:
>   head/usr.sbin/mountd/mountd.c
> 
> Modified: head/usr.sbin/mountd/mountd.c
> ==
> --- head/usr.sbin/mountd/mountd.c Mon Apr 16 08:41:44 2018
> (r332558)
> +++ head/usr.sbin/mountd/mountd.c Mon Apr 16 09:17:36 2018
> (r332559)
> @@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr)
>   }
>   cr->cr_uid = pw->pw_uid;
>   ngroups = XU_NGROUPS + 1;
> - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, ))
> + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) {
>   syslog(LOG_ERR, "too many groups");
> + ngroups = XU_NGROUPS + 1;
Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ?

> + }
> +
>   /*
>* Compress out duplicate.
>*/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332563 - in head/sys: arm/include ddb mips/include powerpc/include sparc64/include

2018-04-16 Thread Warner Losh
Author: imp
Date: Mon Apr 16 13:52:23 2018
New Revision: 332563
URL: https://svnweb.freebsd.org/changeset/base/332563

Log:
  No need to force md code to define a macro that's the same as
  _BYTE_ORDER. Use that instead.

Modified:
  head/sys/arm/include/db_machdep.h
  head/sys/ddb/db_access.c
  head/sys/mips/include/db_machdep.h
  head/sys/powerpc/include/db_machdep.h
  head/sys/sparc64/include/db_machdep.h

Modified: head/sys/arm/include/db_machdep.h
==
--- head/sys/arm/include/db_machdep.h   Mon Apr 16 13:50:01 2018
(r332562)
+++ head/sys/arm/include/db_machdep.h   Mon Apr 16 13:52:23 2018
(r332563)
@@ -95,7 +95,4 @@ int db_validate_address(vm_offset_t);
 
 u_int branch_taken (u_int insn, db_addr_t pc);
 
-#ifdef __ARMEB__
-#define BYTE_MSF   (1)
-#endif
 #endif /* !_MACHINE_DB_MACHDEP_H_ */

Modified: head/sys/ddb/db_access.c
==
--- head/sys/ddb/db_access.cMon Apr 16 13:50:01 2018(r332562)
+++ head/sys/ddb/db_access.cMon Apr 16 13:52:23 2018(r332563)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -51,10 +52,6 @@ static unsigned db_extend[] = {  /* table for sign-exte
0xFF80U
 };
 
-#ifndef BYTE_MSF
-#defineBYTE_MSF0
-#endif
-
 db_expr_t
 db_get_value(db_addr_t addr, int size, bool is_signed)
 {
@@ -69,9 +66,9 @@ db_get_value(db_addr_t addr, int size, bool is_signed)
}
 
value = 0;
-#ifBYTE_MSF
+#if _BYTE_ORDER == _BIG_ENDIAN
for (i = 0; i < size; i++)
-#else  /* BYTE_LSF */
+#else  /* _LITTLE_ENDIAN */
for (i = size - 1; i >= 0; i--)
 #endif
{
@@ -91,9 +88,9 @@ db_put_value(db_addr_t addr, int size, db_expr_t value
chardata[sizeof(int)];
int i;
 
-#ifBYTE_MSF
+#if _BYTE_ORDER == _BIG_ENDIAN
for (i = size - 1; i >= 0; i--)
-#else  /* BYTE_LSF */
+#else  /* _LITTLE_ENDIAN */
for (i = 0; i < size; i++)
 #endif
{

Modified: head/sys/mips/include/db_machdep.h
==
--- head/sys/mips/include/db_machdep.h  Mon Apr 16 13:50:01 2018
(r332562)
+++ head/sys/mips/include/db_machdep.h  Mon Apr 16 13:52:23 2018
(r332563)
@@ -41,17 +41,12 @@
 
 #include 
 #include 
-#include 
 
 typedef struct trapframe db_regs_t;
 extern db_regs_t   ddb_regs;   /* register state */
 
 typedefvm_offset_t db_addr_t;  /* address - unsigned */
 typedefregister_t  db_expr_t;  /* expression - signed */
-
-#if BYTE_ORDER == _BIG_ENDIAN
-#defineBYTE_MSF(1)
-#endif
 
 #defineSOFTWARE_SSTEP  /* Need software single step */
 #defineSOFTWARE_SSTEP_EMUL /* next_instr_address() emulates 100% */

Modified: head/sys/powerpc/include/db_machdep.h
==
--- head/sys/powerpc/include/db_machdep.h   Mon Apr 16 13:50:01 2018
(r332562)
+++ head/sys/powerpc/include/db_machdep.h   Mon Apr 16 13:52:23 2018
(r332563)
@@ -40,8 +40,6 @@
 #defineDB_ELF_SYMBOLS
 #defineDB_ELFSIZE  __ELF_WORD_SIZE
 
-#define BYTE_MSF(1)
-
 typedefvm_offset_t db_addr_t;  /* address - unsigned */
 typedefintptr_tdb_expr_t;  /* expression - signed */
 

Modified: head/sys/sparc64/include/db_machdep.h
==
--- head/sys/sparc64/include/db_machdep.h   Mon Apr 16 13:50:01 2018
(r332562)
+++ head/sys/sparc64/include/db_machdep.h   Mon Apr 16 13:52:23 2018
(r332563)
@@ -33,8 +33,6 @@
 #include 
 #include 
 
-#defineBYTE_MSF(1)
-
 typedef vm_offset_tdb_addr_t;
 typedef long   db_expr_t;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332564 - head/sys/i386/i386

2018-04-16 Thread Warner Losh
Author: imp
Date: Mon Apr 16 13:52:40 2018
New Revision: 332564
URL: https://svnweb.freebsd.org/changeset/base/332564

Log:
  Use bool instead of boolean_t here. No reason to use boolean_t.
  
  Also, stop passing FALSE to a bool parameter.

Modified:
  head/sys/i386/i386/db_trace.c

Modified: head/sys/i386/i386/db_trace.c
==
--- head/sys/i386/i386/db_trace.c   Mon Apr 16 13:52:23 2018
(r332563)
+++ head/sys/i386/i386/db_trace.c   Mon Apr 16 13:52:40 2018
(r332564)
@@ -216,7 +216,7 @@ db_numargs(fp)
int inst;
int args;
 
-   argp = (char *)db_get_value((int)>f_retaddr, 4, FALSE);
+   argp = (char *)db_get_value((int)>f_retaddr, 4, false);
/*
 * XXX etext is wrong for LKMs.  We should attempt to interpret
 * the instruction at the return address in all cases.  This
@@ -226,7 +226,7 @@ db_numargs(fp)
args = -1;
} else {
 retry:
-   inst = db_get_value((int)argp, 4, FALSE);
+   inst = db_get_value((int)argp, 4, false);
if ((inst & 0xff) == 0x59)  /* popl %ecx */
args = 1;
else if ((inst & 0x) == 0xc483) /* addl $Ibs, %esp */
@@ -255,7 +255,7 @@ db_print_stack_entry(name, narg, argnp, argp, callpc, 
while (n) {
if (argnp)
db_printf("%s=", *argnp++);
-   db_printf("%r", db_get_value((int)argp, 4, FALSE));
+   db_printf("%r", db_get_value((int)argp, 4, false));
argp++;
if (--n != 0)
db_printf(",");
@@ -304,8 +304,8 @@ db_nextframe(struct i386_frame **fp, db_addr_t *ip, st
c_db_sym_t sym;
const char *name;
 
-   eip = db_get_value((int) &(*fp)->f_retaddr, 4, FALSE);
-   ebp = db_get_value((int) &(*fp)->f_frame, 4, FALSE);
+   eip = db_get_value((int) &(*fp)->f_retaddr, 4, false);
+   ebp = db_get_value((int) &(*fp)->f_frame, 4, false);
 
/*
 * Figure out frame type.  We look at the address just before
@@ -435,7 +435,7 @@ db_backtrace(struct thread *td, struct trapframe *tf, 
db_expr_t offset;
c_db_sym_t sym;
int instr, narg;
-   boolean_t first;
+   bool first;
 
if (db_segsize(tf) == 16) {
db_printf(
@@ -473,13 +473,13 @@ db_backtrace(struct thread *td, struct trapframe *tf, 
instr = (int)(kdb_frame + 1);
else
instr = (int)_frame->tf_esp;
-   pc = db_get_value(instr, 4, FALSE);
+   pc = db_get_value(instr, 4, false);
}
 
if (count == -1)
count = 1024;
 
-   first = TRUE;
+   first = true;
while (count-- && !db_pager_quit) {
sym = db_search_symbol(pc, DB_STGY_ANY, );
db_symbol_values(sym, , NULL);
@@ -497,7 +497,7 @@ db_backtrace(struct thread *td, struct trapframe *tf, 
 */
actframe = frame;
if (first) {
-   first = FALSE;
+   first = false;
if (sym == C_DB_SYM_NULL && sp != 0) {
/*
 * If a symbol couldn't be found, we've probably
@@ -506,13 +506,13 @@ db_backtrace(struct thread *td, struct trapframe *tf, 
 */
db_print_stack_entry(name, 0, 0, 0, pc,
NULL);
-   pc = db_get_value(sp, 4, FALSE);
+   pc = db_get_value(sp, 4, false);
if (db_search_symbol(pc, DB_STGY_PROC,
) == C_DB_SYM_NULL)
break;
continue;
} else if (tf != NULL) {
-   instr = db_get_value(pc, 4, FALSE);
+   instr = db_get_value(pc, 4, false);
if ((instr & 0xff) == 0x00e58955) {
/* pushl %ebp; movl %esp, %ebp */
actframe = (void *)(get_esp(tf) - 4);
@@ -554,7 +554,7 @@ db_backtrace(struct thread *td, struct trapframe *tf, 
if (actframe != frame) {
/* `frame' belongs to caller. */
pc = (db_addr_t)
-   db_get_value((int)>f_retaddr, 4, FALSE);
+   db_get_value((int)>f_retaddr, 4, false);
continue;
}
 
@@ -588,7 +588,7 @@ db_trace_self(void)
 
__asm __volatile("movl %%ebp,%0" : "=r" (ebp));
frame = (struct i386_frame *)ebp;
-   callpc = 

Re: svn commit: r332559 - head/usr.sbin/mountd

2018-04-16 Thread Andriy Gapon
On 16/04/2018 13:56, Konstantin Belousov wrote:
> On Mon, Apr 16, 2018 at 09:17:36AM +, Andriy Gapon wrote:
>> Author: avg
>> Date: Mon Apr 16 09:17:36 2018
>> New Revision: 332559
>> URL: https://svnweb.freebsd.org/changeset/base/332559
>>
>> Log:
>>   mountd: fix a crash when getgrouplist reports too many groups
>>   
>>   Previously the code only warned about the condition and then happily
>>   proceeded to use the too large value resulting in the array
>>   out-of-bounds access.
>>   
>>   Obtained from: Panzura (Chuanbo Zheng)
>>   MFC after: 10 days
>>   Sponsored by:  Panzura
>>
>> Modified:
>>   head/usr.sbin/mountd/mountd.c
>>
>> Modified: head/usr.sbin/mountd/mountd.c
>> ==
>> --- head/usr.sbin/mountd/mountd.cMon Apr 16 08:41:44 2018
>> (r332558)
>> +++ head/usr.sbin/mountd/mountd.cMon Apr 16 09:17:36 2018
>> (r332559)
>> @@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr)
>>  }
>>  cr->cr_uid = pw->pw_uid;
>>  ngroups = XU_NGROUPS + 1;
>> -if (getgrouplist(pw->pw_name, pw->pw_gid, groups, ))
>> +if (getgrouplist(pw->pw_name, pw->pw_gid, groups, )) {
>>  syslog(LOG_ERR, "too many groups");
>> +ngroups = XU_NGROUPS + 1;
> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ?

Two reasons:

1. it's what the code already used
2. the groups are placed into struct xucred and later that struct is passed to
kernel, so in my opinion it's xucred that defines the limit in this case


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


svn commit: r332562 - stable/11/usr.bin/dtc

2018-04-16 Thread Kyle Evans
Author: kevans
Date: Mon Apr 16 13:50:01 2018
New Revision: 332562
URL: https://svnweb.freebsd.org/changeset/base/332562

Log:
  MFC r332483:
  
  dtc(1): Update to upstream 006664a
  
  Highlights:
  
  - Passing "-" to -o will now cause output to go to stdout
  - Path-based syntactic sugar for overlays is now accepted. This looks like:
  
  /dts-v1/;
  /plugin/;
  
  &{/soc} {
  sid: eeprom@1c14000 {
  compatible = "allwinner,sun8i-h3-sid";
  reg = <0x1c14000 0x400>;
  status = "okay";
  };
  };

Modified:
  stable/11/usr.bin/dtc/dtc.1
  stable/11/usr.bin/dtc/dtc.cc
  stable/11/usr.bin/dtc/fdt.cc
  stable/11/usr.bin/dtc/fdt.hh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/dtc/dtc.1
==
--- stable/11/usr.bin/dtc/dtc.1 Mon Apr 16 13:18:18 2018(r332561)
+++ stable/11/usr.bin/dtc/dtc.1 Mon Apr 16 13:50:01 2018(r332562)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd January 17, 2018
+.Dd April 7, 2018
 .Dt DTC 1
 .Os
 .Sh NAME
@@ -275,7 +275,7 @@ tree when the overlay is applied.
 .Pp
 Much simpler syntactic sugar was later invented to simplify generating 
overlays.
 Instead of creating targetted fragments manually, one can instead create a root
-node that targets a label in the base node using the
+node that targets a label in the base FDT using the
 .Va 
 syntax supported in conventional DTS.
 This will indicate that a fragment should be generated for the node, with the
@@ -283,6 +283,19 @@ given
 .Va label
 being the target, and the properties and child nodes will be used as the
 __overlay__.
+.Pp
+Additionally, a path-based version of this syntactic sugar is supported.
+A root node may target a path in the base FDT using a name of the form
+.Va &{/path} .
+A fragment will be generated for the node as it is in the
+.Va 
+case, except the
+.Va target-path
+property will be set to
+.Va /path
+and no
+.Va target
+will be set.
 .Pp
 Both conventional overlays and the later-added syntactic sugar are supported.
 .Pp

Modified: stable/11/usr.bin/dtc/dtc.cc
==
--- stable/11/usr.bin/dtc/dtc.ccMon Apr 16 13:18:18 2018
(r332561)
+++ stable/11/usr.bin/dtc/dtc.ccMon Apr 16 13:50:01 2018
(r332562)
@@ -171,11 +171,14 @@ main(int argc, char **argv)
case 'o':
{
outfile_name = optarg;
-   outfile = open(optarg, O_CREAT | O_TRUNC | O_WRONLY, 
0666);
-   if (outfile == -1)
+   if (strcmp(outfile_name, "-") != 0)
{
-   perror("Unable to open output file");
-   return EXIT_FAILURE;
+   outfile = open(optarg, O_CREAT | O_TRUNC | 
O_WRONLY, 0666);
+   if (outfile == -1)
+   {
+   perror("Unable to open output file");
+   return EXIT_FAILURE;
+   }
}
break;
}

Modified: stable/11/usr.bin/dtc/fdt.cc
==
--- stable/11/usr.bin/dtc/fdt.ccMon Apr 16 13:18:18 2018
(r332561)
+++ stable/11/usr.bin/dtc/fdt.ccMon Apr 16 13:50:01 2018
(r332562)
@@ -727,14 +727,32 @@ node::parse_name(text_input_buffer , bool _pr
return n;
 }
 
-void
-node::visit(std::function fn)
+node::visit_behavior
+node::visit(std::function fn, node *parent)
 {
-   fn(*this);
-   for (auto & : children)
+   visit_behavior behavior;
+   behavior = fn(*this, parent);
+   if (behavior == VISIT_BREAK)
{
-   c->visit(fn);
+   return VISIT_BREAK;
}
+   else if (behavior != VISIT_CONTINUE)
+   {
+   for (auto & : children)
+   {
+   behavior = c->visit(fn, this);
+   // Any status other than VISIT_RECURSE stops our 
execution and
+   // bubbles up to our caller.  The caller may then 
either continue
+   // visiting nodes that are siblings to this one or 
completely halt
+   // visiting.
+   if (behavior != VISIT_RECURSE)
+   {
+   return behavior;
+   }
+   }
+   }
+   // Continue recursion by default
+   return VISIT_RECURSE;
 }
 
 node::node(input_buffer , input_buffer ) : valid(true)
@@ -1319,7 +1337,7 @@ device_tree::resolve_cross_references(uint32_t 
phandle_set.insert({, i});
}

svn commit: r332567 - in stable/11: lib/libprocstat usr.bin/procstat

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 14:39:34 2018
New Revision: 332567
URL: https://svnweb.freebsd.org/changeset/base/332567

Log:
  MFC r324237:
  
  Make procstat(1) recognize process descriptors, so that it shows
  "P" instead of "?" in "procstat -af" output. Note that there are
  still a few more DTYPE_* kinds we don't decode yet.
  
  Sponsored by: DARPA, AFRL

Modified:
  stable/11/lib/libprocstat/libprocstat.c
  stable/11/lib/libprocstat/libprocstat.h
  stable/11/usr.bin/procstat/procstat.1
  stable/11/usr.bin/procstat/procstat_files.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libprocstat/libprocstat.c
==
--- stable/11/lib/libprocstat/libprocstat.c Mon Apr 16 14:39:04 2018
(r332566)
+++ stable/11/lib/libprocstat/libprocstat.c Mon Apr 16 14:39:34 2018
(r332567)
@@ -579,6 +579,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struc
type = PS_FST_TYPE_SHM;
data = file.f_data;
break;
+   case DTYPE_PROCDESC:
+   type = PS_FST_TYPE_PROCDESC;
+   data = file.f_data;
+   break;
default:
continue;
}
@@ -662,6 +666,7 @@ kinfo_type2fst(int kftype)
int kf_type;
int fst_type;
} kftypes2fst[] = {
+   { KF_TYPE_PROCDESC, PS_FST_TYPE_PROCDESC },
{ KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO },
{ KF_TYPE_FIFO, PS_FST_TYPE_FIFO },
{ KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE },

Modified: stable/11/lib/libprocstat/libprocstat.h
==
--- stable/11/lib/libprocstat/libprocstat.h Mon Apr 16 14:39:04 2018
(r332566)
+++ stable/11/lib/libprocstat/libprocstat.h Mon Apr 16 14:39:34 2018
(r332567)
@@ -68,6 +68,7 @@
 #definePS_FST_TYPE_SEM 10
 #definePS_FST_TYPE_UNKNOWN 11
 #definePS_FST_TYPE_NONE12
+#definePS_FST_TYPE_PROCDESC13
 
 /*
  * Special descriptor numbers.

Modified: stable/11/usr.bin/procstat/procstat.1
==
--- stable/11/usr.bin/procstat/procstat.1   Mon Apr 16 14:39:04 2018
(r332566)
+++ stable/11/usr.bin/procstat/procstat.1   Mon Apr 16 14:39:34 2018
(r332567)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2017
+.Dd October 3, 2017
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -212,6 +212,8 @@ shared memory
 kqueue
 .It m
 message queue
+.It P
+process descriptor
 .It p
 pipe
 .It s

Modified: stable/11/usr.bin/procstat/procstat_files.c
==
--- stable/11/usr.bin/procstat/procstat_files.c Mon Apr 16 14:39:04 2018
(r332566)
+++ stable/11/usr.bin/procstat/procstat_files.c Mon Apr 16 14:39:34 2018
(r332567)
@@ -402,6 +402,11 @@ procstat_files(struct procstat *procstat, struct kinfo
xo_emit("{eq:fd_type/sem}");
break;
 
+   case PS_FST_TYPE_PROCDESC:
+   str = "P";
+   xo_emit("{eq:fd_type/procdesc}");
+   break;
+
case PS_FST_TYPE_NONE:
str = "?";
xo_emit("{eq:fd_type/none}");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r331722 - in stable/11: bin/cat bin/chflags bin/chmod bin/cp bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pax bin/ps b

2018-04-16 Thread Ian Lepore
On Sun, 2018-04-15 at 18:08 -0700, Eitan Adler wrote:
> On 15 April 2018 at 17:53, Kyle Evans  wrote:
> > 
> > On Sun, Apr 15, 2018 at 7:28 PM, Rodney W. Grimes
> >  wrote:
> > > 
> > > > 
> > > > On Wed, 2018-03-28 at 20:17 -0700, Rodney W. Grimes wrote:
> > > > > 
> > > > > [...]
> > > > > I tried to get this slowed down until we could get to a concenses,
> > > > > I think our mess is as big now as it was before.
> > > > > 
> > > > Or bigger. I've just discovered this commit reverted stuff that wasn't
> > > > part of the bad original MFC commit. Things I MFC'd to 11 before this
> > > > revert are now missing changes and the symptoms don't show up until a
> > > > module fails to load due to missing symbols.
> > > > 
> > > > I guess every change on the stable-11 branch between r330897 and
> > > > r331722 needs to be audited to see if MFC'd or changed code has been
> > > > unintentionally reverted.
> > > > 
> > > > Here's the example I've just run across...
> > > > 
> > > > r330897 merged this:
> > > > 
> > > > https://svnweb.freebsd.org/base/stable/11/sys/dev/spibus/ofw_spibus.c?r1=302408=330897
> > > > 
> > > > Then I did some MFCing, then r331722 "reverted" this:
> > > > 
> > > > https://svnweb.freebsd.org/base/stable/11/sys/dev/spibus/ofw_spibus.c?r1=331506=331722
> > > *sigh*  Ok, I can at least do an audit of the r331722
> > > that was suppose to be a revert and see what else I find.
> > > 
> > > I'll start on this tomarrow and get the first pass audit out fairly early
> > > in the morning my time (PST)
> > > 
> > > Do we revert the attempted revert, then properly revert the original?
> I am beyond confused. How did
> svn merge -c-r330897 .
> fail?
> 

If that's literally the command you entered, it may have been the extra
'-r' that caused a problem. To backout a single changelist, the command
is

  svn merge -c -330897 .

I wonder if that extra -r separated the changelist number from the -c
option, and in effect did a reverse-merge by revision number of
everything back to r330897?

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


Re: svn commit: r331722 - in stable/11: bin/cat bin/chflags bin/chmod bin/cp bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pax bin/ps b

2018-04-16 Thread Glen Barber
On Mon, Apr 16, 2018 at 01:00:21PM -0600, Ian Lepore wrote:
> On Sun, 2018-04-15 at 18:08 -0700, Eitan Adler wrote:
> > On 15 April 2018 at 17:53, Kyle Evans  wrote:
> > > 
> > > On Sun, Apr 15, 2018 at 7:28 PM, Rodney W. Grimes
> > >  wrote:
> > > > 
> > > > > 
> > > > > On Wed, 2018-03-28 at 20:17 -0700, Rodney W. Grimes wrote:
> > > > > > 
> > > > > > [...]
> > > > > > I tried to get this slowed down until we could get to a concenses,
> > > > > > I think our mess is as big now as it was before.
> > > > > > 
> > > > > Or bigger. I've just discovered this commit reverted stuff that wasn't
> > > > > part of the bad original MFC commit. Things I MFC'd to 11 before this
> > > > > revert are now missing changes and the symptoms don't show up until a
> > > > > module fails to load due to missing symbols.
> > > > > 
> > > > > I guess every change on the stable-11 branch between r330897 and
> > > > > r331722 needs to be audited to see if MFC'd or changed code has been
> > > > > unintentionally reverted.
> > > > > 
> > > > > Here's the example I've just run across...
> > > > > 
> > > > > r330897 merged this:
> > > > > 
> > > > > https://svnweb.freebsd.org/base/stable/11/sys/dev/spibus/ofw_spibus.c?r1=302408=330897
> > > > > 
> > > > > Then I did some MFCing, then r331722 "reverted" this:
> > > > > 
> > > > > https://svnweb.freebsd.org/base/stable/11/sys/dev/spibus/ofw_spibus.c?r1=331506=331722
> > > > *sigh*  Ok, I can at least do an audit of the r331722
> > > > that was suppose to be a revert and see what else I find.
> > > > 
> > > > I'll start on this tomarrow and get the first pass audit out fairly 
> > > > early
> > > > in the morning my time (PST)
> > > > 
> > > > Do we revert the attempted revert, then properly revert the original?
> > I am beyond confused. How did
> > svn merge -c-r330897 .
> > fail?
> > 
> 
> If that's literally the command you entered, it may have been the extra
> '-r' that caused a problem. To backout a single changelist, the command
> is
> 
>   svn merge -c -330897 .
> 
> I wonder if that extra -r separated the changelist number from the -c
> option, and in effect did a reverse-merge by revision number of
> everything back to r330897?
> 

In this example, both '-rNN' and '-NN' are synonymous.

Glen



signature.asc
Description: PGP signature


Re: svn commit: r332596 - stable/11/sys/fs/autofs

2018-04-16 Thread Edward Tomasz Napierala
On 0416T1145, Rodney W. Grimes wrote:
> [ Charset UTF-8 unsupported, converting... ]
> > Author: trasz
> > Date: Mon Apr 16 16:15:31 2018
> > New Revision: 332596
> > URL: https://svnweb.freebsd.org/changeset/base/332596
> > 
> > Log:
> >   MFC r328339:
> >   
> >   Add SPDX tags to autofs(5).
> > 
> 
> Please until I resolve the eadler miss merge/revirt mess with
> SPDX do NOT touch any SPDX stuff in 11/stable.

Ok.  Although, to be honest, I think I've already MFC-ed all the SPDX stuff
I had in my queue before seeing your mail, sorry for that.

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


Re: svn commit: r332596 - stable/11/sys/fs/autofs

2018-04-16 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: trasz
> Date: Mon Apr 16 16:15:31 2018
> New Revision: 332596
> URL: https://svnweb.freebsd.org/changeset/base/332596
> 
> Log:
>   MFC r328339:
>   
>   Add SPDX tags to autofs(5).
> 

Please until I resolve the eadler miss merge/revirt mess with
SPDX do NOT touch any SPDX stuff in 11/stable.

This is probably a remerge of what is already in those
patches.

Thanks,

> Modified:
>   stable/11/sys/fs/autofs/autofs.h
>   stable/11/sys/fs/autofs/autofs_ioctl.h
>   stable/11/sys/fs/autofs/autofs_vfsops.c
>   stable/11/sys/fs/autofs/autofs_vnops.c
> Directory Properties:
>   stable/11/   (props changed)
> 
> Modified: stable/11/sys/fs/autofs/autofs.h
> ==
> --- stable/11/sys/fs/autofs/autofs.h  Mon Apr 16 16:14:05 2018
> (r332595)
> +++ stable/11/sys/fs/autofs/autofs.h  Mon Apr 16 16:15:31 2018
> (r332596)
> @@ -1,4 +1,6 @@
>  /*-
> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> + *
>   * Copyright (c) 2014 The FreeBSD Foundation
>   * All rights reserved.
>   *
> 
> Modified: stable/11/sys/fs/autofs/autofs_ioctl.h
> ==
> --- stable/11/sys/fs/autofs/autofs_ioctl.hMon Apr 16 16:14:05 2018
> (r332595)
> +++ stable/11/sys/fs/autofs/autofs_ioctl.hMon Apr 16 16:15:31 2018
> (r332596)
> @@ -1,4 +1,6 @@
>  /*-
> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> + *
>   * Copyright (c) 2013 The FreeBSD Foundation
>   * All rights reserved.
>   *
> 
> Modified: stable/11/sys/fs/autofs/autofs_vfsops.c
> ==
> --- stable/11/sys/fs/autofs/autofs_vfsops.c   Mon Apr 16 16:14:05 2018
> (r332595)
> +++ stable/11/sys/fs/autofs/autofs_vfsops.c   Mon Apr 16 16:15:31 2018
> (r332596)
> @@ -1,4 +1,6 @@
>  /*-
> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> + *
>   * Copyright (c) 2014 The FreeBSD Foundation
>   * All rights reserved.
>   *
> 
> Modified: stable/11/sys/fs/autofs/autofs_vnops.c
> ==
> --- stable/11/sys/fs/autofs/autofs_vnops.cMon Apr 16 16:14:05 2018
> (r332595)
> +++ stable/11/sys/fs/autofs/autofs_vnops.cMon Apr 16 16:15:31 2018
> (r332596)
> @@ -1,4 +1,6 @@
>  /*-
> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> + *
>   * Copyright (c) 2014 The FreeBSD Foundation
>   * All rights reserved.
>   *
> 
> 

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


Re: svn commit: r332498 - head/sys/x86/cpufreq

2018-04-16 Thread John Baldwin
On Saturday, April 14, 2018 03:15:05 AM Conrad Meyer wrote:
> Author: cem
> Date: Sat Apr 14 03:15:05 2018
> New Revision: 332498
> URL: https://svnweb.freebsd.org/changeset/base/332498
> 
> Log:
>   cpufreq: Remove error-prone table terminators in favor of automatic sizing
>   
>   PR: 227388
>   Reported by:Vladimir Machulsky 
>   Sponsored by:   Dell EMC Isilon

Presumably you could use nitems() on ESTprocs as well rather than a terminator?

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


Re: svn commit: r332498 - head/sys/x86/cpufreq

2018-04-16 Thread Conrad Meyer
On Mon, Apr 16, 2018 at 10:11 AM, John Baldwin  wrote:
> On Saturday, April 14, 2018 03:15:05 AM Conrad Meyer wrote:
>> Author: cem
>> Date: Sat Apr 14 03:15:05 2018
>> New Revision: 332498
>> URL: https://svnweb.freebsd.org/changeset/base/332498
>>
>> Log:
>>   cpufreq: Remove error-prone table terminators in favor of automatic sizing
>>
>>   PR: 227388
>>   Reported by:Vladimir Machulsky 
>>   Sponsored by:   Dell EMC Isilon
>
> Presumably you could use nitems() on ESTprocs as well rather than a 
> terminator?

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


svn commit: r332632 - head/usr.bin/quota

2018-04-16 Thread Conrad Meyer
Author: cem
Date: Mon Apr 16 19:33:04 2018
New Revision: 332632
URL: https://svnweb.freebsd.org/changeset/base/332632

Log:
  quota(1): Fix calculation overflow and underflow
  
  For very large quotas, do the multiplication as a 64 bit value to avoid
  overflow.
  
  For very small block sizes (smaller than DEV_BSIZE), multiple first
  before dividing by block size to avoid underflow.
  
  PR:   227496
  Submitted by: Per Andersson 
  Sponsored by: Dell EMC Isilon

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

Modified: head/usr.bin/quota/quota.c
==
--- head/usr.bin/quota/quota.c  Mon Apr 16 18:12:15 2018(r332631)
+++ head/usr.bin/quota/quota.c  Mon Apr 16 19:33:04 2018(r332632)
@@ -621,14 +621,14 @@ getnfsquota(struct statfs *fst, struct quotause *qup, 
gettimeofday(, NULL);
/* blocks*/
dqp->dqb_bhardlimit =
-   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit *
-   (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
+   ((uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit 
*
+   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize) / DEV_BSIZE;
dqp->dqb_bsoftlimit =
-   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit *
-   (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
+   ((uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit 
*
+   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize) / DEV_BSIZE;
dqp->dqb_curblocks =
-   gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
-   (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
+   ((uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
+   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize) / DEV_BSIZE;
/* inodes */
dqp->dqb_ihardlimit =
gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332596 - stable/11/sys/fs/autofs

2018-04-16 Thread Rodney W. Grimes
> On 0416T1145, Rodney W. Grimes wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> > > Author: trasz
> > > Date: Mon Apr 16 16:15:31 2018
> > > New Revision: 332596
> > > URL: https://svnweb.freebsd.org/changeset/base/332596
> > > 
> > > Log:
> > >   MFC r328339:
> > >   
> > >   Add SPDX tags to autofs(5).
> > > 
> > 
> > Please until I resolve the eadler miss merge/revirt mess with
> > SPDX do NOT touch any SPDX stuff in 11/stable.
> 
> Ok.  Although, to be honest, I think I've already MFC-ed all the SPDX stuff
> I had in my queue before seeing your mail, sorry for that.

Could you do me a really big favor and see if any of the mfc's you
did is in this list:
Merged /head:r325966,326022-326025,326027,326192-326193,326219,326255-326261

If they are could you list them.  That should save me some time on the clean
up process as likely if you merged something in that list I am going to
revert it when r330897 is reverted, so I need to know to reapply it.

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


svn commit: r332634 - stable/11/sys/netinet

2018-04-16 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 16 21:17:18 2018
New Revision: 332634
URL: https://svnweb.freebsd.org/changeset/base/332634

Log:
  MFC r332269:
  
  Fix a signed/unsigned warning showing up for the userland stack
  on some platforms.
  Thanks to Felix Weinrank for reporting the issue.

Modified:
  stable/11/sys/netinet/sctp_input.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_input.c
==
--- stable/11/sys/netinet/sctp_input.c  Mon Apr 16 20:45:21 2018
(r332633)
+++ stable/11/sys/netinet/sctp_input.c  Mon Apr 16 21:17:18 2018
(r332634)
@@ -2617,7 +2617,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in
(sizeof(uint32_t;
diff = now;
timevalsub(, _expires);
-   if (diff.tv_sec > UINT32_MAX / 100) {
+   if ((uint32_t)diff.tv_sec > UINT32_MAX / 100) {
staleness = UINT32_MAX;
} else {
staleness = diff.tv_sec * 100;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332635 - stable/11/sys/netinet

2018-04-16 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 16 21:18:44 2018
New Revision: 332635
URL: https://svnweb.freebsd.org/changeset/base/332635

Log:
  MFC r332271:
  
  Small cleanup, no functional change.

Modified:
  stable/11/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_usrreq.c
==
--- stable/11/sys/netinet/sctp_usrreq.c Mon Apr 16 21:17:18 2018
(r332634)
+++ stable/11/sys/netinet/sctp_usrreq.c Mon Apr 16 21:18:44 2018
(r332635)
@@ -703,22 +703,10 @@ sctp_disconnect(struct socket *so)
if (SCTP_GET_STATE(asoc) !=
SCTP_STATE_COOKIE_WAIT) {
/* Left with Data unread */
-   struct mbuf *err;
+   struct mbuf *op_err;
 
-   err = 
sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA);
-   if (err) {
-   /*
-* Fill in the user
-* initiated abort
-*/
-   struct sctp_paramhdr *ph;
-
-   ph = mtod(err, struct 
sctp_paramhdr *);
-   SCTP_BUF_LEN(err) = 
sizeof(struct sctp_paramhdr);
-   ph->param_type = 
htons(SCTP_CAUSE_USER_INITIATED_ABT);
-   ph->param_length = 
htons(SCTP_BUF_LEN(err));
-   }
-   sctp_send_abort_tcb(stcb, err, 
SCTP_SO_LOCKED);
+   op_err = 
sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, "");
+   sctp_send_abort_tcb(stcb, op_err, 
SCTP_SO_LOCKED);
SCTP_STAT_INCR_COUNTER32(sctps_aborted);
}
SCTP_INP_RUNLOCK(inp);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332637 - stable/11/usr.bin/systat

2018-04-16 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 16 21:22:12 2018
New Revision: 332637
URL: https://svnweb.freebsd.org/changeset/base/332637

Log:
  MFC r332353:
  
  Don't show the number of currently established SCTP associations,
  since this is not monotonically increasing. It's number can be
  derived from the other counters shown.

Modified:
  stable/11/usr.bin/systat/sctp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/systat/sctp.c
==
--- stable/11/usr.bin/systat/sctp.c Mon Apr 16 21:20:34 2018
(r332636)
+++ stable/11/usr.bin/systat/sctp.c Mon Apr 16 21:22:12 2018
(r332637)
@@ -53,24 +53,23 @@ static struct sctpstat curstat, initstat, oldstat;
 00 SCTP Associations SCTP Packets
 01 associations initiated    packets sent
 02 associations accepted packets received
-03 associations established  - out of the blue
-04 associations restarted    - bad vtag
-05 associations terminated   - bad crc32c
-06 associations aborted
-07
-08 SCTP Timers   SCTP Chunks
-09 init timeouts control chunks sent
-10 cookie timeouts   data chunks sent
-11 data timeouts - ordered
-12 delayed sack timeouts - unordered
-13 shutdown timeouts control chunks received
-14 shutdown-ack timeouts data chunks received
-15 shutdown guard timeouts   - ordered
-16 heartbeat timeouts    - unordered
-17 path MTU timeouts
-18 autoclose timeoutsSCTP user messages
-19 asconf timeouts   fragmented
-20 stream reset timeouts reassembled
+03 associations restarted    - out of the blue
+04 associations terminated   - bad vtag
+05 associations aborted  - bad crc32c
+06
+07 SCTP Timers   SCTP Chunks
+08 init timeouts control chunks sent
+09 cookie timeouts   data chunks sent
+10 data timeouts - ordered
+11 delayed sack timeouts - unordered
+12 shutdown timeouts control chunks received
+13 shutdown-ack timeouts data chunks received
+14 shutdown guard timeouts   - ordered
+15 heartbeat timeouts    - unordered
+16 path MTU timeouts
+17 autoclose timeoutsSCTP user messages
+18 asconf timeouts   fragmented
+19 stream reset timeouts reassembled
 --0123456789012345678901234567890123456789012345678901234567890123456789012345
 --0 1 2 3 4 5 6 7
 */
@@ -100,24 +99,23 @@ labelsctp(void)
L(0, "SCTP Associations");  R(0, "SCTP Packets");
L(1, "associations initiated"); R(1, "packets sent");
L(2, "associations accepted");  R(2, "packets received");
-   L(3, "associations established");   R(3, "- out of the blue");
-   L(4, "associations restarted"); R(4, "- bad vtag");
-   L(5, "associations terminated");R(5, "- bad crc32c");
-   L(6, "associations aborted");
+   L(3, "associations restarted"); R(3, "- out of the blue");
+   L(4, "associations terminated");R(4, "- bad vtag");
+   L(5, "associations aborted");   R(5, "- bad crc32c");
 
-   L(8, "SCTP Timers");R(8, "SCTP Chunks");
-   L(9, "init timeouts");  R(9, "control chunks sent");
-   L(10, "cookie timeouts");   R(10, "data chunks sent");
-   L(11, "data timeouts"); R(11, "- ordered");
-   L(12, "delayed sack timeouts"); R(12, "- unordered");
-   L(13, "shutdown timeouts"); R(13, "control chunks 
received");
-   L(14, "shutdown-ack timeouts"); R(14, "data chunks received");
-   L(15, "shutdown guard timeouts");   R(15, "- ordered");
-   L(16, "heartbeat timeouts");R(16, "- unordered");
-   L(17, "path MTU timeouts");
-   L(18, "autoclose timeouts");R(18, "SCTP User Messages");
-   L(19, "asconf timeouts");   R(19, "fragmented");
-   L(20, "stream reset timeouts"); R(20, "reassembled");
+   L(7, "SCTP Timers");R(7, 

svn commit: r332633 - in stable: 10/lib/libthr/thread 11/lib/libthr/thread

2018-04-16 Thread John Baldwin
Author: jhb
Date: Mon Apr 16 20:45:21 2018
New Revision: 332633
URL: https://svnweb.freebsd.org/changeset/base/332633

Log:
  MFC 331324: Ensure thread library is initialized in pthread_testcancel().
  
  Call _thr_check_init() before reading curthread in pthread_testcancel().
  
  If a constructor in a library creates a semaphore via sem_init() and
  then waits for it via sem_wait(), the program can core dump in
  _pthread_testcancel() called from sem_wait().  This is because the
  semaphore implementation lives in libc, so the library's constructors
  can be run before libthr's constructors.
  
  Sponsored by: DARPA / AFRL

Modified:
  stable/11/lib/libthr/thread/thr_cancel.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/lib/libthr/thread/thr_cancel.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/lib/libthr/thread/thr_cancel.c
==
--- stable/11/lib/libthr/thread/thr_cancel.cMon Apr 16 19:33:04 2018
(r332632)
+++ stable/11/lib/libthr/thread/thr_cancel.cMon Apr 16 20:45:21 2018
(r332633)
@@ -130,8 +130,10 @@ _pthread_setcanceltype(int type, int *oldtype)
 void
 _pthread_testcancel(void)
 {
-   struct pthread *curthread = _get_curthread();
+   struct pthread *curthread;
 
+   _thr_check_init();
+   curthread = _get_curthread();
testcancel(curthread);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332633 - in stable: 10/lib/libthr/thread 11/lib/libthr/thread

2018-04-16 Thread John Baldwin
Author: jhb
Date: Mon Apr 16 20:45:21 2018
New Revision: 332633
URL: https://svnweb.freebsd.org/changeset/base/332633

Log:
  MFC 331324: Ensure thread library is initialized in pthread_testcancel().
  
  Call _thr_check_init() before reading curthread in pthread_testcancel().
  
  If a constructor in a library creates a semaphore via sem_init() and
  then waits for it via sem_wait(), the program can core dump in
  _pthread_testcancel() called from sem_wait().  This is because the
  semaphore implementation lives in libc, so the library's constructors
  can be run before libthr's constructors.
  
  Sponsored by: DARPA / AFRL

Modified:
  stable/10/lib/libthr/thread/thr_cancel.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/lib/libthr/thread/thr_cancel.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/lib/libthr/thread/thr_cancel.c
==
--- stable/10/lib/libthr/thread/thr_cancel.cMon Apr 16 19:33:04 2018
(r332632)
+++ stable/10/lib/libthr/thread/thr_cancel.cMon Apr 16 20:45:21 2018
(r332633)
@@ -130,8 +130,10 @@ _pthread_setcanceltype(int type, int *oldtype)
 void
 _pthread_testcancel(void)
 {
-   struct pthread *curthread = _get_curthread();
+   struct pthread *curthread;
 
+   _thr_check_init();
+   curthread = _get_curthread();
testcancel(curthread);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332636 - in stable/11/sys: netinet netinet6

2018-04-16 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 16 21:20:34 2018
New Revision: 332636
URL: https://svnweb.freebsd.org/changeset/base/332636

Log:
  MFC r332273:
  Fix a logical inversion bug.
  Thanks to Irene Ruengeler for finding and reporting this bug.

Modified:
  stable/11/sys/netinet/sctp_usrreq.c
  stable/11/sys/netinet6/sctp6_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_usrreq.c
==
--- stable/11/sys/netinet/sctp_usrreq.c Mon Apr 16 21:18:44 2018
(r332635)
+++ stable/11/sys/netinet/sctp_usrreq.c Mon Apr 16 21:20:34 2018
(r332636)
@@ -202,7 +202,7 @@ sctp_notify(struct sctp_inpcb *inp,
 #endif
/* no need to unlock here, since the TCB is gone */
} else if (icmp_code == ICMP_UNREACH_NEEDFRAG) {
-   if ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0) {
+   if (net->dest_state & SCTP_ADDR_NO_PMTUD) {
SCTP_TCB_UNLOCK(stcb);
return;
}

Modified: stable/11/sys/netinet6/sctp6_usrreq.c
==
--- stable/11/sys/netinet6/sctp6_usrreq.c   Mon Apr 16 21:18:44 2018
(r332635)
+++ stable/11/sys/netinet6/sctp6_usrreq.c   Mon Apr 16 21:20:34 2018
(r332636)
@@ -221,7 +221,7 @@ sctp6_notify(struct sctp_inpcb *inp,
}
break;
case ICMP6_PACKET_TOO_BIG:
-   if ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0) {
+   if (net->dest_state & SCTP_ADDR_NO_PMTUD) {
SCTP_TCB_UNLOCK(stcb);
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332555 - head/stand/common

2018-04-16 Thread Toomas Soome
Author: tsoome
Date: Mon Apr 16 07:26:23 2018
New Revision: 332555
URL: https://svnweb.freebsd.org/changeset/base/332555

Log:
  loader: provide values in help_getnext()
  
  With r328289 we attempt to make sure we free the resources allocated in
  help_getnext(), however, it is possible that we get no resources allocated
  and help_getnext() will return early.
  
  Make sure we have pointers set to NULL early in help_getnext().
  
  Reported by:  Andy Fiddaman

Modified:
  head/stand/common/commands.c

Modified: head/stand/common/commands.c
==
--- head/stand/common/commands.cMon Apr 16 04:16:46 2018
(r332554)
+++ head/stand/common/commands.cMon Apr 16 07:26:23 2018
(r332555)
@@ -64,7 +64,9 @@ static int
 help_getnext(int fd, char **topic, char **subtopic, char **desc) 
 {
 char   line[81], *cp, *ep;
-
+
+/* Make sure we provide sane values. */
+*topic = *subtopic = *desc = NULL;
 for (;;) {
if (fgetstr(line, 80, fd) < 0)
return(0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332556 - head

2018-04-16 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Apr 16 08:03:18 2018
New Revision: 332556
URL: https://svnweb.freebsd.org/changeset/base/332556

Log:
  Fix ObsoleteFiles.inc entry for libstand.3.
  
  MFC after:2 weeks

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Apr 16 07:26:23 2018(r332555)
+++ head/ObsoleteFiles.inc  Mon Apr 16 08:03:18 2018(r332556)
@@ -419,7 +419,7 @@ OLD_FILES+=usr/share/man/man9/mbp_sync.9.gz
 OLD_FILES+=usr/lib/libstand.a
 OLD_FILES+=usr/lib/libstand_p.a
 OLD_FILES+=usr/include/stand.h
-OLD_FILES+=usr/share/man/man3/libstand.3
+OLD_FILES+=usr/share/man/man3/libstand.3.gz
 # 20171003: remove RCMDS
 OLD_FILES+=bin/rcp
 OLD_FILES+=rescue/rcp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332557 - head/stand/common

2018-04-16 Thread Toomas Soome
Author: tsoome
Date: Mon Apr 16 08:15:50 2018
New Revision: 332557
URL: https://svnweb.freebsd.org/changeset/base/332557

Log:
  loader: make sure we use snprintf() in commands.c
  
  Safeguard against memory corruptions.

Modified:
  head/stand/common/commands.c

Modified: head/stand/common/commands.c
==
--- head/stand/common/commands.cMon Apr 16 08:03:18 2018
(r332556)
+++ head/stand/common/commands.cMon Apr 16 08:15:50 2018
(r332557)
@@ -236,7 +236,7 @@ command_commandlist(int argc, char *argv[])
if (res)
break;
if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) {
-   sprintf(name, "  %-15s  ", (*cmdp)->c_name);
+   snprintf(name, sizeof(name), "  %-15s  ", (*cmdp)->c_name);
pager_output(name);
pager_output((*cmdp)->c_desc);
res = pager_output("\n");
@@ -435,12 +435,12 @@ command_more(int argc, char *argv[])
 res=0;
 pager_open();
 for (i = 1; (i < argc) && (res == 0); i++) {
-   sprintf(line, "*** FILE %s BEGIN ***\n", argv[i]);
+   snprintf(line, sizeof(line), "*** FILE %s BEGIN ***\n", argv[i]);
if (pager_output(line))
break;
 res = page_file(argv[i]);
if (!res) {
-   sprintf(line, "*** FILE %s END ***\n", argv[i]);
+   snprintf(line, sizeof(line), "*** FILE %s END ***\n", argv[i]);
res = pager_output(line);
}
 }
@@ -501,7 +501,7 @@ command_lsdev(int argc, char *argv[])
if (devsw[i]->dv_print(verbose))
break;
} else {
-   sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name);
+   snprintf(line, sizeof(line), "%s: (unknown)\n", devsw[i]->dv_name);
if (pager_output(line))
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332523 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2018-04-16 Thread Steven Hartland
Hey Mav, this seems like an important one to get in for 11.2 so just 
wanted to check if that was your intention as there's no MFC tag on the 
commit?


On 16/04/2018 01:54, Alexander Motin wrote:

Author: mav
Date: Mon Apr 16 00:54:58 2018
New Revision: 332523
URL: https://svnweb.freebsd.org/changeset/base/332523

Log:
   9433 Fix ARC hit rate
   
   When the compressed ARC feature was added in commit d3c2ae1

   the method of reference counting in the ARC was modified.  As
   part of this accounting change the arc_buf_add_ref() function
   was removed entirely.
   
   This would have be fine but the arc_buf_add_ref() function

   served a second undocumented purpose of updating the ARC access
   information when taking a hold on a dbuf.  Without this logic
   in place a cached dbuf would not migrate its associated
   arc_buf_hdr_t to the MFU list.  This would negatively impact
   the ARC hit rate, particularly on systems with a small ARC.
   
   This change reinstates the missing call to arc_access() from

   dbuf_hold() by implementing a new arc_buf_access() function.
   
   Reviewed-by: Giuseppe Di Natale 

   Reviewed-by: Tony Hutter 
   Reviewed-by: Tim Chase 
   Reviewed by: George Wilson 
   Reviewed-by: George Melikov 
   Signed-off-by: Brian Behlendorf 

Modified:
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Mon Apr 16 
00:42:45 2018(r332522)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Mon Apr 16 
00:54:58 2018(r332523)
@@ -540,8 +540,13 @@ typedef struct arc_stats {
 */
kstat_named_t arcstat_mutex_miss;
/*
+* Number of buffers skipped when updating the access state due to the
+* header having already been released after acquiring the hash lock.
+*/
+   kstat_named_t arcstat_access_skip;
+   /*
 * Number of buffers skipped because they have I/O in progress, are
-* indrect prefetch buffers that have not lived long enough, or are
+* indirect prefetch buffers that have not lived long enough, or are
 * not from the spa we're trying to evict from.
 */
kstat_named_t arcstat_evict_skip;
@@ -796,6 +801,7 @@ static arc_stats_t arc_stats = {
{ "allocated",KSTAT_DATA_UINT64 },
{ "deleted",  KSTAT_DATA_UINT64 },
{ "mutex_miss",   KSTAT_DATA_UINT64 },
+   { "access_skip",  KSTAT_DATA_UINT64 },
{ "evict_skip",   KSTAT_DATA_UINT64 },
{ "evict_not_enough", KSTAT_DATA_UINT64 },
{ "evict_l2_cached",  KSTAT_DATA_UINT64 },
@@ -5063,6 +5069,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock)
} else {
ASSERT(!"invalid arc state");
}
+}
+
+/*
+ * This routine is called by dbuf_hold() to update the arc_access() state
+ * which otherwise would be skipped for entries in the dbuf cache.
+ */
+void
+arc_buf_access(arc_buf_t *buf)
+{
+   mutex_enter(>b_evict_lock);
+   arc_buf_hdr_t *hdr = buf->b_hdr;
+
+   /*
+* Avoid taking the hash_lock when possible as an optimization.
+* The header must be checked again under the hash_lock in order
+* to handle the case where it is concurrently being released.
+*/
+   if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
+   mutex_exit(>b_evict_lock);
+   ARCSTAT_BUMP(arcstat_access_skip);
+   return;
+   }
+
+   kmutex_t *hash_lock = HDR_LOCK(hdr);
+   mutex_enter(hash_lock);
+
+   if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
+   mutex_exit(hash_lock);
+   mutex_exit(>b_evict_lock);
+   ARCSTAT_BUMP(arcstat_access_skip);
+   return;
+   }
+
+   mutex_exit(>b_evict_lock);
+
+   ASSERT(hdr->b_l1hdr.b_state == arc_mru ||
+   hdr->b_l1hdr.b_state == arc_mfu);
+
+   DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr);
+   arc_access(hdr, hash_lock);
+   mutex_exit(hash_lock);
+
+   ARCSTAT_BUMP(arcstat_hits);
+   ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr),
+   demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, hits);
  }
  
  /* a generic arc_done_func_t which you can use */


Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c 

svn commit: r332639 - in stable/11/release: amd64 arm64 i386 powerpc

2018-04-16 Thread Ed Maste
Author: emaste
Date: Tue Apr 17 00:46:21 2018
New Revision: 332639
URL: https://svnweb.freebsd.org/changeset/base/332639

Log:
  MFC r332390: make-memstick.sh: put partition args on separate lines
  
  This makes it easier to identify the individual partition types and
  facilitates comparisons across architectures.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/amd64/make-memstick.sh
  stable/11/release/arm64/make-memstick.sh
  stable/11/release/i386/make-memstick.sh
  stable/11/release/powerpc/make-memstick.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/release/amd64/make-memstick.sh
==
--- stable/11/release/amd64/make-memstick.shTue Apr 17 00:03:32 2018
(r332638)
+++ stable/11/release/amd64/make-memstick.shTue Apr 17 00:46:21 2018
(r332639)
@@ -36,6 +36,12 @@ makefs -B little -o label=FreeBSD_Install -o version=2
 rm ${1}/etc/fstab
 rm ${1}/etc/rc.conf.local
 
-mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p 
freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M 
-o ${2}
+mkimg -s gpt \
+-b ${1}/boot/pmbr \
+-p efi:=${1}/boot/boot1.efifat \
+-p freebsd-boot:=${1}/boot/gptboot \
+-p freebsd-ufs:=${2}.part \
+-p freebsd-swap::1M \
+-o ${2}
 rm ${2}.part
 

Modified: stable/11/release/arm64/make-memstick.sh
==
--- stable/11/release/arm64/make-memstick.shTue Apr 17 00:03:32 2018
(r332638)
+++ stable/11/release/arm64/make-memstick.shTue Apr 17 00:46:21 2018
(r332639)
@@ -36,6 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2
 rm ${1}/etc/fstab
 rm ${1}/etc/rc.conf.local
 
-mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2}
+mkimg -s gpt \
+-p efi:=${1}/boot/boot1.efifat \
+-p freebsd:=${2}.part \
+-o ${2}
 rm ${2}.part
 

Modified: stable/11/release/i386/make-memstick.sh
==
--- stable/11/release/i386/make-memstick.sh Tue Apr 17 00:03:32 2018
(r332638)
+++ stable/11/release/i386/make-memstick.sh Tue Apr 17 00:46:21 2018
(r332639)
@@ -36,6 +36,11 @@ makefs -B little -o label=FreeBSD_Install -o version=2
 rm ${1}/etc/fstab
 rm ${1}/etc/rc.conf.local
 
-mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p 
freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2}
+mkimg -s gpt \
+-b ${1}/boot/pmbr \
+-p freebsd-boot:=${1}/boot/gptboot \
+-p freebsd-ufs:=${2}.part \
+-p freebsd-swap::1M \
+-o ${2}
 rm ${2}.part
 

Modified: stable/11/release/powerpc/make-memstick.sh
==
--- stable/11/release/powerpc/make-memstick.sh  Tue Apr 17 00:03:32 2018
(r332638)
+++ stable/11/release/powerpc/make-memstick.sh  Tue Apr 17 00:46:21 2018
(r332639)
@@ -41,7 +41,10 @@ makefs -B big -o version=2 ${tempfile} ${1}
 rm ${1}/etc/fstab
 rm ${1}/etc/rc.conf.local
 
-mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p 
freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2}
+mkimg -s apm \
+-p freebsd-boot:=${1}/boot/boot1.hfs \
+-p freebsd-ufs/FreeBSD_Install:=${tempfile} \
+-o ${2}
 
 rm -f ${tempfile}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332559 - head/usr.sbin/mountd

2018-04-16 Thread Rick Macklem
I wrote:
>Julian Elischer wrote:
>>On 16/4/18 6:56 pm, Konstantin Belousov wrote:
>[stuff snipped]
 +ngroups =3D XU_NGROUPS + 1;
>>> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ?
>>valid question.. because that is how many are allocated?
>>it was a "minimally invasive patch".. whoever used XU_NGROUPS before
>>should have fixed it.
>>Having said that, thanks for drawing out attention to it.. will
>>probably fix.
>16 is the limit specified in the RFCs for Sun RPC, so that is the "on the 
>wire" limit.
>I haven't looked at the code. It might make sense to handle more here and then
>set the limit at 16 after getting rid of duplicates, but I have no idea if =
>it matters?
>
>rick
Correcting my own post. Now that I've looked at the code, this doesn't go on
the wire. It does go in the exports structure, which means that this structure
would have to be revised (along with the syscall and VOP calls and the kernel
code that uses it). These credentials are for the "maproot/mapall" export
option and revising the export structure seems like quite a bit of work for this
case. (Until revised XU_NGROUPS is the correct value to set it to, since there
is a "struct xucred" in the exports structure.)

Since Julian Elischer has been emailing me about adding a "fsid" export option
which allows /etc/exports to set the FSID of the exported fs (which would also
need to go in the exports structure), it might be about time to rev. the exports
structure?

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


svn commit: r332638 - stable/11/lib/libufs

2018-04-16 Thread Kirk McKusick
Author: mckusick
Date: Tue Apr 17 00:03:32 2018
New Revision: 332638
URL: https://svnweb.freebsd.org/changeset/base/332638

Log:
  MFC of 332264, 332266, 332415:
  
  Check for errors in libufs getino() and gracefully fail descriptor
  upgrade request in ufs_disk_write().

Modified:
  stable/11/lib/libufs/inode.c
  stable/11/lib/libufs/type.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libufs/inode.c
==
--- stable/11/lib/libufs/inode.cMon Apr 16 21:22:12 2018
(r332637)
+++ stable/11/lib/libufs/inode.cTue Apr 17 00:03:32 2018
(r332638)
@@ -58,6 +58,10 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i
ERROR(disk, NULL);
 
fs = >d_fs;
+   if (inode >= (ino_t)fs->fs_ipg * fs->fs_ncg) {
+   ERROR(disk, "inode number out of range");
+   return (-1);
+   }
inoblock = disk->d_inoblock;
min = disk->d_inomin;
max = disk->d_inomax;
@@ -79,13 +83,17 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i
 gotit: switch (disk->d_ufs) {
case 1:
dp1 = &((struct ufs1_dinode *)inoblock)[inode - min];
-   *mode = dp1->di_mode & IFMT;
-   *dino = dp1;
+   if (mode != NULL)
+   *mode = dp1->di_mode & IFMT;
+   if (dino != NULL)
+   *dino = dp1;
return (0);
case 2:
dp2 = &((struct ufs2_dinode *)inoblock)[inode - min];
-   *mode = dp2->di_mode & IFMT;
-   *dino = dp2;
+   if (mode != NULL)
+   *mode = dp2->di_mode & IFMT;
+   if (dino != NULL)
+   *dino = dp2;
return (0);
default:
break;

Modified: stable/11/lib/libufs/type.c
==
--- stable/11/lib/libufs/type.c Mon Apr 16 21:22:12 2018(r332637)
+++ stable/11/lib/libufs/type.c Tue Apr 17 00:03:32 2018(r332638)
@@ -58,6 +58,7 @@ ufs_disk_close(struct uufsd *disk)
 {
ERROR(disk, NULL);
close(disk->d_fd);
+   disk->d_fd = -1;
if (disk->d_inoblock != NULL) {
free(disk->d_inoblock);
disk->d_inoblock = NULL;
@@ -178,19 +179,21 @@ again:if ((ret = stat(name, )) < 0) {
 int
 ufs_disk_write(struct uufsd *disk)
 {
+   int fd;
+
ERROR(disk, NULL);
 
if (disk->d_mine & MINE_WRITE)
return (0);
 
-   close(disk->d_fd);
-
-   disk->d_fd = open(disk->d_name, O_RDWR);
-   if (disk->d_fd < 0) {
+   fd = open(disk->d_name, O_RDWR);
+   if (fd < 0) {
ERROR(disk, "failed to open disk for writing");
return (-1);
}
 
+   close(disk->d_fd);
+   disk->d_fd = fd;
disk->d_mine |= MINE_WRITE;
 
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r332561 - head/stand/efi/boot1

2018-04-16 Thread Warner Losh
On Mon, Apr 16, 2018 at 7:18 AM, Kyle Evans  wrote:

> Author: kevans
> Date: Mon Apr 16 13:18:18 2018
> New Revision: 332561
> URL: https://svnweb.freebsd.org/changeset/base/332561
>
> Log:
>   Rename volume label for ESP
>
>   Harry Schmalzbauer reports that some firmware, in his experience, trips
>   over the ESP we install due to the volume label. It has been theorized
> that
>   this is due to some confusion with the label and the path on the ESP to
>   boot1.efi.
>
>   Regardless, Harry found that renaming the label seems to fix it.
>

rm -rf boot1.efifat

after svn rm is the right answer here.

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


Re: svn commit: r332523 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2018-04-16 Thread Alexander Motin
Hi Steve,

Yes, I am going to merge it in few days.  I am trying to merge
everything to keep code in sync.  I am just rarely tagging ZFS commits
with MFC, since it is hard to forget for too long about that exercise. :)

On 16.04.2018 03:36, Steven Hartland wrote:
> Hey Mav, this seems like an important one to get in for 11.2 so just
> wanted to check if that was your intention as there's no MFC tag on the
> commit?
> 
> On 16/04/2018 01:54, Alexander Motin wrote:
>> Author: mav
>> Date: Mon Apr 16 00:54:58 2018
>> New Revision: 332523
>> URL: https://svnweb.freebsd.org/changeset/base/332523
>>
>> Log:
>>   9433 Fix ARC hit rate
>>   
>>   When the compressed ARC feature was added in commit d3c2ae1
>>   the method of reference counting in the ARC was modified.  As
>>   part of this accounting change the arc_buf_add_ref() function
>>   was removed entirely.
>>   
>>   This would have be fine but the arc_buf_add_ref() function
>>   served a second undocumented purpose of updating the ARC access
>>   information when taking a hold on a dbuf.  Without this logic
>>   in place a cached dbuf would not migrate its associated
>>   arc_buf_hdr_t to the MFU list.  This would negatively impact
>>   the ARC hit rate, particularly on systems with a small ARC.
>>   
>>   This change reinstates the missing call to arc_access() from
>>   dbuf_hold() by implementing a new arc_buf_access() function.
>>   
>>   Reviewed-by: Giuseppe Di Natale 
>>   Reviewed-by: Tony Hutter 
>>   Reviewed-by: Tim Chase 
>>   Reviewed by: George Wilson 
>>   Reviewed-by: George Melikov 
>>   Signed-off-by: Brian Behlendorf 
>>
>> Modified:
>>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
>>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
>>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
>>
>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
>> ==
>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.cMon Apr 
>> 16 00:42:45 2018(r332522)
>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.cMon Apr 
>> 16 00:54:58 2018(r332523)
>> @@ -540,8 +540,13 @@ typedef struct arc_stats {
>>   */
>>  kstat_named_t arcstat_mutex_miss;
>>  /*
>> + * Number of buffers skipped when updating the access state due to the
>> + * header having already been released after acquiring the hash lock.
>> + */
>> +kstat_named_t arcstat_access_skip;
>> +/*
>>   * Number of buffers skipped because they have I/O in progress, are
>> - * indrect prefetch buffers that have not lived long enough, or are
>> + * indirect prefetch buffers that have not lived long enough, or are
>>   * not from the spa we're trying to evict from.
>>   */
>>  kstat_named_t arcstat_evict_skip;
>> @@ -796,6 +801,7 @@ static arc_stats_t arc_stats = {
>>  { "allocated",  KSTAT_DATA_UINT64 },
>>  { "deleted",KSTAT_DATA_UINT64 },
>>  { "mutex_miss", KSTAT_DATA_UINT64 },
>> +{ "access_skip",KSTAT_DATA_UINT64 },
>>  { "evict_skip", KSTAT_DATA_UINT64 },
>>  { "evict_not_enough",   KSTAT_DATA_UINT64 },
>>  { "evict_l2_cached",KSTAT_DATA_UINT64 },
>> @@ -5063,6 +5069,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock)
>>  } else {
>>  ASSERT(!"invalid arc state");
>>  }
>> +}
>> +
>> +/*
>> + * This routine is called by dbuf_hold() to update the arc_access() state
>> + * which otherwise would be skipped for entries in the dbuf cache.
>> + */
>> +void
>> +arc_buf_access(arc_buf_t *buf)
>> +{
>> +mutex_enter(>b_evict_lock);
>> +arc_buf_hdr_t *hdr = buf->b_hdr;
>> +
>> +/*
>> + * Avoid taking the hash_lock when possible as an optimization.
>> + * The header must be checked again under the hash_lock in order
>> + * to handle the case where it is concurrently being released.
>> + */
>> +if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
>> +mutex_exit(>b_evict_lock);
>> +ARCSTAT_BUMP(arcstat_access_skip);
>> +return;
>> +}
>> +
>> +kmutex_t *hash_lock = HDR_LOCK(hdr);
>> +mutex_enter(hash_lock);
>> +
>> +if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
>> +mutex_exit(hash_lock);
>> +mutex_exit(>b_evict_lock);
>> +ARCSTAT_BUMP(arcstat_access_skip);
>> +return;
>> +}
>> +
>> +mutex_exit(>b_evict_lock);
>> +
>> +ASSERT(hdr->b_l1hdr.b_state == arc_mru ||
>> +hdr->b_l1hdr.b_state == arc_mfu);
>> +
>> +DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr);
>> +arc_access(hdr, hash_lock);
>> +mutex_exit(hash_lock);
>> +
>> +

  1   2   >