svn commit: r348601 - head/sys/ofed/drivers/infiniband/core

2019-06-03 Thread Slava Shwartsman
Author: slavash
Date: Tue Jun  4 06:21:31 2019
New Revision: 348601
URL: https://svnweb.freebsd.org/changeset/base/348601

Log:
  Fix prio vs. nonprio tagged traffic in RDMACM
  
  In current RDMACM implementation RDMACM server will not find a GID
  index when the request was prio-tagged and the sever is non
  prio-tagged and vise-versa.
  According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should
  be considered as untagged. Treat RDMACM request the same.
  
  Reviewed by:hselasky, kib
  MFC after:  3 Days
  Sponsored by:   Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_verbs.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c
==
--- head/sys/ofed/drivers/infiniband/core/ib_verbs.cTue Jun  4 03:04:30 
2019(r348600)
+++ head/sys/ofed/drivers/infiniband/core/ib_verbs.cTue Jun  4 06:21:31 
2019(r348601)
@@ -414,18 +414,32 @@ struct find_gid_index_context {
enum ib_gid_type gid_type;
 };
 
+
+/*
+ * This function will return true only if a inspected GID index
+ * matches the request based on the GID type and VLAN configuration
+ */
 static bool find_gid_index(const union ib_gid *gid,
   const struct ib_gid_attr *gid_attr,
   void *context)
 {
+   u16 vlan_diff;
struct find_gid_index_context *ctx =
(struct find_gid_index_context *)context;
 
if (ctx->gid_type != gid_attr->gid_type)
return false;
-   if (rdma_vlan_dev_vlan_id(gid_attr->ndev) != ctx->vlan_id)
-   return false;
-   return true;
+
+   /*
+* The following will verify:
+* 1. VLAN ID matching for VLAN tagged requests.
+* 2. prio-tagged/untagged to prio-tagged/untagged matching.
+*
+* This XOR is valid, since 0x0 < vlan_id < 0x0FFF.
+*/
+   vlan_diff = rdma_vlan_dev_vlan_id(gid_attr->ndev) ^ ctx->vlan_id;
+
+   return (vlan_diff == 0x || vlan_diff == 0x);
 }
 
 static int get_sgid_index_from_eth(struct ib_device *device, u8 port_num,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348599 - in head/sys/dev/virtio: . balloon block console network random scsi

2019-06-03 Thread Conrad Meyer
Author: cem
Date: Tue Jun  4 02:37:11 2019
New Revision: 348599
URL: https://svnweb.freebsd.org/changeset/base/348599

Log:
  virtio(4): Add PNP match metadata for virtio devices
  
  Register MODULE_PNP_INFO for virtio devices using the newbus PNP information
  provided by the previous commit.  Matching can be quite simple; existing
  probe routines only matched on bus (implicit) and device_type.  The same
  matching criteria are retained exactly, but is now also available to
  devmatch(8).
  
  Reviewed by:  bryanv, markj; imp (earlier version)
  Differential Revision:https://reviews.freebsd.org/D20407

Modified:
  head/sys/dev/virtio/balloon/virtio_balloon.c
  head/sys/dev/virtio/block/virtio_blk.c
  head/sys/dev/virtio/console/virtio_console.c
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/virtio/random/virtio_random.c
  head/sys/dev/virtio/scsi/virtio_scsi.c
  head/sys/dev/virtio/virtio.h

Modified: head/sys/dev/virtio/balloon/virtio_balloon.c
==
--- head/sys/dev/virtio/balloon/virtio_balloon.cTue Jun  4 02:34:59 
2019(r348598)
+++ head/sys/dev/virtio/balloon/virtio_balloon.cTue Jun  4 02:37:11 
2019(r348599)
@@ -158,16 +158,14 @@ DRIVER_MODULE(virtio_balloon, virtio_pci, vtballoon_dr
 MODULE_VERSION(virtio_balloon, 1);
 MODULE_DEPEND(virtio_balloon, virtio, 1, 1, 1);
 
+VIRTIO_SIMPLE_PNPTABLE(virtio_balloon, VIRTIO_ID_BALLOON,
+"VirtIO Balloon Adapter");
+VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_balloon);
+
 static int
 vtballoon_probe(device_t dev)
 {
-
-   if (virtio_get_device_type(dev) != VIRTIO_ID_BALLOON)
-   return (ENXIO);
-
-   device_set_desc(dev, "VirtIO Balloon Adapter");
-
-   return (BUS_PROBE_DEFAULT);
+   return (VIRTIO_SIMPLE_PROBE(dev, virtio_balloon));
 }
 
 static int

Modified: head/sys/dev/virtio/block/virtio_blk.c
==
--- head/sys/dev/virtio/block/virtio_blk.c  Tue Jun  4 02:34:59 2019
(r348598)
+++ head/sys/dev/virtio/block/virtio_blk.c  Tue Jun  4 02:37:11 2019
(r348599)
@@ -261,6 +261,10 @@ DRIVER_MODULE(virtio_blk, virtio_pci, vtblk_driver, vt
 MODULE_VERSION(virtio_blk, 1);
 MODULE_DEPEND(virtio_blk, virtio, 1, 1, 1);
 
+VIRTIO_SIMPLE_PNPTABLE(virtio_blk, VIRTIO_ID_BLOCK, "VirtIO Block Adapter");
+VIRTIO_SIMPLE_PNPINFO(virtio_mmio, virtio_blk);
+VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_blk);
+
 static int
 vtblk_modevent(module_t mod, int type, void *unused)
 {
@@ -285,13 +289,7 @@ vtblk_modevent(module_t mod, int type, void *unused)
 static int
 vtblk_probe(device_t dev)
 {
-
-   if (virtio_get_device_type(dev) != VIRTIO_ID_BLOCK)
-   return (ENXIO);
-
-   device_set_desc(dev, "VirtIO Block Adapter");
-
-   return (BUS_PROBE_DEFAULT);
+   return (VIRTIO_SIMPLE_PROBE(dev, virtio_blk));
 }
 
 static int

Modified: head/sys/dev/virtio/console/virtio_console.c
==
--- head/sys/dev/virtio/console/virtio_console.cTue Jun  4 02:34:59 
2019(r348598)
+++ head/sys/dev/virtio/console/virtio_console.cTue Jun  4 02:37:11 
2019(r348599)
@@ -261,6 +261,10 @@ DRIVER_MODULE(virtio_console, virtio_pci, vtcon_driver
 MODULE_VERSION(virtio_console, 1);
 MODULE_DEPEND(virtio_console, virtio, 1, 1, 1);
 
+VIRTIO_SIMPLE_PNPTABLE(virtio_console, VIRTIO_ID_CONSOLE,
+"VirtIO Console Adapter");
+VIRTIO_SIMPLE_PNPINFO(virtio_pci, virtio_console);
+
 static int
 vtcon_modevent(module_t mod, int type, void *unused)
 {
@@ -305,13 +309,7 @@ vtcon_drain_all(void)
 static int
 vtcon_probe(device_t dev)
 {
-
-   if (virtio_get_device_type(dev) != VIRTIO_ID_CONSOLE)
-   return (ENXIO);
-
-   device_set_desc(dev, "VirtIO Console Adapter");
-
-   return (BUS_PROBE_DEFAULT);
+   return (VIRTIO_SIMPLE_PROBE(dev, virtio_console));
 }
 
 static int

Modified: head/sys/dev/virtio/network/if_vtnet.c
==
--- head/sys/dev/virtio/network/if_vtnet.c  Tue Jun  4 02:34:59 2019
(r348598)
+++ head/sys/dev/virtio/network/if_vtnet.c  Tue Jun  4 02:37:11 2019
(r348599)
@@ -325,6 +325,10 @@ MODULE_DEPEND(vtnet, virtio, 1, 1, 1);
 MODULE_DEPEND(vtnet, netmap, 1, 1, 1);
 #endif /* DEV_NETMAP */
 
+VIRTIO_SIMPLE_PNPTABLE(vtnet, VIRTIO_ID_NETWORK, "VirtIO Networking Adapter");
+VIRTIO_SIMPLE_PNPINFO(virtio_mmio, vtnet);
+VIRTIO_SIMPLE_PNPINFO(virtio_pci, vtnet);
+
 static int
 vtnet_modevent(module_t mod, int type, void *unused)
 {
@@ -361,13 +365,7 @@ vtnet_modevent(module_t mod, int type, void *unused)
 static int
 vtnet_probe(device_t dev)
 {
-
-   if (virtio_get_device_type(dev) != VIRTIO_ID_NETWORK)
-   return (ENXIO);
-
-   device_set_desc(dev, "VirtIO Networking Adapter");
-
-   return (B

svn commit: r348598 - in head/sys/dev/virtio: . mmio pci

2019-06-03 Thread Conrad Meyer
Author: cem
Date: Tue Jun  4 02:34:59 2019
New Revision: 348598
URL: https://svnweb.freebsd.org/changeset/base/348598

Log:
  virtio(4): Expose PNP metadata through newbus
  
  Expose the same fields and widths from both vtio buses, even though they
  don't quite line up; several virtio drivers can attach to both buses,
  and sharing a PNP info table for both seems more convenient.
  
  In practice, I doubt any virtio driver really needs to match on anything
  other than bus and device_type (eliminating the unused entries for
  vtmmio), and also in practice device_type is << 2^16 (so far, values
  range from 1 to 20).  So it might be fine to only expose a 16-bit
  device_type for PNP purposes.  On the other hand, I don't see much harm
  in overkill here.
  
  Reviewed by:  bryanv, markj (earlier version)
  Differential Revision:https://reviews.freebsd.org/D20406

Modified:
  head/sys/dev/virtio/mmio/virtio_mmio.c
  head/sys/dev/virtio/pci/virtio_pci.c
  head/sys/dev/virtio/virtio.c
  head/sys/dev/virtio/virtio.h

Modified: head/sys/dev/virtio/mmio/virtio_mmio.c
==
--- head/sys/dev/virtio/mmio/virtio_mmio.c  Tue Jun  4 01:00:30 2019
(r348597)
+++ head/sys/dev/virtio/mmio/virtio_mmio.c  Tue Jun  4 02:34:59 2019
(r348598)
@@ -145,6 +145,7 @@ static device_method_t vtmmio_methods[] = {
/* Bus interface. */
DEVMETHOD(bus_driver_added,   vtmmio_driver_added),
DEVMETHOD(bus_child_detached, vtmmio_child_detached),
+   DEVMETHOD(bus_child_pnpinfo_str,  virtio_child_pnpinfo_str),
DEVMETHOD(bus_read_ivar,  vtmmio_read_ivar),
DEVMETHOD(bus_write_ivar, vtmmio_write_ivar),
 
@@ -331,6 +332,14 @@ vtmmio_read_ivar(device_t dev, device_t child, int ind
break;
case VIRTIO_IVAR_VENDOR:
*result = vtmmio_read_config_4(sc, VIRTIO_MMIO_VENDOR_ID);
+   break;
+   case VIRTIO_IVAR_SUBVENDOR:
+   case VIRTIO_IVAR_DEVICE:
+   /*
+* Dummy value for fields not present in this bus.  Used by
+* bus-agnostic virtio_child_pnpinfo_str.
+*/
+   *result = 0;
break;
default:
return (ENOENT);

Modified: head/sys/dev/virtio/pci/virtio_pci.c
==
--- head/sys/dev/virtio/pci/virtio_pci.cTue Jun  4 01:00:30 2019
(r348597)
+++ head/sys/dev/virtio/pci/virtio_pci.cTue Jun  4 02:34:59 2019
(r348598)
@@ -200,6 +200,7 @@ static device_method_t vtpci_methods[] = {
/* Bus interface. */
DEVMETHOD(bus_driver_added,   vtpci_driver_added),
DEVMETHOD(bus_child_detached, vtpci_child_detached),
+   DEVMETHOD(bus_child_pnpinfo_str,  virtio_child_pnpinfo_str),
DEVMETHOD(bus_read_ivar,  vtpci_read_ivar),
DEVMETHOD(bus_write_ivar, vtpci_write_ivar),
 

Modified: head/sys/dev/virtio/virtio.c
==
--- head/sys/dev/virtio/virtio.cTue Jun  4 01:00:30 2019
(r348597)
+++ head/sys/dev/virtio/virtio.cTue Jun  4 02:34:59 2019
(r348598)
@@ -263,6 +263,30 @@ virtio_write_device_config(device_t dev, bus_size_t of
offset, dst, len);
 }
 
+int
+virtio_child_pnpinfo_str(device_t busdev __unused, device_t child, char *buf,
+size_t buflen)
+{
+
+   /*
+* All of these PCI fields will be only 16 bits, but on the vtmmio bus
+* the corresponding fields (only "vendor" and "device_type") are 32
+* bits.  Many virtio drivers can attach below either bus.
+* Gratuitously expand these two fields to 32-bits to allow sharing PNP
+* match table data between the mostly-similar buses.
+*
+* Subdevice and device_type are redundant in both buses, so I don't
+* see a lot of PNP utility in exposing the same value under a
+* different name.
+*/
+   snprintf(buf, buflen, "vendor=0x%08x device=0x%04x subvendor=0x%04x "
+   "device_type=0x%08x", (unsigned)virtio_get_vendor(child),
+   (unsigned)virtio_get_device(child),
+   (unsigned)virtio_get_subvendor(child),
+   (unsigned)virtio_get_device_type(child));
+   return (0);
+}
+
 static int
 virtio_modevent(module_t mod, int type, void *unused)
 {

Modified: head/sys/dev/virtio/virtio.h
==
--- head/sys/dev/virtio/virtio.hTue Jun  4 01:00:30 2019
(r348597)
+++ head/sys/dev/virtio/virtio.hTue Jun  4 02:34:59 2019
(r348598)
@@ -81,6 +81,8 @@ void   virtio_stop(device_t dev);
 int virtio_config_generation(device_t dev)

svn commit: r348595 - head/sys/dev/virtio/random

2019-06-03 Thread Conrad Meyer
Author: cem
Date: Tue Jun  4 00:01:37 2019
New Revision: 348595
URL: https://svnweb.freebsd.org/changeset/base/348595

Log:
  virtio_random(4): Fix random(4) integration
  
  random(4) masks unregistered entropy sources.  Prior to this revision,
  virtio_random(4) did not correctly register a random_source and did not
  function as a source of entropy.
  
  Random source registration for loadable pure sources requires registering a
  poll callback, which is invoked periodically by random(4)'s harvestq
  kthread.  The periodic poll makes virtio_random(4)'s periodic entropy
  collection redundant, so this revision removes the callout.
  
  The current random source API is somewhat limiting, so simply fail to attach
  any virtio_random devices if one is already registered as a source.  This
  scenario is expected to be uncommon.
  
  While here, handle the possibility of short reads from the hypervisor random
  device gracefully / correctly.  It is not clear why a hypervisor would
  return a short read or if it is allowed by spec, but we may as well handle
  it.
  
  Reviewed by:  bryanv (earlier version), markm
  Security: yes (note: many other "pure" random sources remain broken)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20419

Modified:
  head/sys/dev/virtio/random/virtio_random.c

Modified: head/sys/dev/virtio/random/virtio_random.c
==
--- head/sys/dev/virtio/random/virtio_random.c  Mon Jun  3 23:57:29 2019
(r348594)
+++ head/sys/dev/virtio/random/virtio_random.c  Tue Jun  4 00:01:37 2019
(r348595)
@@ -33,21 +33,24 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 
 struct vtrnd_softc {
uint64_t vtrnd_features;
-   struct callout   vtrnd_callout;
struct virtqueue*vtrnd_vq;
 };
 
@@ -59,8 +62,8 @@ static intvtrnd_detach(device_t);
 
 static voidvtrnd_negotiate_features(device_t);
 static int vtrnd_alloc_virtqueue(device_t);
-static voidvtrnd_harvest(struct vtrnd_softc *);
-static voidvtrnd_timer(void *);
+static int vtrnd_harvest(struct vtrnd_softc *, void *, size_t *);
+static unsignedvtrnd_read(void *, unsigned);
 
 #define VTRND_FEATURES 0
 
@@ -68,6 +71,15 @@ static struct virtio_feature_desc vtrnd_feature_desc[]
{ 0, NULL }
 };
 
+static struct random_source random_vtrnd = {
+   .rs_ident = "VirtIO Entropy Adapter",
+   .rs_source = RANDOM_PURE_VIRTIO,
+   .rs_read = vtrnd_read,
+};
+
+/* Kludge for API limitations of random(4). */
+static _Atomic(struct vtrnd_softc *) g_vtrnd_softc;
+
 static device_method_t vtrnd_methods[] = {
/* Device methods. */
DEVMETHOD(device_probe, vtrnd_probe),
@@ -125,13 +137,11 @@ vtrnd_probe(device_t dev)
 static int
 vtrnd_attach(device_t dev)
 {
-   struct vtrnd_softc *sc;
+   struct vtrnd_softc *sc, *exp;
int error;
 
sc = device_get_softc(dev);
 
-   callout_init(&sc->vtrnd_callout, 1);
-
virtio_set_feature_desc(dev, vtrnd_feature_desc);
vtrnd_negotiate_features(dev);
 
@@ -141,7 +151,13 @@ vtrnd_attach(device_t dev)
goto fail;
}
 
-   callout_reset(&sc->vtrnd_callout, 5 * hz, vtrnd_timer, sc);
+   exp = NULL;
+   if (!atomic_compare_exchange_strong_explicit(&g_vtrnd_softc, &exp, sc,
+   memory_order_release, memory_order_acquire)) {
+   error = EEXIST;
+   goto fail;
+   }
+   random_source_register(&random_vtrnd);
 
 fail:
if (error)
@@ -156,9 +172,20 @@ vtrnd_detach(device_t dev)
struct vtrnd_softc *sc;
 
sc = device_get_softc(dev);
+   KASSERT(
+   atomic_load_explicit(&g_vtrnd_softc, memory_order_acquire) == sc,
+   ("only one global instance at a time"));
 
-   callout_drain(&sc->vtrnd_callout);
+   random_source_deregister(&random_vtrnd);
+   atomic_store_explicit(&g_vtrnd_softc, NULL, memory_order_release);
 
+   /*
+* Unfortunately, deregister does not guarantee our source callback
+* will not be invoked after it returns.  Use a kludge to prevent some,
+* but not all, possible races.
+*/
+   tsleep_sbt(&g_vtrnd_softc, 0, "vtrnddet", mstosbt(50), 0, C_HARDCLOCK);
+
return (0);
 }
 
@@ -185,44 +212,64 @@ vtrnd_alloc_virtqueue(device_t dev)
return (virtio_alloc_virtqueues(dev, 0, 1, &vq_info));
 }
 
-static void
-vtrnd_harvest(struct vtrnd_softc *sc)
+static int
+vtrnd_harvest(struct vtrnd_softc *sc, void *buf, size_t *sz)
 {
struct sglist_seg segs[1];
struct sglist sg;
struct virtqueue *vq;
-   uint32_t value;
+   uint32_t value[HARVESTSIZE] __aligned(sizeof(uint32_t) * HARVESTSIZE);
+  

svn commit: r348594 - head/share/man/man9

2019-06-03 Thread Conrad Meyer
Author: cem
Date: Mon Jun  3 23:57:29 2019
New Revision: 348594
URL: https://svnweb.freebsd.org/changeset/base/348594

Log:
  style.9: Codify tolerance for eliding blank lines
  
  Consensus seems to be that eliding blank lines for functions with no local
  variables is acceptable.  Codify that explicitly in the style document.
  
  Reported by:  jhb
  Reviewed by:  delphij, imp, vangyzen (earlier version); rgrimes
  With feedback from:   kib
  Differential Revision:https://reviews.freebsd.org/D20448

Modified:
  head/share/man/man9/style.9

Modified: head/share/man/man9/style.9
==
--- head/share/man/man9/style.9 Mon Jun  3 23:24:07 2019(r348593)
+++ head/share/man/man9/style.9 Mon Jun  3 23:57:29 2019(r348594)
@@ -26,7 +26,7 @@
 .\"From: @(#)style 1.14 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd May 28, 2019
+.Dd June 3, 2019
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -779,8 +779,19 @@ vaf(const char *fmt, ...)
 static void
 usage(void)
 {
-   /* Insert an empty line if the function has no local variables. */
+   /* Optional blank line goes here. */
 .Ed
+.Pp
+Optionally, insert a blank line at the beginning of functions with no local
+variables.
+Older versions of this
+.Nm
+document required the blank line convention, so it is widely used in existing
+code.
+.Pp
+Do not insert a blank line at the beginning of functions with local variables.
+Instead, these should have local variable declarations first, followed by one
+blank line, followed by the first statement.
 .Pp
 Use
 .Xr printf 3 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348592 - head/usr.sbin/bhyve

2019-06-03 Thread John Baldwin
Author: jhb
Date: Mon Jun  3 23:17:35 2019
New Revision: 348592
URL: https://svnweb.freebsd.org/changeset/base/348592

Log:
  Emulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.
  
  Writes are ignored and reads always return zero.
  
  Submitted by: José Albornoz  (write-only version)
  Reviewed by:  Patrick Mooney, cem
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D19506

Modified:
  head/usr.sbin/bhyve/xmsr.c

Modified: head/usr.sbin/bhyve/xmsr.c
==
--- head/usr.sbin/bhyve/xmsr.c  Mon Jun  3 23:07:46 2019(r348591)
+++ head/usr.sbin/bhyve/xmsr.c  Mon Jun  3 23:17:35 2019(r348592)
@@ -72,6 +72,7 @@ emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t nu
return (0);
 
case MSR_NB_CFG1:
+   case MSR_LS_CFG:
case MSR_IC_CFG:
return (0); /* Ignore writes */
 
@@ -141,6 +142,7 @@ emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t nu
break;
 
case MSR_NB_CFG1:
+   case MSR_LS_CFG:
case MSR_IC_CFG:
/*
 * The reset value is processor family dependent so
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348591 - head/usr.sbin/mountd

2019-06-03 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  3 23:07:46 2019
New Revision: 348591
URL: https://svnweb.freebsd.org/changeset/base/348591

Log:
  r348590 had mention of "-I" in a comment that no longer applied to the patch.
  
  Take "-I" out of the comment line, since the patch no longer uses the "-I"
  option.
  
  MFC after:1 month

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

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Mon Jun  3 22:58:51 2019
(r348590)
+++ head/usr.sbin/mountd/mountd.c   Mon Jun  3 23:07:46 2019
(r348591)
@@ -1716,7 +1716,7 @@ get_exportlist_one(int passno)
 */
if (v4root_phase > 0 && v4root_phase <= 2) {
/*
-* These structures are used for the "-I" reload,
+* These structures are used for the reload,
 * so save them for that case.  Otherwise, just
 * free them up now.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348590 - head/usr.sbin/mountd

2019-06-03 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  3 22:58:51 2019
New Revision: 348590
URL: https://svnweb.freebsd.org/changeset/base/348590

Log:
  Modify mountd so that it incrementally updates the kernel exports upon a 
reload.
  
  Without this patch, mountd would delete/load all exports from the exports
  file(s) when it receives a SIGHUP. This works fine for small exports file(s),
  but can take several seconds to do when there are large numbers (1+) of
  exported file systems. Most of this time is spent doing the system calls
  that delete/export each of these file systems. When the "-S" option
  has been specified (the default these days), the nfsd threads are suspended
  for several seconds while the reload is done.
  
  This patch changes mountd so that it only does system calls for file systems
  where the exports have been changed/added/deleted as compared to the exports
  done for the previous load/reload of the exports file(s).
  Basically, when SIGHUP is posted to mountd, it saves the exportlist structures
  from the previous load and creates a new set of structures from the current
  exports file(s). Then it compares the current with the previous and only does
  system calls for cases that have been changed/added/deleted.
  The nfsd threads do not need to be suspended until the comparison step is
  being done. This results in a suspension period of milliseconds for a server
  with 1+ exported file systems.
  
  There is some code using a LOGDEBUG() macro that allow runtime debugging
  output via syslog(LOG_DEBUG,...) that can be enabled by creating a file
  called /var/log/mountd.debug. This code is expected to be replaced with
  code that uses dtrace by cy@ in the near future, once issues w.r.t. dtrace
  in stable/12 have been resolved.
  
  The patch should not change the usage of the exports file(s), but improves
  the performance of reloading large exports file(s) where there are only a
  small number of changes done to the file(s).
  
  Tested by:p...@lysator.liu.se
  PR:   237860
  Reviewed by:  kib
  MFC after:1 month
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D20487

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

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Mon Jun  3 21:40:42 2019
(r348589)
+++ head/usr.sbin/mountd/mountd.c   Mon Jun  3 22:58:51 2019
(r348590)
@@ -120,6 +120,8 @@ struct exportlist {
fsid_t  ex_fs;
char*ex_fsdir;
char*ex_indexfile;
+   struct xucred   ex_defanon;
+   int ex_defexflags;
int ex_numsecflavors;
int ex_secflavors[MAXSECFLAVORS];
int ex_defnumsecflavors;
@@ -129,6 +131,9 @@ struct exportlist {
 };
 /* ex_flag bits */
 #defineEX_LINKED   0x1
+#defineEX_DONE 0x2
+#defineEX_DEFSET   0x4
+#defineEX_PUBLICFH 0x8
 
 SLIST_HEAD(exportlisthead, exportlist);
 
@@ -147,6 +152,9 @@ struct grouplist {
int gr_type;
union grouptypes gr_ptr;
struct grouplist *gr_next;
+   struct xucred gr_anon;
+   int gr_exflags;
+   int gr_flag;
int gr_numsecflavors;
int gr_secflavors[MAXSECFLAVORS];
 };
@@ -157,6 +165,9 @@ struct grouplist {
 #defineGT_DEFAULT  0x3
 #define GT_IGNORE  0x5
 
+/* Group flags */
+#defineGR_FND  0x1
+
 struct hostlist {
int  ht_flag;   /* Uses DP_xx bits */
struct grouplist *ht_grp;
@@ -176,7 +187,8 @@ struct fhreturn {
 /* Global defs */
 static char*add_expdir(struct dirlist **, char *, int);
 static voidadd_dlist(struct dirlist **, struct dirlist *,
-   struct grouplist *, int, struct exportlist *);
+   struct grouplist *, int, struct exportlist *,
+   struct xucred *, int);
 static voidadd_mlist(char *, char *);
 static int check_dirpath(char *);
 static int check_options(struct dirlist *);
@@ -189,8 +201,9 @@ static void complete_service(struct netconfig *nconf, 
 static voidclearout_service(void);
 static voiddel_mlist(char *hostp, char *dirp);
 static struct dirlist  *dirp_search(struct dirlist *, char *);
+static int do_export_mount(struct exportlist *, struct statfs *);
 static int do_mount(struct exportlist *, struct grouplist *, int,
-   struct xucred *, char *, int, struct statfs *);
+   struct xucred *, char *, int, struct statfs *, int, int *);
 static int do_opt(char **, char **, struct exportlist *,
struct grouplist *, int *, int *, struct xucred *);
 static struct exportlist   *ex_search(fsid_t *, struct exportlisthead *);
@@ -199,10 +212,16 @@ static void   free_dir(struct dirlist *);
 sta

svn commit: r348589 - head/etc

2019-06-03 Thread Maxim Sobolev
Author: sobomax
Date: Mon Jun  3 21:40:42 2019
New Revision: 348589
URL: https://svnweb.freebsd.org/changeset/base/348589

Log:
  Put back MTREE_CMD here for now. Doh, not my day, perhaps.
  
  Reported by:  markj, mav

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Mon Jun  3 21:04:23 2019(r348588)
+++ head/etc/Makefile   Mon Jun  3 21:40:42 2019(r348589)
@@ -93,6 +93,8 @@ distribution:
 .endif
 .endif
 
+MTREE_CMD?=mtree
+
 MTREES=mtree/BSD.root.dist /   \
mtree/BSD.var.dist  /var\
mtree/BSD.usr.dist  /usr\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348532 - in head: . etc

2019-06-03 Thread Mark Johnston
On Mon, Jun 03, 2019 at 03:12:45PM +, Maxim Sobolev wrote:
> Author: sobomax
> Date: Mon Jun  3 15:12:44 2019
> New Revision: 348532
> URL: https://svnweb.freebsd.org/changeset/base/348532
> 
> Log:
>   Leave mtree hardcoded for now. Reverting partially 348521 and also
>   the followup stopgap change, because I don't think it's a correct. I still
>   need to figure out where to stick it in. In cannot be in Makefile.inc1
>   and it cannot be in etc/Makefile from the looks of it to avoid
>   chicken-and-egg problem.
> 
> Modified:
>   head/Makefile.inc1
>   head/etc/Makefile
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Mon Jun  3 15:10:37 2019(r348531)
> +++ head/Makefile.inc1Mon Jun  3 15:12:44 2019(r348532)
> @@ -888,7 +888,7 @@ INSTALLFLAGS+=-h sha256
>  .endif
>  .if defined(DB_FROM_SRC) || defined(NO_ROOT)
>  IMAKE_INSTALL=   INSTALL="${INSTALL} ${INSTALLFLAGS}"
> -IMAKE_MTREE= MTREE_CMD="${MTREE} ${MTREEFLAGS}"
> +IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
>  .endif
>  
>  DESTDIR_MTREEFLAGS=  -deU
> 
> Modified: head/etc/Makefile
> ==
> --- head/etc/Makefile Mon Jun  3 15:10:37 2019(r348531)
> +++ head/etc/Makefile Mon Jun  3 15:12:44 2019(r348532)
> @@ -93,8 +93,6 @@ distribution:
>  .endif
>  .endif
>  
> -MTREE_CMD?=  mtree
> -

I don't see how this can be right.  Nothing sets MTREE_CMD if
!defined(DB_FROM_SRC) && !defined(NO_ROOT), so now a regular
installworld fails for me:

--  
  
 >>> Making hierarchy   
 >>>
 >>> 
--  
  
cd /usr/home/markj/src/freebsd-dev; make -f Makefile.inc1  LOCAL_MTREE= 
hierarchy   
  
[...]
-deU -i -f /usr/home/markj/src/freebsd-dev/etc/mtree/BSD.root.dist -p / 
  
/tmp/install.ClQih1mt/sh: -deU: not found   
  
*** Error code 127
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348586 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 20:55:52 2019
New Revision: 348586
URL: https://svnweb.freebsd.org/changeset/base/348586

Log:
  MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()
  
  illumos/illumos-gate@6fe4f3002ca33af5ab7123ed78d81899dadf2fbb
  
  Reviewed by: Sara Hartse 
  Reviewed by: George Wilson 
  Approved by: Dan McDonald 
  Author: Pavel Zakharov 
  
  This is irrelevant to FreeBSD, just to reduce divergence.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Jun 
 3 20:52:19 2019(r348585)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Jun 
 3 20:55:52 2019(r348586)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
  * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
  */
@@ -50,6 +50,21 @@ typedef struct vdev_disk_ldi_cb {
ldi_callback_id_t   lcb_id;
 } vdev_disk_ldi_cb_t;
 
+/*
+ * Bypass the devid when opening a disk vdev.
+ * There have been issues where the devids of several devices were shuffled,
+ * causing pool open failures. Note, that this flag is intended to be used
+ * for pool recovery only.
+ *
+ * Note that if a pool is imported with the devids bypassed, all its vdevs will
+ * cease storing devid information permanently. In practice, the devid is 
rarely
+ * useful as vdev paths do not tend to change unless the hardware is
+ * reconfigured. That said, if the paths do change and a pool fails to open
+ * automatically at boot, a simple zpool import should re-scan the paths and 
fix
+ * the issue.
+ */
+boolean_t vdev_disk_bypass_devid = B_FALSE;
+
 static void
 vdev_disk_alloc(vdev_t *vd)
 {
@@ -306,6 +321,16 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *
dvd = vd->vdev_tsd;
 
/*
+* Allow bypassing the devid.
+*/
+   if (vd->vdev_devid != NULL && vdev_disk_bypass_devid) {
+   vdev_dbgmsg(vd, "vdev_disk_open, devid %s bypassed",
+   vd->vdev_devid);
+   spa_strfree(vd->vdev_devid);
+   vd->vdev_devid = NULL;
+   }
+
+   /*
 * When opening a disk device, we want to preserve the user's original
 * intent.  We always want to open the device by the path the user gave
 * us, even if it is one of multiple paths to the save device.  But we
@@ -367,6 +392,19 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *
if (error == 0 && vd->vdev_devid != NULL &&
ldi_get_devid(dvd->vd_lh, &devid) == 0) {
if (ddi_devid_compare(devid, dvd->vd_devid) != 0) {
+   /*
+* A mismatch here is unexpected, log it.
+*/
+   char *devid_str = ddi_devid_str_encode(devid,
+   dvd->vd_minor);
+   vdev_dbgmsg(vd, "vdev_disk_open: devid "
+   "mismatch: %s != %s", vd->vdev_devid,
+   devid_str);
+   cmn_err(CE_NOTE, "vdev_disk_open %s: devid "
+   "mismatch: %s != %s", vd->vdev_path,
+   vd->vdev_devid, devid_str);
+   ddi_devid_str_free(devid_str);
+
error = SET_ERROR(EINVAL);
(void) ldi_close(dvd->vd_lh, spa_mode(spa),
kcred);
@@ -390,6 +428,10 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *
if (error != 0 && vd->vdev_devid != NULL) {
error = ldi_open_by_devid(dvd->vd_devid, dvd->vd_minor,
spa_mode(spa), kcred, &dvd->vd_lh, zfs_li);
+   if (error != 0) {
+   vdev_dbgmsg(vd, "Failed to open by devid (%s)",
+   vd->vdev_devid);
+   }
}
 
/*
@@ -436,6 +478,9 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *
vd_devid = ddi_devid_str_encode(devid, dvd->vd_minor);
vdev_dbgmsg(vd, "vdev_disk_open: update devid from "
"'%s' to '%s'", vd->vdev_devid, vd_devid);
+   cmn_err(CE_NOTE, "vdev_disk_open %s: update devid "
+   "from '%s' to '%s'", vd->vdev_path != NULL ?
+  

svn commit: r348584 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 20:49:20 2019
New Revision: 348584
URL: https://svnweb.freebsd.org/changeset/base/348584

Log:
  MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects
  
  illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3
  
  Reviewed by: George Wilson 
  Reviewed by: Serapheim Dimitropoulos 
  Reviewed by: Brian Behlendorf 
  Approved by: Richard Lowe 
  Author: Matthew Ahrens 

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun  3 20:45:48 2019
(r348583)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun  3 20:49:20 2019
(r348584)
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #undef verify
@@ -111,6 +112,7 @@ static uint64_t max_inflight = 1000;
 static int leaked_objects = 0;
 
 static void snprintf_blkptr_compact(char *, size_t, const blkptr_t *);
+static void mos_obj_refd(uint64_t);
 
 /*
  * These libumem hooks provide a reasonable set of defaults for the allocator's
@@ -1592,6 +1594,8 @@ dump_dsl_dir(objset_t *os, uint64_t object, void *data
DO(CHILD_RSRV);
DO(REFRSRV);
 #undef DO
+   (void) printf("\t\tclones = %llu\n",
+   (u_longlong_t)dd->dd_clones);
 }
 
 /*ARGSUSED*/
@@ -1774,6 +1778,33 @@ dump_full_bpobj(bpobj_t *bpo, const char *name, int in
 }
 
 static void
+bpobj_count_refd(bpobj_t *bpo)
+{
+   mos_obj_refd(bpo->bpo_object);
+
+   if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) {
+   mos_obj_refd(bpo->bpo_phys->bpo_subobjs);
+   for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) {
+   uint64_t subobj;
+   bpobj_t subbpo;
+   int error;
+   VERIFY0(dmu_read(bpo->bpo_os,
+   bpo->bpo_phys->bpo_subobjs,
+   i * sizeof (subobj), sizeof (subobj), &subobj, 0));
+   error = bpobj_open(&subbpo, bpo->bpo_os, subobj);
+   if (error != 0) {
+   (void) printf("ERROR %u while trying to open "
+   "subobj id %llu\n",
+   error, (u_longlong_t)subobj);
+   continue;
+   }
+   bpobj_count_refd(&subbpo);
+   bpobj_close(&subbpo);
+   }
+   }
+}
+
+static void
 dump_deadlist(dsl_deadlist_t *dl)
 {
dsl_deadlist_entry_t *dle;
@@ -1781,7 +1812,24 @@ dump_deadlist(dsl_deadlist_t *dl)
char bytes[32];
char comp[32];
char uncomp[32];
+   uint64_t empty_bpobj =
+   dmu_objset_spa(dl->dl_os)->spa_dsl_pool->dp_empty_bpobj;
 
+   /* force the tree to be loaded */
+   dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused);
+
+   if (dl->dl_oldfmt) {
+   if (dl->dl_bpobj.bpo_object != empty_bpobj)
+   bpobj_count_refd(&dl->dl_bpobj);
+   } else {
+   mos_obj_refd(dl->dl_object);
+   for (dle = avl_first(&dl->dl_tree); dle;
+   dle = AVL_NEXT(&dl->dl_tree, dle)) {
+   if (dle->dle_bpobj.bpo_object != empty_bpobj)
+   bpobj_count_refd(&dle->dle_bpobj);
+   }
+   }
+
/* make sure nicenum has enough space */
CTASSERT(sizeof (bytes) >= NN_NUMBUF_SZ);
CTASSERT(sizeof (comp) >= NN_NUMBUF_SZ);
@@ -1806,9 +1854,6 @@ dump_deadlist(dsl_deadlist_t *dl)
 
(void) printf("\n");
 
-   /* force the tree to be loaded */
-   dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused);
-
for (dle = avl_first(&dl->dl_tree); dle;
dle = AVL_NEXT(&dl->dl_tree, dle)) {
if (dump_opt['d'] >= 5) {
@@ -2219,6 +2264,30 @@ dump_object(objset_t *os, uint64_t object, int verbosi
dmu_buf_rele(db, FTAG);
 }
 
+static void
+count_dir_mos_objects(dsl_dir_t *dd)
+{
+   mos_obj_refd(dd->dd_object);
+   mos_obj_refd(dsl_dir_phys(dd)->dd_child_dir_zapobj);
+   mos_obj_refd(dsl_dir_phys(dd)->dd_deleg_zapobj);
+   mos_obj_refd(dsl_dir_phys(dd)->dd_props_zapobj);
+   mos_obj_refd(dsl_dir_phys(dd)->dd_clones);
+}
+
+static void
+count_ds_mos_objects(dsl_dataset_t *ds)
+{
+   mos_obj_refd(ds->ds_object);
+   mos_obj_refd(dsl_dataset_phys(ds)->ds_next_clones_obj);
+   mos_obj_refd(dsl_dataset_phys(ds)->ds_props_obj);
+   mos_

svn commit: r348581 - head/cddl/contrib/opensolaris/lib/libzfs/common

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 20:40:32 2019
New Revision: 348581
URL: https://svnweb.freebsd.org/changeset/base/348581

Log:
  MFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly
  
  illumos/illumos-gate@20633e304b57bc98f70fdb194081b7023adf527b
  
  Reviewed by: Joshua M. Clulow 
  Approved by: Richard Lowe 
  Author: Paul Dagnelie 

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c   Mon Jun 
 3 20:39:13 2019(r348580)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c   Mon Jun 
 3 20:40:32 2019(r348581)
@@ -22,7 +22,7 @@
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2015, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2015, 2018 by Delphix. All rights reserved.
  * Copyright 2016 Joyent, Inc.
  * Copyright 2016 Igor Kozhukhov 
  */
@@ -47,7 +47,7 @@
 #include "libzfs_impl.h"
 
 #defineZDIFF_SNAPDIR   "/.zfs/snapshot/"
-#defineZDIFF_SHARESDIR "/.zfs/shares/"
+#defineZDIFF_SHARESDIR "/.zfs/shares/"
 #defineZDIFF_PREFIX"zfs-diff-%d"
 
 #defineZDIFF_ADDED '+'
@@ -361,12 +361,12 @@ describe_free(FILE *fp, differ_info_t *di, uint64_t ob
 
if (get_stats_for_obj(di, di->fromsnap, object, namebuf,
maxlen, &sb) != 0) {
-   /* Let it slide, if in the delete queue on from side */
-   if (di->zerr == ENOENT && sb.zs_links == 0) {
-   di->zerr = 0;
-   return (0);
-   }
return (-1);
+   }
+   /* Don't print if in the delete queue on from side */
+   if (di->zerr == ESTALE) {
+   di->zerr = 0;
+   return (0);
}
 
print_file(fp, di, ZDIFF_REMOVED, namebuf, &sb);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348579 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 20:24:40 2019
New Revision: 348579
URL: https://svnweb.freebsd.org/changeset/base/348579

Log:
  MFV r348578: 9962 zil_commit should omit cache thrash
  
  illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Brad Lewis 
  Reviewed by: Patrick Mooney 
  Reviewed by: Jerry Jelinek 
  Approved by: Joshua M. Clulow 
  Author: Prakash Surya 

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun  3 20:18:02 
2019(r348578)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun  3 20:24:40 
2019(r348579)
@@ -1933,6 +1933,7 @@ zil_replay_func_t *ztest_replay_vector[TX_MAX_TYPE] = 
  * ZIL get_data callbacks
  */
 
+/* ARGSUSED */
 static void
 ztest_get_done(zgd_t *zgd, int error)
 {
@@ -1944,9 +1945,6 @@ ztest_get_done(zgd_t *zgd, int error)
 
ztest_range_unlock(zgd->zgd_rl);
ztest_object_unlock(zd, object);
-
-   if (error == 0 && zgd->zgd_bp)
-   zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp);
 
umem_free(zgd, sizeof (*zgd));
 }

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Mon Jun  3 
20:18:02 2019(r348578)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c   Mon Jun  3 
20:24:40 2019(r348579)
@@ -1982,7 +1982,16 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf, void *varg)
dmu_sync_arg_t *dsa = varg;
dbuf_dirty_record_t *dr = dsa->dsa_dr;
dmu_buf_impl_t *db = dr->dr_dbuf;
+   zgd_t *zgd = dsa->dsa_zgd;
 
+   /*
+* Record the vdev(s) backing this blkptr so they can be flushed after
+* the writes for the lwb have completed.
+*/
+   if (zio->io_error == 0) {
+   zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp);
+   }
+
mutex_enter(&db->db_mtx);
ASSERT(dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC);
if (zio->io_error == 0) {
@@ -2032,13 +2041,22 @@ dmu_sync_late_arrival_done(zio_t *zio)
blkptr_t *bp = zio->io_bp;
dmu_sync_arg_t *dsa = zio->io_private;
blkptr_t *bp_orig = &zio->io_bp_orig;
+   zgd_t *zgd = dsa->dsa_zgd;
 
-   if (zio->io_error == 0 && !BP_IS_HOLE(bp)) {
-   ASSERT(!(zio->io_flags & ZIO_FLAG_NOPWRITE));
-   ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig));
-   ASSERT(zio->io_bp->blk_birth == zio->io_txg);
-   ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa));
-   zio_free(zio->io_spa, zio->io_txg, zio->io_bp);
+   if (zio->io_error == 0) {
+   /*
+* Record the vdev(s) backing this blkptr so they can be
+* flushed after the writes for the lwb have completed.
+*/
+   zil_lwb_add_block(zgd->zgd_lwb, zgd->zgd_bp);
+
+   if (!BP_IS_HOLE(bp)) {
+   ASSERT(!(zio->io_flags & ZIO_FLAG_NOPWRITE));
+   ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig));
+   ASSERT(zio->io_bp->blk_birth == zio->io_txg);
+   ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa));
+   zio_free(zio->io_spa, zio->io_txg, zio->io_bp);
+   }
}
 
dmu_tx_commit(dsa->dsa_tx);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h  Mon Jun 
 3 20:18:02 2019(r348578)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h  Mon Jun 
 3 20:24:40 2019(r348579)
@@ -48,10 +48,11 @@ extern "C" {
  * via zil_lwb_write_issue(). Again, the zilog's "zl_issuer_lock" must
  * be held when making this transition.
  *
- * After the lwb's zio completes, and the vdev's are flushed, the lwb
- * will transition into the "done" state via zil_lwb_write_done(). When
- * transitioning from "issued" to "done", the zilog's "zl_lock" must be
- * held, *not* the "zl_issuer_lock".
+ * After the lwb's write zio completes, it transitions into the "write
+ * done" state via zil_lwb_write_done(

svn commit: r348577 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 20:05:43 2019
New Revision: 348577
URL: https://svnweb.freebsd.org/changeset/base/348577

Log:
  MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush
  
  illumos/illumos-gate@f8fdf6812567ce1a3b76a6bee2ee3f04bd3fcaca
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Brad Lewis 
  Reviewed by: Patrick Mooney 
  Approved by: Dan McDonald 
  Author: Prakash Surya 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Jun  3 
19:53:39 2019(r348576)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Jun  3 
20:05:43 2019(r348577)
@@ -217,6 +217,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, standard_sm_blksz, CTLF
 &vdev_standard_sm_blksz, 0,
 "Block size for standard space map.  Power of 2 and greater than 4096.");
 
+/*
+ * Tunable parameter for debugging or performance analysis. Setting this
+ * will cause pool corruption on power loss if a volatile out-of-order
+ * write cache is enabled.
+ */
+boolean_t zfs_nocacheflush = B_FALSE;
+SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RWTUN,
+&zfs_nocacheflush, 0, "Disable cache flush");
+
 /*PRINTFLIKE2*/
 void
 vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Jun 
 3 19:53:39 2019(r348576)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Jun 
 3 20:05:43 2019(r348577)
@@ -239,6 +239,10 @@ vdev_file_io_start(zio_t *zio)
 
switch (zio->io_cmd) {
case DKIOCFLUSHWRITECACHE:
+
+   if (zfs_nocacheflush)
+   break;
+
zio->io_error = VOP_FSYNC(vf->vf_vnode, FSYNC | FDSYNC,
kcred, NULL);
break;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c   Mon Jun  3 
19:53:39 2019(r348576)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c   Mon Jun  3 
20:05:43 2019(r348577)
@@ -98,13 +98,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTL
 &zil_replay_disable, 0, "Disable intent logging replay");
 
 /*
- * Tunable parameter for debugging or performance analysis.  Setting
- * zfs_nocacheflush will cause corruption on power loss if a volatile
- * out-of-order write cache is enabled.
+ * Disable the DKIOCFLUSHWRITECACHE commands that are normally sent to
+ * the disk(s) by the ZIL after an LWB write has completed. Setting this
+ * will cause ZIL corruption on power loss if a volatile out-of-order
+ * write cache is enabled.
  */
-boolean_t zfs_nocacheflush = B_FALSE;
-SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RWTUN,
-&zfs_nocacheflush, 0, "Disable cache flush");
+boolean_t zil_nocacheflush = B_FALSE;
+SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_nocacheflush, CTLFLAG_RWTUN,
+&zil_nocacheflush, 0, "Disable ZIL cache flush");
+
 boolean_t zfs_trim_enabled = B_TRUE;
 SYSCTL_DECL(_vfs_zfs_trim);
 SYSCTL_INT(_vfs_zfs_trim, OID_AUTO, enabled, CTLFLAG_RDTUN, &zfs_trim_enabled, 
0,
@@ -989,7 +991,7 @@ zil_lwb_add_block(lwb_t *lwb, const blkptr_t *bp)
int ndvas = BP_GET_NDVAS(bp);
int i;
 
-   if (zfs_nocacheflush)
+   if (zil_nocacheflush)
return;
 
mutex_enter(&lwb->lwb_vdev_lock);
@@ -1013,7 +1015,7 @@ zil_lwb_add_txg(lwb_t *lwb, uint64_t txg)
 /*
  * This function is a called after all VDEVs associated with a given lwb
  * write have completed their DKIOCFLUSHWRITECACHE command; or as soon
- * as the lwb write completes, if "zfs_nocacheflush" is set.
+ * as the lwb write completes, if "zil_nocacheflush" is set.
  *
  * The intention is for this function to be called as soon as the
  * contents of an lwb are considered "stable" on disk, and will survive
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348575 - head/sys/contrib/ipfilter/netinet

2019-06-03 Thread Cy Schubert
Author: cy
Date: Mon Jun  3 19:37:14 2019
New Revision: 348575
URL: https://svnweb.freebsd.org/changeset/base/348575

Log:
  Properly define the fourth argument to ipf_check, the main entry point
  into ipfilter. A proper definition simplifies dtrace scripts a little.
  
  MFC after:1 week

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c
  head/sys/contrib/ipfilter/netinet/ip_fil.h

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==
--- head/sys/contrib/ipfilter/netinet/fil.c Mon Jun  3 19:25:53 2019
(r348574)
+++ head/sys/contrib/ipfilter/netinet/fil.c Mon Jun  3 19:37:14 2019
(r348575)
@@ -2810,7 +2810,7 @@ ipf_check(ctx, ip, hlen, ifp, out
mb_t **mp;
ip_t *ip;
int hlen;
-   void *ifp;
+   struct ifnet *ifp;
int out;
void *ctx;
 {

Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- head/sys/contrib/ipfilter/netinet/ip_fil.h  Mon Jun  3 19:25:53 2019
(r348574)
+++ head/sys/contrib/ipfilter/netinet/ip_fil.h  Mon Jun  3 19:37:14 2019
(r348575)
@@ -1655,7 +1655,7 @@ typedef struct ipf_main_softc_s {
} while (0)
 
 #ifndef_KERNEL
-extern int ipf_check __P((void *, struct ip *, int, void *, int, mb_t **));
+extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, 
mb_t **));
 extern struct  ifnet *get_unit __P((char *, int));
 extern char*get_ifname __P((struct ifnet *));
 extern int ipfioctl __P((ipf_main_softc_t *, int, ioctlcmd_t,
@@ -1672,7 +1672,7 @@ externint ipl_enable __P((void));
 extern int ipl_disable __P((void));
 # ifdef MENTAT
 /* XXX MENTAT is always defined for Solaris */
-extern int ipf_check __P((void *, struct ip *, int, void *, int, void *,
+extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, 
void *,
   mblk_t **));
 #  if SOLARIS
 extern voidipf_prependmbt(fr_info_t *, mblk_t *);
@@ -1681,7 +1681,7 @@ externint ipfioctl __P((dev_t, int, intptr_t, 
int, cr
 extern int ipf_qout __P((queue_t *, mblk_t *));
 # else /* MENTAT */
 /* XXX MENTAT is never defined for FreeBSD & NetBSD */
-extern int ipf_check __P((void *, struct ip *, int, void *, int, mb_t **));
+extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, 
mb_t **));
 extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **));
 extern size_t  mbufchainlen __P((mb_t *));
 #   ifdef  IPFILTER_LKM
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348574 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 19:25:53 2019
New Revision: 348574
URL: https://svnweb.freebsd.org/changeset/base/348574

Log:
  MFV r348573: 9993 zil writes can get delayed in zio pipeline
  
  illumos/illumos-gate@2258ad0b755b24a55c6173b1e6bb6188389f72dd
  
  Reviewed by: Prakash Surya 
  Reviewed by: Brad Lewis 
  Reviewed by: Matt Ahrens 
  Approved by: Dan McDonald 
  Author: George Wilson 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Mon Jun  3 
19:24:40 2019(r348573)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Mon Jun  3 
19:25:53 2019(r348574)
@@ -1614,7 +1614,8 @@ zio_taskq_dispatch(zio_t *zio, zio_taskq_type_t q, boo
 * If this is a high priority I/O, then use the high priority taskq if
 * available.
 */
-   if (zio->io_priority == ZIO_PRIORITY_NOW &&
+   if ((zio->io_priority == ZIO_PRIORITY_NOW ||
+   zio->io_priority == ZIO_PRIORITY_SYNC_WRITE) &&
spa->spa_zio_taskq[t][q + 1].stqs_count != 0)
q++;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348571 - in head/sys: arm64/arm64 x86/iommu x86/x86

2019-06-03 Thread Tycho Nightingale
Author: tychon
Date: Mon Jun  3 19:19:35 2019
New Revision: 348571
URL: https://svnweb.freebsd.org/changeset/base/348571

Log:
  very large dma mappings can cause integer overflow
  
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D20505

Modified:
  head/sys/arm64/arm64/busdma_bounce.c
  head/sys/x86/iommu/busdma_dmar.c
  head/sys/x86/x86/busdma_bounce.c

Modified: head/sys/arm64/arm64/busdma_bounce.c
==
--- head/sys/arm64/arm64/busdma_bounce.cMon Jun  3 19:15:06 2019
(r348570)
+++ head/sys/arm64/arm64/busdma_bounce.cMon Jun  3 19:19:35 2019
(r348571)
@@ -660,7 +660,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam
 /*
  * Add a single contiguous physical range to the segment list.
  */
-static int
+static bus_size_t
 _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr,
 bus_size_t sgsize, bus_dma_segment_t *segs, int *segp)
 {

Modified: head/sys/x86/iommu/busdma_dmar.c
==
--- head/sys/x86/iommu/busdma_dmar.cMon Jun  3 19:15:06 2019
(r348570)
+++ head/sys/x86/iommu/busdma_dmar.cMon Jun  3 19:19:35 2019
(r348571)
@@ -686,7 +686,7 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam
return (ENOMEM);
fma = NULL;
for (i = 0; i < ma_cnt; i++) {
-   paddr = pstart + i * PAGE_SIZE;
+   paddr = pstart + ptoa(i);
ma[i] = PHYS_TO_VM_PAGE(paddr);
if (ma[i] == NULL || VM_PAGE_TO_PHYS(ma[i]) != paddr) {
/*

Modified: head/sys/x86/x86/busdma_bounce.c
==
--- head/sys/x86/x86/busdma_bounce.cMon Jun  3 19:15:06 2019
(r348570)
+++ head/sys/x86/x86/busdma_bounce.cMon Jun  3 19:19:35 2019
(r348571)
@@ -667,7 +667,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmam
 /*
  * Add a single contiguous physical range to the segment list.
  */
-static int
+static bus_size_t
 _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t curaddr,
 bus_size_t sgsize, bus_dma_segment_t *segs, int *segp)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348570 - head/cddl/contrib/opensolaris/cmd/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 19:15:06 2019
New Revision: 348570
URL: https://svnweb.freebsd.org/changeset/base/348570

Log:
  MFV r348568: 9466 add JSON output support to channel programs
  
  illumos/illumos-gate@5267591016146502784860802129b16dab6f135c
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Serapheim Dimitropoulos 
  Reviewed by: Sara Hartse 
  Reviewed by: John Kennedy 
  Approved by: Dan McDonald 
  Author: Alek Pinchuk 

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Jun  3 19:10:46 
2019(r348569)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Jun  3 19:15:06 
2019(r348570)
@@ -9,6 +9,7 @@
 .\"
 .\"
 .\" Copyright (c) 2016, 2017 by Delphix. All rights reserved.
+.\" Copyright (c) 2018 Datto Inc.
 .\"
 .Dd October 02, 2017
 .Dt ZFS-PROGRAM 1M
@@ -18,7 +19,7 @@
 .Nd executes ZFS channel programs
 .Sh SYNOPSIS
 .Cm zfs program
-.Op Fl n
+.Op Fl jn
 .Op Fl t Ar instruction-limit
 .Op Fl m Ar memory-limit
 .Ar pool
@@ -46,6 +47,11 @@ will be run on
 and any attempts to access or modify other pools will cause an error.
 .Sh OPTIONS
 .Bl -tag -width "-t"
+.It Fl j
+Display channel program output in JSON format.
+When this flag is specified and standard output is empty -
+channel program encountered an error.
+The details of such an error will be printed to standard error in plain text.
 .It Fl n
 Executes a read-only channel program, which runs faster.
 The program cannot change on-disk state by calling functions from the

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Jun  3 19:10:46 2019
(r348569)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Jun  3 19:15:06 2019
(r348570)
@@ -29,6 +29,7 @@
 .\" Copyright (c) 2014, Xin LI 
 .\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
 .\" Copyright 2018 Joyent, Inc.
+.\" Copyright (c) 2018 Datto Inc.
 .\"
 .\" $FreeBSD$
 .\"
@@ -291,7 +292,7 @@
 .Op Ar snapshot Ns | Ns Ar filesystem
 .Nm
 .Cm program
-.Op Fl n
+.Op Fl jn
 .Op Fl t Ar timeout
 .Op Fl m Ar memory_limit
 .Ar pool script
@@ -3364,7 +3365,7 @@ Display the path's inode change time as the first colu
 .It Xo
 .Nm
 .Cm program
-.Op Fl n
+.Op Fl jn
 .Op Fl t Ar timeout
 .Op Fl m Ar memory_limit
 .Ar pool script
@@ -3387,6 +3388,11 @@ For full documentation of the ZFS channel program inte
 page for
 .Xr zfs-program 8 .
 .Bl -tag -width indent
+.It Fl j
+Display channel program output in JSON format.
+When this flag is specified and standard output is empty -
+channel program encountered an error.
+The details of such an error will be printed to standard error in plain text.
 .It Fl n
 Executes a read-only channel program, which runs faster.
 The program cannot change on-disk state by calling functions from

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cMon Jun  3 19:10:46 
2019(r348569)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cMon Jun  3 19:15:06 
2019(r348570)
@@ -30,6 +30,7 @@
  * Copyright (c) 2014 Integros [integros.com]
  * Copyright 2016 Igor Kozhukhov .
  * Copyright 2016 Nexenta Systems, Inc.
+ * Copyright (c) 2018 Datto Inc.
  */
 
 #include 
@@ -351,7 +352,7 @@ get_usage(zfs_help_t idx)
case HELP_BOOKMARK:
return (gettext("\tbookmark  \n"));
case HELP_CHANNEL_PROGRAM:
-   return (gettext("\tprogram [-n] [-t ] "
+   return (gettext("\tprogram [-jn] [-t ] "
"[-m ]   "
"[lua args...]\n"));
}
@@ -7238,12 +7239,12 @@ zfs_do_channel_program(int argc, char **argv)
nvlist_t *outnvl;
uint64_t instrlimit = ZCP_DEFAULT_INSTRLIMIT;
uint64_t memlimit = ZCP_DEFAULT_MEMLIMIT;
-   boolean_t sync_flag = B_TRUE;
+   boolean_t sync_flag = B_TRUE, json_output = B_FALSE;
zpool_handle_t *zhp;
 
/* check options */
while (-1 !=
-   (c = getopt(argc, argv, "nt:(instr-limit)m:(memory-limit)"))) {
+   (c = getopt(argc, argv, "jnt:(instr-limit)m:(memory-limit)"))) {
switch (c) {
case 't':
case 'm': {
@@ -7285,6 +7286,10 @@ zfs_do_channel_program(int argc, char **argv)
sync_flag = B_FALSE;
break;
}
+

svn commit: r348569 - in head/stand: common i386/zfsboot

2019-06-03 Thread Warner Losh
Author: imp
Date: Mon Jun  3 19:10:46 2019
New Revision: 348569
URL: https://svnweb.freebsd.org/changeset/base/348569

Log:
  [zfsboot] Fix boot env back compat (#190)
  
  * Fix boot env back compat
  
  zfsboot must try zfsloader before loader in order to remain compatible
  with boot environments created prior to zfs functionality being rolled
  into loader proper.
  
  * Improve comments in zfsboot
  
  Explain the significance of the load path order, and put the comment
  about looping through the paths in the appropriate scope.
  
  Obtained From:  TrueNAS commit 4c60c62fcf0b6b6eac98ee8d46e7bbea64bc86f5
  Submitted by: Ryan Moeller 

Modified:
  head/stand/common/paths.h
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/common/paths.h
==
--- head/stand/common/paths.h   Mon Jun  3 19:09:39 2019(r348568)
+++ head/stand/common/paths.h   Mon Jun  3 19:10:46 2019(r348569)
@@ -33,6 +33,7 @@
 #define PATH_CONFIG"/boot/config"
 #define PATH_LOADER"/boot/loader"
 #define PATH_LOADER_EFI"/boot/loader.efi"
+#define PATH_LOADER_ZFS"/boot/zfsloader"
 #define PATH_KERNEL"/boot/kernel/kernel"
 
 #endif /* _PATHS_H_ */

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Mon Jun  3 19:09:39 2019
(r348568)
+++ head/stand/i386/zfsboot/zfsboot.c   Mon Jun  3 19:10:46 2019
(r348569)
@@ -87,6 +87,24 @@ static const unsigned char flags[NOPT] = {
 };
 uint32_t opts;
 
+/*
+ * Paths to try loading before falling back to the boot2 prompt.
+ *
+ * /boot/zfsloader must be tried before /boot/loader in order to remain
+ * backward compatible with ZFS boot environments where /boot/loader exists
+ * but does not have ZFS support, which was the case before FreeBSD 12.
+ *
+ * If no loader is found, try to load a kernel directly instead.
+ */
+static const struct string {
+const char *p;
+size_t len;
+} loadpath[] = {
+{ PATH_LOADER_ZFS, sizeof(PATH_LOADER_ZFS) },
+{ PATH_LOADER, sizeof(PATH_LOADER) },
+{ PATH_KERNEL, sizeof(PATH_KERNEL) },
+};
+
 static const unsigned char dev_maj[NDEV] = {30, 4, 2};
 
 static char cmd[512];
@@ -857,16 +875,17 @@ main(void)
 if (nextboot && !autoboot)
reboot();
 
-/*
- * Try to exec /boot/loader. If interrupted by a keypress,
- * or in case of failure, try to load a kernel directly instead.
- */
-
 if (autoboot && !*kname) {
-   memcpy(kname, PATH_LOADER, sizeof(PATH_LOADER));
-   if (!keyhit(3)) {
+   /*
+* Iterate through the list of loader and kernel paths, trying to load.
+* If interrupted by a keypress, or in case of failure, drop the user
+* to the boot2 prompt.
+*/
+   for (i = 0; i < nitems(loadpath); i++) {
+   memcpy(kname, loadpath[i].p, loadpath[i].len);
+   if (keyhit(3))
+   break;
load();
-   memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
}
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348540 - head

2019-06-03 Thread Rodney W. Grimes
> Author: sobomax
> Date: Mon Jun  3 15:34:00 2019
> New Revision: 348540
> URL: https://svnweb.freebsd.org/changeset/base/348540
> 
> Log:
>   Rollback the rest of the botched r348521. Re-work would be posted to
>   reviews. Sorry.
>   
>   Reported by:Enji Cooper
> 
> Modified:
>   head/Makefile.inc1
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Mon Jun  3 15:32:42 2019(r348539)
> +++ head/Makefile.inc1Mon Jun  3 15:34:00 2019(r348540)
> @@ -887,7 +887,7 @@ MTREEFLAGS+=  -W
>  INSTALLFLAGS+=   -h sha256
>  .endif
>  .if defined(DB_FROM_SRC) || defined(NO_ROOT)
> -IMAKE_INSTALL=   INSTALL="${INSTALL} ${INSTALLFLAGS}"
> +IMAKE_INSTALL=   INSTALL="install ${INSTALLFLAGS}"

This is a correct change,
ngie please explain exactly why this is an exception to INSTALL?=install.

>  IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
>  .endif

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


Re: svn commit: r348532 - in head: . etc

2019-06-03 Thread Rodney W. Grimes
> Author: sobomax
> Date: Mon Jun  3 15:12:44 2019
> New Revision: 348532
> URL: https://svnweb.freebsd.org/changeset/base/348532
> 
> Log:
>   Leave mtree hardcoded for now. Reverting partially 348521 and also
>   the followup stopgap change, because I don't think it's a correct. I still
>   need to figure out where to stick it in. In cannot be in Makefile.inc1
>   and it cannot be in etc/Makefile from the looks of it to avoid
>   chicken-and-egg problem.

A quick and incomplete look at this leads me to believe that much of the
mtree related stuff in src/Makefile.inc1 should of been in src/etc
in the first place.
It ends up invoking etc/Makefile in the end anyway.
Can someone explain why this is pulled up a level?
Why do we now have distrib-dirs, distribution in
src/Makefile.inc1, these were and should be in etc/Makefile?
iirc hierarchy was pulled up to src/Makefile at one point,
but forgetting the reasoning for that.

> Modified:
>   head/Makefile.inc1
>   head/etc/Makefile
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Mon Jun  3 15:10:37 2019(r348531)
> +++ head/Makefile.inc1Mon Jun  3 15:12:44 2019(r348532)
> @@ -888,7 +888,7 @@ INSTALLFLAGS+=-h sha256
>  .endif
>  .if defined(DB_FROM_SRC) || defined(NO_ROOT)
>  IMAKE_INSTALL=   INSTALL="${INSTALL} ${INSTALLFLAGS}"
> -IMAKE_MTREE= MTREE_CMD="${MTREE} ${MTREEFLAGS}"
> +IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLAGS}"
>  .endif
>  
>  DESTDIR_MTREEFLAGS=  -deU
> 
> Modified: head/etc/Makefile
> ==
> --- head/etc/Makefile Mon Jun  3 15:10:37 2019(r348531)
> +++ head/etc/Makefile Mon Jun  3 15:12:44 2019(r348532)
> @@ -93,8 +93,6 @@ distribution:
>  .endif
>  .endif
>  
> -MTREE_CMD?=  mtree
> -
>  MTREES=  mtree/BSD.root.dist /   \
>   mtree/BSD.var.dist  /var\
>   mtree/BSD.usr.dist  /usr\
> 
> 

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


svn commit: r348567 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 19:03:24 2019
New Revision: 348567
URL: https://svnweb.freebsd.org/changeset/base/348567

Log:
  MFV r348555: 9690 metaslab of vdev with no space maps was flushed during 
removal
  
  illumos/illumos-gate@4e75ba682600b2bf19d158577d528c3db65050e8
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Brad Lewis 
  Approved by: Robert Mustacchi 
  Author: Serapheim Dimitropoulos 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Jun  3 
19:00:24 2019(r348566)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Mon Jun  3 
19:03:24 2019(r348567)
@@ -3031,11 +3031,11 @@ vdev_destroy_spacemaps(vdev_t *vd, dmu_tx_t *tx)
 }
 
 static void
-vdev_remove_empty(vdev_t *vd, uint64_t txg)
+vdev_remove_empty_log(vdev_t *vd, uint64_t txg)
 {
spa_t *spa = vd->vdev_spa;
-   dmu_tx_t *tx;
 
+   ASSERT(vd->vdev_islog);
ASSERT(vd == vd->vdev_top);
ASSERT3U(txg, ==, spa_syncing_txg(spa));
 
@@ -3079,13 +3079,14 @@ vdev_remove_empty(vdev_t *vd, uint64_t txg)
ASSERT0(mg->mg_histogram[i]);
}
 
-   tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg);
-   vdev_destroy_spacemaps(vd, tx);
+   dmu_tx_t *tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg);
 
-   if (vd->vdev_islog && vd->vdev_top_zap != 0) {
+   vdev_destroy_spacemaps(vd, tx);
+   if (vd->vdev_top_zap != 0) {
vdev_destroy_unlink_zap(vd, vd->vdev_top_zap, tx);
vd->vdev_top_zap = 0;
}
+
dmu_tx_commit(tx);
 }
 
@@ -3157,14 +3158,11 @@ vdev_sync(vdev_t *vd, uint64_t txg)
vdev_dtl_sync(lvd, txg);
 
/*
-* Remove the metadata associated with this vdev once it's empty.
-* Note that this is typically used for log/cache device removal;
-* we don't empty toplevel vdevs when removing them.  But if
-* a toplevel happens to be emptied, this is not harmful.
+* If this is an empty log device being removed, destroy the
+* metadata associated with it.
 */
-   if (vd->vdev_stat.vs_alloc == 0 && vd->vdev_removing) {
-   vdev_remove_empty(vd, txg);
-   }
+   if (vd->vdev_islog && vd->vdev_stat.vs_alloc == 0 && vd->vdev_removing)
+   vdev_remove_empty_log(vd, txg);
 
(void) txg_list_add(&spa->spa_vdev_txg_list, vd, TXG_CLEAN(txg));
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348566 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 19:00:24 2019
New Revision: 348566
URL: https://svnweb.freebsd.org/changeset/base/348566

Log:
  MFC r348554: 9688 aggsum_fini leaks memory
  
  illumos/illumos-gate@29bf2d68bef208274f5a54a14cc80c4a8cb76f53
  
  Reviewed by: Serapheim Dimitropoulos 
  Reviewed by: Matt Ahrens 
  Reviewed by: Prashanth Sreenivasa 
  Reviewed by: Jorgen Lundman 
  Reviewed by: Igor Kozhukhov 
  Approved by: Robert Mustacchi 
  Author: Paul Dagnelie 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.cMon Jun 
 3 18:32:56 2019(r348565)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/aggsum.cMon Jun 
 3 19:00:24 2019(r348566)
@@ -13,7 +13,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright (c) 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2017, 2018 by Delphix. All rights reserved.
  */
 
 #include 
@@ -99,6 +99,7 @@ aggsum_fini(aggsum_t *as)
 {
for (int i = 0; i < as->as_numbuckets; i++)
mutex_destroy(&as->as_buckets[i].asc_lock);
+   kmem_free(as->as_buckets, as->as_numbuckets * sizeof (aggsum_bucket_t));
mutex_destroy(&as->as_lock);
 }
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Mon Jun  3 
18:32:56 2019(r348565)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Mon Jun  3 
19:00:24 2019(r348566)
@@ -7074,6 +7074,16 @@ arc_state_fini(void)
multilist_destroy(arc_mru_ghost->arcs_list[ARC_BUFC_DATA]);
multilist_destroy(arc_mfu->arcs_list[ARC_BUFC_DATA]);
multilist_destroy(arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]);
+
+   aggsum_fini(&arc_meta_used);
+   aggsum_fini(&arc_size);
+   aggsum_fini(&astat_data_size);
+   aggsum_fini(&astat_metadata_size);
+   aggsum_fini(&astat_hdr_size);
+   aggsum_fini(&astat_bonus_size);
+   aggsum_fini(&astat_dnode_size);
+   aggsum_fini(&astat_dbuf_size);
+   aggsum_fini(&astat_l2_hdr_size);
 }
 
 uint64_t
@@ -7357,8 +7367,13 @@ arc_fini(void)
mutex_destroy(&arc_adjust_lock);
cv_destroy(&arc_adjust_waiters_cv);
 
-   arc_state_fini();
+   /*
+* buf_fini() must proceed arc_state_fini() because buf_fin() may
+* trigger the release of kmem magazines, which can callback to
+* arc_space_return() which accesses aggsums freed in act_state_fini().
+*/
buf_fini();
+   arc_state_fini();
 
ASSERT0(arc_loaned_bytes);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Rodney W. Grimes
> On Mon, Jun 3, 2019 at 7:28 AM Enji Cooper  wrote:
> 
> > Hi Maxim,
> >
> >
> > > Modified: head/Makefile.inc1
> > >
> > ==
> > > --- head/Makefile.inc1Sun Jun  2 22:27:26 2019(r348520)
> > > +++ head/Makefile.inc1Sun Jun  2 23:38:19 2019(r348521)
> > > @@ -887,8 +887,8 @@ MTREEFLAGS+=-W
> > > INSTALLFLAGS+=-h sha256
> > > .endif
> > > .if defined(DB_FROM_SRC) || defined(NO_ROOT)
> > > -IMAKE_INSTALL=INSTALL="install ${INSTALLFLAGS}"
> > > -IMAKE_MTREE=MTREE_CMD="mtree ${MTREEFLAGS}"
> > > +IMAKE_INSTALL=INSTALL="${INSTALL} ${INSTALLFLAGS}"
> > > +IMAKE_MTREE=MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}"

I see the bugger with this change now, it is a loop,
MTREE_CMD=${MTREE_CMD}... and I do not think MTREE_CMD is defined
at this point, see below.

> > > .endif
> >
> > Please back out this part of the change as it is unnecessary and adds
> > a dependency on sys.mk?s definitions. $PATH should contain, i.e., be
> > populated, with these tools when running make installworld. This is part of
> > the logic behind how $ITOOLS, etc, works.

That would be in direct conflict with how preceding tools
worked,  INSTALL?=install has been there for a very very long time
and any direct invoke of install in our Makefile/.mk files is just wrong,
and for the very reasoning that Max is trying to do.

I made the mistake of following someone else earlier that thought
it was INSTALL that was undefined, and as we known now that was
not the case, it was MTREE_CMD that was undefined, and that is
less clear, as iirc when that was originally done mtree was
contained soly in src/etc/Makefile by design.  It appears as
if that hos how crept up directly into head/Makefile.inc1, and
the definition for MTREE_CMD?= did not get moved to a more
appropriate place.

> > Thank you very much for your work and the rest of the change though!
> >
> 
>  Thanks Enji, for a clarification, will do. I still cannot understand why
> can't we have those tools being re-defined with top-level make environment?

You should and must be able to do this.
Especially for INSTALL, I fully support that part of this change staying.
 
> What I am striving at is being able to do say, make INSTALL="abcd"
> installworld. Yes, I understand I can call "abcd" "install" (or make a
> symlink to it) and put it into PATH, but there are at least one issue here,
> namely what if I need to pass some distinct argument to abcd based on usage
> scenario. E.g. make INSTALL="abcd foo" distributiuon. In your case I should
> be resorting to setting up some global environment variable and hope it
> won't get erased somewhere in the call chain, but that's bit "how you
> doing" IMHO. My approach makes certain things so much easier by cutting
> those un-neded steps.
> 
> At any rate thank for a feedback and some background info, I will do more
> work on this. I was thinking more in terms of having some sort of
> bsd.bootools.mk where this can be defined in a centralized manner.
> 
> -Max

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


svn commit: r348565 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 18:32:56 2019
New Revision: 348565
URL: https://svnweb.freebsd.org/changeset/base/348565

Log:
  MFV r348553: 9681 ztest failure in spa_history_log_internal due to 
spa_rename()
  
  illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728
  
  Reviewed by: Prakash Surya 
  Reviewed by: Serapheim Dimitropoulos 
  Approved by: Robert Mustacchi 
  Author: Matthew Ahrens 

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun  3 17:56:44 
2019(r348564)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jun  3 18:32:56 
2019(r348565)
@@ -338,7 +338,6 @@ ztest_func_t ztest_spa_create_destroy;
 ztest_func_t ztest_fault_inject;
 ztest_func_t ztest_ddt_repair;
 ztest_func_t ztest_dmu_snapshot_hold;
-ztest_func_t ztest_spa_rename;
 ztest_func_t ztest_scrub;
 ztest_func_t ztest_dsl_dataset_promote_busy;
 ztest_func_t ztest_vdev_attach_detach;
@@ -384,7 +383,6 @@ ztest_info_t ztest_info[] = {
{ ztest_ddt_repair, 1,  &zopt_sometimes },
{ ztest_dmu_snapshot_hold,  1,  &zopt_sometimes },
{ ztest_reguid, 1,  &zopt_rarely},
-   { ztest_spa_rename, 1,  &zopt_rarely},
{ ztest_scrub,  1,  &zopt_often },
{ ztest_spa_upgrade,1,  &zopt_rarely},
{ ztest_dsl_dataset_promote_busy,   1,  &zopt_rarely},
@@ -5550,59 +5548,6 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id)
VERIFY3U(load, ==, spa_load_guid(spa));
 }
 
-/*
- * Rename the pool to a different name and then rename it back.
- */
-/* ARGSUSED */
-void
-ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
-{
-   char *oldname, *newname;
-   spa_t *spa;
-
-   rw_enter(&ztest_name_lock, RW_WRITER);
-
-   oldname = ztest_opts.zo_pool;
-   newname = umem_alloc(strlen(oldname) + 5, UMEM_NOFAIL);
-   (void) strcpy(newname, oldname);
-   (void) strcat(newname, "_tmp");
-
-   /*
-* Do the rename
-*/
-   VERIFY3U(0, ==, spa_rename(oldname, newname));
-
-   /*
-* Try to open it under the old name, which shouldn't exist
-*/
-   VERIFY3U(ENOENT, ==, spa_open(oldname, &spa, FTAG));
-
-   /*
-* Open it under the new name and make sure it's still the same spa_t.
-*/
-   VERIFY3U(0, ==, spa_open(newname, &spa, FTAG));
-
-   ASSERT(spa == ztest_spa);
-   spa_close(spa, FTAG);
-
-   /*
-* Rename it back to the original
-*/
-   VERIFY3U(0, ==, spa_rename(newname, oldname));
-
-   /*
-* Make sure it can still be opened
-*/
-   VERIFY3U(0, ==, spa_open(oldname, &spa, FTAG));
-
-   ASSERT(spa == ztest_spa);
-   spa_close(spa, FTAG);
-
-   umem_free(newname, strlen(newname) + 1);
-
-   rw_exit(&ztest_name_lock);
-}
-
 static vdev_t *
 ztest_random_concrete_vdev_leaf(vdev_t *vd)
 {
@@ -6661,7 +6606,6 @@ main(int argc, char **argv)
ztest_shared_callstate_t *zc;
char timebuf[100];
char numbuf[NN_NUMBUF_SZ];
-   spa_t *spa;
char *cmd;
boolean_t hasalt;
char *fd_data_str = getenv("ZTEST_FD_DATA");
@@ -6835,24 +6779,6 @@ main(int argc, char **argv)
}
(void) printf("\n");
}
-
-   /*
-* It's possible that we killed a child during a rename test,
-* in which case we'll have a 'ztest_tmp' pool lying around
-* instead of 'ztest'.  Do a blind rename in case this happened.
-*/
-   kernel_init(FREAD);
-   if (spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0) {
-   spa_close(spa, FTAG);
-   } else {
-   char tmpname[ZFS_MAX_DATASET_NAME_LEN];
-   kernel_fini();
-   kernel_init(FREAD | FWRITE);
-   (void) snprintf(tmpname, sizeof (tmpname), "%s_tmp",
-   ztest_opts.zo_pool);
-   (void) spa_rename(tmpname, ztest_opts.zo_pool);
-   }
-   kernel_fini();
 
ztest_run_zdb(ztest_opts.zo_pool);
}

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

svn commit: r348564 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:56:44 2019
New Revision: 348564
URL: https://svnweb.freebsd.org/changeset/base/348564

Log:
  MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool
  
  illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047
  
  Reviewed by: Brad Lewis 
  Reviewed by: Matt Ahrens 
  Reviewed by: Sara Hartse 
  Approved by: Robert Mustacchi 
  Author: Serapheim Dimitropoulos 

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun  3 17:44:47 2019
(r348563)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun  3 17:56:44 2019
(r348564)
@@ -2271,10 +2271,11 @@ dump_dir(objset_t *os)
dmu_objset_name(os, osname);
 
(void) printf("Dataset %s [%s], ID %llu, cr_txg %llu, "
-   "%s, %llu objects%s\n",
+   "%s, %llu objects%s%s\n",
osname, type, (u_longlong_t)dmu_objset_id(os),
(u_longlong_t)dds.dds_creation_txg,
-   numbuf, (u_longlong_t)usedobjs, blkbuf);
+   numbuf, (u_longlong_t)usedobjs, blkbuf,
+   (dds.dds_inconsistent) ? " (inconsistent)" : "");
 
if (zopt_objects != 0) {
for (i = 0; i < zopt_objects; i++)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Mon Jun  3 
17:44:47 2019(r348563)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Mon Jun  3 
17:56:44 2019(r348564)
@@ -3953,8 +3953,17 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char
 */
spa_history_log_version(spa, "open");
 
+   spa_restart_removal(spa);
+   spa_spawn_aux_threads(spa);
+
/*
 * Delete any inconsistent datasets.
+*
+* Note:
+* Since we may be issuing deletes for clones here,
+* we make sure to do so after we've spawned all the
+* auxiliary threads above (from which the livelist
+* deletion zthr is part of).
 */
(void) dmu_objset_find(spa_name(spa),
dsl_destroy_inconsistent, NULL, DS_FIND_CHILDREN);
@@ -3963,10 +3972,6 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char
 * Clean up any stale temporary dataset userrefs.
 */
dsl_pool_clean_tmp_userrefs(spa->spa_dsl_pool);
-
-   spa_restart_removal(spa);
-
-   spa_spawn_aux_threads(spa);
 
spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
vdev_initialize_restart(spa->spa_root_vdev);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348563 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:44:47 2019
New Revision: 348563
URL: https://svnweb.freebsd.org/changeset/base/348563

Log:
  MFV r348551: 9862 fix typo in comment in vdev_impl.h
  
  illumos/illumos-gate@84927f52bd837f6e4882a19e43fd026f1828d910
  
  Reviewed by: Matthew Ahrens 
  Reviewed by: Brian Behlendorf 
  Approved by: Robert Mustacchi 
  Author: Allan Jude 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Jun 
 3 17:43:32 2019(r348562)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Jun 
 3 17:44:47 2019(r348563)
@@ -319,7 +319,7 @@ struct vdev {
 
/*
 * The queue depth parameters determine how many async writes are
-* still pending (i.e. allocated by net yet issued to disk) per
+* still pending (i.e. allocated but not yet issued to disk) per
 * top-level (vdev_async_write_queue_depth) and the maximum allowed
 * (vdev_max_async_write_queue_depth). These values only apply to
 * top-level vdevs.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348562 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:43:32 2019
New Revision: 348562
URL: https://svnweb.freebsd.org/changeset/base/348562

Log:
  MFV r348550: 1700 Add SCSI UNMAP support
  
  illumos/illumos-gate@047c81d31d0f571d6652e97143cd15281de61e84
  
  Reviewed by: Jerry Jelinek 
  Reviewed by: Garrett D'Amore 
  Reviewed by: Igor Kozhukhov 
  Approved by: Dan McDonald 
  Author: Saso Kiselkov 
  
  This is irrelevant to FreeBSD, just a diff reduction.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Jun  3 
17:40:11 2019(r348561)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c  Mon Jun  3 
17:43:32 2019(r348562)
@@ -26,7 +26,7 @@
  *
  * Portions Copyright 2010 Robert Milkowski
  *
- * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  * Copyright (c) 2014 Integros [integros.com]
@@ -2259,44 +2259,64 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag,
 
case DKIOCFREE:
{
-   dkioc_free_t df;
+   dkioc_free_list_t *dfl;
dmu_tx_t *tx;
 
if (!zvol_unmap_enabled)
break;
 
-   if (ddi_copyin((void *)arg, &df, sizeof (df), flag)) {
-   error = SET_ERROR(EFAULT);
-   break;
+   if (!(flag & FKIOCTL)) {
+   error = dfl_copyin((void *)arg, &dfl, flag, KM_SLEEP);
+   if (error != 0)
+   break;
+   } else {
+   dfl = (dkioc_free_list_t *)arg;
+   ASSERT3U(dfl->dfl_num_exts, <=, DFL_COPYIN_MAX_EXTS);
+   if (dfl->dfl_num_exts > DFL_COPYIN_MAX_EXTS) {
+   error = SET_ERROR(EINVAL);
+   break;
+   }
}
 
-   /*
-* Apply Postel's Law to length-checking.  If they overshoot,
-* just blank out until the end, if there's a need to blank
-* out anything.
-*/
-   if (df.df_start >= zv->zv_volsize)
-   break;  /* No need to do anything... */
-
mutex_exit(&zfsdev_state_lock);
 
-   rl = zfs_range_lock(&zv->zv_znode, df.df_start, df.df_length,
-   RL_WRITER);
-   tx = dmu_tx_create(zv->zv_objset);
-   dmu_tx_mark_netfree(tx);
-   error = dmu_tx_assign(tx, TXG_WAIT);
-   if (error != 0) {
-   dmu_tx_abort(tx);
-   } else {
-   zvol_log_truncate(zv, tx, df.df_start,
-   df.df_length, B_TRUE);
-   dmu_tx_commit(tx);
-   error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ,
-   df.df_start, df.df_length);
-   }
+   for (int i = 0; i < dfl->dfl_num_exts; i++) {
+   uint64_t start = dfl->dfl_exts[i].dfle_start,
+   length = dfl->dfl_exts[i].dfle_length,
+   end = start + length;
 
-   zfs_range_unlock(rl);
+   /*
+* Apply Postel's Law to length-checking.  If they
+* overshoot, just blank out until the end, if there's
+* a need to blank out anything.
+*/
+   if (start >= zv->zv_volsize)
+   continue;   /* No need to do anything... */
+   if (end > zv->zv_volsize) {
+   end = DMU_OBJECT_END;
+   length = end - start;
+   }
 
+   rl = zfs_range_lock(&zv->zv_znode, start, length,
+   RL_WRITER);
+   tx = dmu_tx_create(zv->zv_objset);
+   error = dmu_tx_assign(tx, TXG_WAIT);
+   if (error != 0) {
+   dmu_tx_abort(tx);
+   } else {
+   zvol_log_truncate(zv, tx, start, length,
+   B_TRUE);
+   dmu_tx_commit(tx);
+   error = dmu_free_long_range(zv->zv_objset,
+   ZVOL_OBJ, start, length);
+   }
+
+   zfs_ra

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

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:40:11 2019
New Revision: 348561
URL: https://svnweb.freebsd.org/changeset/base/348561

Log:
  MFV r348548: 9617 too-frequent TXG sync causes excessive write inflation
  
  illumos/illumos-gate@7928f4baf4ab3230557eb6289be68aa7a3003f38
  
  Reviewed by: Serapheim Dimitropoulos 
  Reviewed by: Brad Lewis 
  Reviewed by: George Wilson 
  Reviewed by: Andrew Stormont 
  Approved by: Robert Mustacchi 
  Author: Matthew Ahrens 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c  Mon Jun 
 3 17:34:01 2019(r348560)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c  Mon Jun 
 3 17:40:11 2019(r348561)
@@ -108,9 +108,11 @@ uint64_t zfs_dirty_data_max_max = 4ULL * 1024 * 1024 *
 int zfs_dirty_data_max_percent = 10;
 
 /*
- * If there is at least this much dirty data, push out a txg.
+ * If there's at least this much dirty data (as a percentage of
+ * zfs_dirty_data_max), push out a txg.  This should be less than
+ * zfs_vdev_async_write_active_min_dirty_percent.
  */
-uint64_t zfs_dirty_data_sync = 64 * 1024 * 1024;
+uint64_t zfs_dirty_data_sync_pct = 20;
 
 /*
  * Once there is this amount of dirty data, the dmu_tx_delay() will kick in
@@ -190,9 +192,9 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, dirty_data_max_percent
 sysctl_zfs_dirty_data_max_percent, "I",
 "The percent of physical memory used to auto calculate dirty_data_max");
 
-SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN,
-&zfs_dirty_data_sync, 0,
-"Force a txg if the number of dirty buffer bytes exceed this value");
+SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync_pct, CTLFLAG_RWTUN,
+&zfs_dirty_data_sync_pct, 0,
+"Force a txg if the percent of dirty buffer bytes exceed this value");
 
 static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS);
 /* No zfs_delay_min_dirty_percent tunable due to limit requirements */
@@ -926,10 +928,12 @@ dsl_pool_need_dirty_delay(dsl_pool_t *dp)
 {
uint64_t delay_min_bytes =
zfs_dirty_data_max * zfs_delay_min_dirty_percent / 100;
+   uint64_t dirty_min_bytes =
+   zfs_dirty_data_max * zfs_dirty_data_sync_pct / 100;
boolean_t rv;
 
mutex_enter(&dp->dp_lock);
-   if (dp->dp_dirty_total > zfs_dirty_data_sync)
+   if (dp->dp_dirty_total > dirty_min_bytes)
txg_kick(dp);
rv = (dp->dp_dirty_total > delay_min_bytes);
mutex_exit(&dp->dp_lock);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h  Mon Jun 
 3 17:34:01 2019(r348560)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h  Mon Jun 
 3 17:40:11 2019(r348561)
@@ -53,7 +53,7 @@ struct dsl_scan;
 
 extern uint64_t zfs_dirty_data_max;
 extern uint64_t zfs_dirty_data_max_max;
-extern uint64_t zfs_dirty_data_sync;
+extern uint64_t zfs_dirty_data_sync_pct;
 extern int zfs_dirty_data_max_percent;
 extern int zfs_delay_min_dirty_percent;
 extern uint64_t zfs_delay_scale;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c   Mon Jun  3 
17:34:01 2019(r348560)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c   Mon Jun  3 
17:40:11 2019(r348561)
@@ -490,6 +490,8 @@ txg_sync_thread(void *arg)
uint64_t timeout = zfs_txg_timeout * hz;
uint64_t timer;
uint64_t txg;
+   uint64_t dirty_min_bytes =
+   zfs_dirty_data_max * zfs_dirty_data_sync_pct / 100;
 
/*
 * We sync when we're scanning, there's someone waiting
@@ -501,7 +503,7 @@ txg_sync_thread(void *arg)
!tx->tx_exiting && timer > 0 &&
tx->tx_synced_txg >= tx->tx_sync_txg_waiting &&
!txg_has_quiesced_to_sync(dp) &&
-   dp->dp_dirty_total < zfs_dirty_data_sync) {
+   dp->dp_dirty_total < dirty_min_bytes) {
dprintf("waiting; tx_synced=%llu waiting=%llu dp=%p\n",
tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp);
txg_thread_wait(tx, &cpr, &tx->tx_sync_more_cv, timer);
___
svn-src-head@freebsd.org

svn commit: r348559 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:29:57 2019
New Revision: 348559
URL: https://svnweb.freebsd.org/changeset/base/348559

Log:
  MFV r348537: 8601 memory leak in get_special_prop()
  
  illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1
  
  Reviewed by: Serapheim Dimitropoulos 
  Reviewed by: Sara Hartse 
  Reviewed by: Pavel Zakharov 
  Reviewed by: Matt Ahrens 
  Reviewed by: Robert Mustacchi 
  Approved by: Dan McDonald 
  Author: John Gallagher 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c   Mon Jun 
 3 17:27:25 2019(r348558)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c   Mon Jun 
 3 17:29:57 2019(r348559)
@@ -14,7 +14,7 @@
  */
 
 /*
- * Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
  */
 
 #include "lua.h"
@@ -431,16 +431,21 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, 
case ZFS_PROP_INCONSISTENT:
numval = dsl_get_inconsistent(ds);
break;
-   case ZFS_PROP_RECEIVE_RESUME_TOKEN:
-   VERIFY3U(strlcpy(strval, get_receive_resume_stats_impl(ds),
-   ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN);
+   case ZFS_PROP_RECEIVE_RESUME_TOKEN: {
+   char *token = get_receive_resume_stats_impl(ds);
+   VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <,
+   ZAP_MAXVALUELEN);
+   strfree(token);
if (strcmp(strval, "") == 0) {
-   VERIFY3U(strlcpy(strval, get_child_receive_stats(ds),
-   ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN);
+   token = get_child_receive_stats(ds);
+   VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <,
+   ZAP_MAXVALUELEN);
+   strfree(token);
if (strcmp(strval, "") == 0)
error = ENOENT;
}
break;
+   }
case ZFS_PROP_VOLSIZE:
ASSERT(ds_type == ZFS_TYPE_VOLUME);
error = dmu_objset_from_ds(ds, &os);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348558 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:27:25 2019
New Revision: 348558
URL: https://svnweb.freebsd.org/changeset/base/348558

Log:
  MFV r348535: 9677 panic from zio_write_gang_block() when creating dump device 
on fragmented rpool
  
  illumos/illumos-gate@7341a7de4f0489193e0cfe11049a7bcf1596a4db
  
  Reviewed by: Matt Ahrens 
  Reviewed by: George Wilson 
  Reviewed by: Prashanth Sreenivasa 
  Approved by: Robert Mustacchi 
  Author: Brad Lewis 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Mon Jun  3 
17:19:05 2019(r348557)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Mon Jun  3 
17:27:25 2019(r348558)
@@ -2319,7 +2319,13 @@ zio_write_gang_member_ready(zio_t *zio)
 static void
 zio_write_gang_done(zio_t *zio)
 {
-   abd_put(zio->io_abd);
+   /*
+* The io_abd field will be NULL for a zio with no data.  The io_flags
+* will initially have the ZIO_FLAG_NODATA bit flag set, but we can't
+* check for it here as it is cleared in zio_ready.
+*/
+   if (zio->io_abd != NULL)
+   abd_put(zio->io_abd);
 }
 
 static zio_t *
@@ -2340,11 +2346,12 @@ zio_write_gang_block(zio_t *pio)
int gbh_copies = MIN(copies + 1, spa_max_replication(spa));
zio_prop_t zp;
int error;
+   boolean_t has_data = !(pio->io_flags & ZIO_FLAG_NODATA);
 
int flags = METASLAB_HINTBP_FAVOR | METASLAB_GANG_HEADER;
if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) {
ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE);
-   ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA));
+   ASSERT(has_data);
 
flags |= METASLAB_ASYNC_ALLOC;
VERIFY(refcount_held(&mc->mc_alloc_slots[pio->io_allocator],
@@ -2368,7 +2375,7 @@ zio_write_gang_block(zio_t *pio)
if (error) {
if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) {
ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE);
-   ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA));
+   ASSERT(has_data);
 
/*
 * If we failed to allocate the gang block header then
@@ -2421,14 +2428,15 @@ zio_write_gang_block(zio_t *pio)
zp.zp_nopwrite = B_FALSE;
 
zio_t *cio = zio_write(zio, spa, txg, &gbh->zg_blkptr[g],
-   abd_get_offset(pio->io_abd, pio->io_size - resid), lsize,
-   lsize, &zp, zio_write_gang_member_ready, NULL, NULL,
+   has_data ? abd_get_offset(pio->io_abd, pio->io_size -
+   resid) : NULL, lsize, lsize, &zp,
+   zio_write_gang_member_ready, NULL, NULL,
zio_write_gang_done, &gn->gn_child[g], pio->io_priority,
ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark);
 
if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) {
ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE);
-   ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA));
+   ASSERT(has_data);
 
/*
 * Gang children won't throttle but we should
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348557 - head/cddl/contrib/opensolaris/lib/libzfs/common

2019-06-03 Thread Alexander Motin
Author: mav
Date: Mon Jun  3 17:19:05 2019
New Revision: 348557
URL: https://svnweb.freebsd.org/changeset/base/348557

Log:
  MFV r348534: 9616 Bogus error when attempting to set property on read-only 
pool
  
  illumos/illumos-gate@f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391
  
  Reviewed by: Paul Dagnelie 
  Reviewed by: Matt Ahrens 
  Approved by: Robert Mustacchi 
  Author: Andrew Stormont 

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.cMon Jun 
 3 17:14:54 2019(r348556)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.cMon Jun 
 3 17:19:05 2019(r348557)
@@ -30,7 +30,7 @@
  * Copyright (c) 2014 Integros [integros.com]
  * Copyright 2017 Nexenta Systems, Inc.
  * Copyright 2016 Igor Kozhukhov 
- * Copyright 2017 RackTop Systems.
+ * Copyright 2017-2018 RackTop Systems.
  */
 
 #include 
@@ -1842,13 +1842,18 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props)
ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc);
 
if (ret != 0) {
+   if (zc.zc_nvlist_dst_filled == B_FALSE) {
+   (void) zfs_standard_error(hdl, errno, errbuf);
+   goto error;
+   }
+
/* Get the list of unset properties back and report them. */
nvlist_t *errorprops = NULL;
if (zcmd_read_dst_nvlist(hdl, &zc, &errorprops) != 0)
goto error;
-   for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL);
+   for (nvpair_t *elem = nvlist_next_nvpair(errorprops, NULL);
elem != NULL;
-   elem = nvlist_next_nvpair(nvl, elem)) {
+   elem = nvlist_next_nvpair(errorprops, elem)) {
zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem));
zfs_setprop_error(hdl, prop, errno, errbuf);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348547 - head/usr.sbin/rpc.yppasswdd

2019-06-03 Thread Mark Johnston
Author: markj
Date: Mon Jun  3 16:51:07 2019
New Revision: 348547
URL: https://svnweb.freebsd.org/changeset/base/348547

Log:
  rpc.yppasswdd: Fix dirname(3) usage after r305952.
  
  PR:   234972
  Submitted by: Edward Fuhr  (original)
  MFC after:3 days

Modified:
  head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c

Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
==
--- head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c  Mon Jun  3 16:47:51 
2019(r348546)
+++ head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c  Mon Jun  3 16:51:07 
2019(r348547)
@@ -468,7 +468,9 @@ yppasswdproc_update_1_svc(yppasswd *argp, struct svc_r
char *cryptpw;
char *oldshell = NULL;
char *oldgecos = NULL;
+   char *passdir;
char *passfile_hold;
+   char passdir_buf[MAXPATHLEN + 2];
char passfile_buf[MAXPATHLEN + 2];
char passfile_hold_buf[MAXPATHLEN + 2];
char *domain = yppasswd_domain;
@@ -602,11 +604,14 @@ yppasswdproc_update_1_svc(yppasswd *argp, struct svc_r
snprintf(passfile_hold_buf, sizeof(passfile_hold_buf),
"%s.hold", passfile);
passfile_hold = (char *)&passfile_hold_buf;
-   
 
+
/* Step 5: make a new password file with the updated info. */
 
-   if (pw_init(dirname(passfile), passfile)) {
+   snprintf(passdir_buf, sizeof(passdir_buf), "%s", passfile);
+   passdir = dirname(passdir_buf);
+
+   if (pw_init(passdir, passfile)) {
yp_error("pw_init() failed");
return &result;
}
@@ -726,7 +731,9 @@ yppasswdproc_update_master_1_svc(master_yppasswd *argp
uid_t uid;
int rval = 0;
DBT key, data;
+   char *passdir;
char *passfile_hold;
+   char passdir_buf[MAXPATHLEN + 2];
char passfile_buf[MAXPATHLEN + 2];
char passfile_hold_buf[MAXPATHLEN + 2];
struct sockaddr_in *rqhost;
@@ -829,7 +836,10 @@ allow additions to be made to the password database");
"%s.hold", passfile);
passfile_hold = (char *)&passfile_hold_buf;
 
-   if (pw_init(dirname(passfile), passfile)) {
+   snprintf(passdir_buf, sizeof(passdir_buf), "%s", passfile);
+   passdir = dirname(passdir_buf);
+
+   if (pw_init(passdir, passfile)) {
yp_error("pw_init() failed");
return &result;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348545 - head/lib/libutil

2019-06-03 Thread Mark Johnston
Author: markj
Date: Mon Jun  3 16:47:00 2019
New Revision: 348545
URL: https://svnweb.freebsd.org/changeset/base/348545

Log:
  Typo.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libutil/pw_util.3

Modified: head/lib/libutil/pw_util.3
==
--- head/lib/libutil/pw_util.3  Mon Jun  3 16:21:09 2019(r348544)
+++ head/lib/libutil/pw_util.3  Mon Jun  3 16:47:00 2019(r348545)
@@ -58,7 +58,7 @@
 .Ft void
 .Fn pw_fini "void"
 .Ft int
-.Fn pw_init "const char *dir" const char *master"
+.Fn pw_init "const char *dir" "const char *master"
 .Ft void
 .Fn pw_initpwd "struct passwd *pw"
 .Ft "char *"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Ian Lepore
On Mon, 2019-06-03 at 18:19 +0300, Andriy Gapon wrote:
> On 03/06/2019 17:52, Ian Lepore wrote:
> > Please don't.  We still have a situation where nobody has shown a
> > runtime failure at all.  This build failure could be fixed by
> > simply
> > defining a do-nothing iicbus_set_nostop() function if a quick fix
> > is
> > needed.
> 
> Well, I am quite certain that the run-time failure will follow after
> the build
> time failure is fixed.
> 
> > Putting this nostop concept into code that is shared by many
> > drivers is
> > an abomination.  We have exactly one driver that needs this
> > functionality, so the right fix is to implement it wholly within
> > that
> > one driver.  I'll put together a diff for that.
> 
> That's true that we have just one such driver.
> At the same time, the "no stop" (or rather, repeated start) behavior
> makes more
> sense.  If stop+start between transfers are needed then that can be
> done with
> multiple calls to iicbus_transfer.  If multiple messages are given to
> iicbus_transfer, then it's reasonable to assume that a repeated
> started is
> wanted between them.  But it would be a big change to review and, if
> needed, fix
> or tidy up all code that uses iicbus_transfer.  So,
> iicbus_set_nostop() could be
> just a small step towards the bigger goal.
> 
> But I really don't have a strong opinion.
> Fixing drm2 directly is just as good for me as iicbus_set_nostop.
> 

I agree with you that the freebsd iic stuff is a Big Mess, poorly
designed.  But it is what it is, we can't change things now without
breaking every out-of-tree driver in the world (and I know for sure
they exist, because we have some at $work).  So we're stuck with
explicitly setting NOSTOP flags in iic_msg descriptors even though it
would be sensible to assume NOSTOP on all but the last one.

Anyway, the bad news is I mis-remembered how the iicbb interface and
driver are structured.  The hook point I wanted isn't there, making it
hard to put the fix I was picturing in the intel_iic code.  I'd still
like to think of a better fix, but it's going to take more than a few
minutes.  So I guess we'd better go with your fix to get things working
right away.  If I can think up something more elegant we can always
switch to it later.

-- Ian


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


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Niclas Zeising

On 2019-06-03 17:19, Andriy Gapon wrote:

On 03/06/2019 17:52, Ian Lepore wrote:

Please don't.  We still have a situation where nobody has shown a
runtime failure at all.  This build failure could be fixed by simply
defining a do-nothing iicbus_set_nostop() function if a quick fix is
needed.


Well, I am quite certain that the run-time failure will follow after the build
time failure is fixed.


Putting this nostop concept into code that is shared by many drivers is
an abomination.  We have exactly one driver that needs this
functionality, so the right fix is to implement it wholly within that
one driver.  I'll put together a diff for that.


That's true that we have just one such driver.
At the same time, the "no stop" (or rather, repeated start) behavior makes more
sense.  If stop+start between transfers are needed then that can be done with
multiple calls to iicbus_transfer.  If multiple messages are given to
iicbus_transfer, then it's reasonable to assume that a repeated started is
wanted between them.  But it would be a big change to review and, if needed, fix
or tidy up all code that uses iicbus_transfer.  So, iicbus_set_nostop() could be
just a small step towards the bigger goal.

But I really don't have a strong opinion.
Fixing drm2 directly is just as good for me as iicbus_set_nostop.



Hi!
From my perspective, either solution is fine, as long as the drm-legacy 
drivers keep on working, and I get some help fixing the issue.


Is there any way we can revert this change while we're discussing the 
best solution to this?

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


svn commit: r348544 - head/sys/dev/hwpmc

2019-06-03 Thread Konstantin Belousov
Author: kib
Date: Mon Jun  3 16:21:09 2019
New Revision: 348544
URL: https://svnweb.freebsd.org/changeset/base/348544

Log:
  hwpmc_intel: List all Silvermont ids.
  
  PR:   238310
  Based on submission by:   Masse Nicolas 
  MFC after:1 week

Modified:
  head/sys/dev/hwpmc/hwpmc_intel.c

Modified: head/sys/dev/hwpmc/hwpmc_intel.c
==
--- head/sys/dev/hwpmc/hwpmc_intel.cMon Jun  3 15:43:40 2019
(r348543)
+++ head/sys/dev/hwpmc/hwpmc_intel.cMon Jun  3 16:21:09 2019
(r348544)
@@ -195,7 +195,11 @@ pmc_intel_initialize(void)
cputype = PMC_CPU_INTEL_HASWELL;
nclasses = 5;
break;
+   case 0x37:
+   case 0x4A:
case 0x4D:  /* Per Intel document 330061-001 01/2014. */
+   case 0x5A:
+   case 0x5D:
cputype = PMC_CPU_INTEL_ATOM_SILVERMONT;
nclasses = 3;
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Maxim Sobolev
On Mon, Jun 3, 2019 at 7:28 AM Enji Cooper  wrote:

> Hi Maxim,
>
>
> > Modified: head/Makefile.inc1
> >
> ==
> > --- head/Makefile.inc1Sun Jun  2 22:27:26 2019(r348520)
> > +++ head/Makefile.inc1Sun Jun  2 23:38:19 2019(r348521)
> > @@ -887,8 +887,8 @@ MTREEFLAGS+=-W
> > INSTALLFLAGS+=-h sha256
> > .endif
> > .if defined(DB_FROM_SRC) || defined(NO_ROOT)
> > -IMAKE_INSTALL=INSTALL="install ${INSTALLFLAGS}"
> > -IMAKE_MTREE=MTREE_CMD="mtree ${MTREEFLAGS}"
> > +IMAKE_INSTALL=INSTALL="${INSTALL} ${INSTALLFLAGS}"
> > +IMAKE_MTREE=MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}"
> > .endif
>
> Please back out this part of the change as it is unnecessary and adds
> a dependency on sys.mk’s definitions. $PATH should contain, i.e., be
> populated, with these tools when running make installworld. This is part of
> the logic behind how $ITOOLS, etc, works.
> Thank you very much for your work and the rest of the change though!
>

 Thanks Enji, for a clarification, will do. I still cannot understand why
can't we have those tools being re-defined with top-level make environment?

What I am striving at is being able to do say, make INSTALL="abcd"
installworld. Yes, I understand I can call "abcd" "install" (or make a
symlink to it) and put it into PATH, but there are at least one issue here,
namely what if I need to pass some distinct argument to abcd based on usage
scenario. E.g. make INSTALL="abcd foo" distributiuon. In your case I should
be resorting to setting up some global environment variable and hope it
won't get erased somewhere in the call chain, but that's bit "how you
doing" IMHO. My approach makes certain things so much easier by cutting
those un-neded steps.

At any rate thank for a feedback and some background info, I will do more
work on this. I was thinking more in terms of having some sort of
bsd.bootools.mk where this can be defined in a centralized manner.

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


svn commit: r348543 - head/sys/kern

2019-06-03 Thread John Baldwin
Author: jhb
Date: Mon Jun  3 15:43:40 2019
New Revision: 348543
URL: https://svnweb.freebsd.org/changeset/base/348543

Log:
  Warn about deprecated features on all major OS versions.
  
  Reviewed by:  imp
  MFC after:3 days
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D20490

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cMon Jun  3 15:41:54 2019(r348542)
+++ head/sys/kern/subr_bus.cMon Jun  3 15:43:40 2019(r348543)
@@ -5948,7 +5948,7 @@ _gone_in(int major, const char *msg)
gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg);
if (P_OSREL_MAJOR(__FreeBSD_version) >= major)
printf("Obsolete code will removed soon: %s\n", msg);
-   else if (P_OSREL_MAJOR(__FreeBSD_version) + 1 == major)
+   else
printf("Deprecated code (to be removed in FreeBSD %d): %s\n",
major, msg);
 }
@@ -5961,7 +5961,7 @@ _gone_in_dev(device_t dev, int major, const char *msg)
if (P_OSREL_MAJOR(__FreeBSD_version) >= major)
device_printf(dev,
"Obsolete code will removed soon: %s\n", msg);
-   else if (P_OSREL_MAJOR(__FreeBSD_version) + 1 == major)
+   else
device_printf(dev,
"Deprecated code (to be removed in FreeBSD %d): %s\n",
major, msg);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348542 - head/share/man/man4

2019-06-03 Thread John Baldwin
Author: jhb
Date: Mon Jun  3 15:41:54 2019
New Revision: 348542
URL: https://svnweb.freebsd.org/changeset/base/348542

Log:
  Add 'device cxgbe' explicitly in the synopsis.
  
  ccr depends on symbols exported by the cxgbe driver as well as having
  a runtime dependency.  While the runtime depenency was noted in the
  manpage already, the compile-time dependency wasn't as clear.
  
  PR:   238265
  MFC after:3 days
  Sponsored by: Chelsio Communications

Modified:
  head/share/man/man4/ccr.4

Modified: head/share/man/man4/ccr.4
==
--- head/share/man/man4/ccr.4   Mon Jun  3 15:41:45 2019(r348541)
+++ head/share/man/man4/ccr.4   Mon Jun  3 15:41:54 2019(r348542)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2019
+.Dd June 3, 2019
 .Dt CCR 4
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@ place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device ccr"
+.Cd "device cxgbe"
 .Ed
 .Pp
 To load the driver as a
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348541 - head/sys/dev/efidev

2019-06-03 Thread Konstantin Belousov
Author: kib
Date: Mon Jun  3 15:41:45 2019
New Revision: 348541
URL: https://svnweb.freebsd.org/changeset/base/348541

Log:
  efirt efi_enter(): Release acquired locks and restore FPU ownership if
  efi_arch_enter() returned an error.
  
  Submitted:Jan Martin Mikkelsen 
  MFC after:1 week

Modified:
  head/sys/dev/efidev/efirt.c

Modified: head/sys/dev/efidev/efirt.c
==
--- head/sys/dev/efidev/efirt.c Mon Jun  3 15:34:00 2019(r348540)
+++ head/sys/dev/efidev/efirt.c Mon Jun  3 15:41:45 2019(r348541)
@@ -275,6 +275,7 @@ efi_enter(void)
 {
struct thread *td;
pmap_t curpmap;
+   int error;
 
if (efi_runtime == NULL)
return (ENXIO);
@@ -283,7 +284,13 @@ efi_enter(void)
PMAP_LOCK(curpmap);
mtx_lock(&efi_lock);
fpu_kern_enter(td, NULL, FPU_KERN_NOCTX);
-   return (efi_arch_enter());
+   error = efi_arch_enter();
+   if (error != 0) {
+   fpu_kern_leave(td, NULL);
+   mtx_unlock(&efi_lock);
+   PMAP_UNLOCK(curpmap);
+   }
+   return (error);
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348540 - head

2019-06-03 Thread Maxim Sobolev
Author: sobomax
Date: Mon Jun  3 15:34:00 2019
New Revision: 348540
URL: https://svnweb.freebsd.org/changeset/base/348540

Log:
  Rollback the rest of the botched r348521. Re-work would be posted to
  reviews. Sorry.
  
  Reported by:  Enji Cooper

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Jun  3 15:32:42 2019(r348539)
+++ head/Makefile.inc1  Mon Jun  3 15:34:00 2019(r348540)
@@ -887,7 +887,7 @@ MTREEFLAGS+=-W
 INSTALLFLAGS+= -h sha256
 .endif
 .if defined(DB_FROM_SRC) || defined(NO_ROOT)
-IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}"
+IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
 IMAKE_MTREE=   MTREE_CMD="mtree ${MTREEFLAGS}"
 .endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348539 - in head/sys/amd64: amd64 include

2019-06-03 Thread Konstantin Belousov
Author: kib
Date: Mon Jun  3 15:32:42 2019
New Revision: 348539
URL: https://svnweb.freebsd.org/changeset/base/348539

Log:
  amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service.
  
  If service code faulted, we might end up unwinding with interrupts
  disabled.  Top-level kernel code should have interrupts enabled, which
  is enforced by checks.
  
  Save %rflags before entering EFI, and restore to the known good value
  on return.  This handles situation with disabled interrupts on fault
  and perhaps other potential bugs, e.g. invalid value for PSL_D.
  
  Reported and tested by:   Jan Martin Mikkelsen 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/efirt_support.S
  head/sys/amd64/amd64/genassym.c
  head/sys/amd64/include/efi.h

Modified: head/sys/amd64/amd64/efirt_support.S
==
--- head/sys/amd64/amd64/efirt_support.SMon Jun  3 15:28:37 2019
(r348538)
+++ head/sys/amd64/amd64/efirt_support.SMon Jun  3 15:32:42 2019
(r348539)
@@ -47,6 +47,9 @@ ENTRY(efi_rt_arch_call)
movq%r13, EC_R13(%rdi)
movq%r14, EC_R14(%rdi)
movq%r15, EC_R15(%rdi)
+   pushfq
+   popq%rax
+   movq%rax, EC_RFLAGS(%rdi)
movqPCPU(CURTHREAD), %rax
movq%rdi, TD_MD+MD_EFIRT_TMP(%rax)
movqPCPU(CURPCB), %rsi
@@ -98,6 +101,8 @@ efi_rt_arch_call_tail:
movqEC_RBP(%rdi), %rbp
movqEC_RSP(%rdi), %rsp
movqEC_RBX(%rdi), %rbx
+   pushq   EC_RFLAGS(%rdi)
+   popfq
 
popq%rbp
ret

Modified: head/sys/amd64/amd64/genassym.c
==
--- head/sys/amd64/amd64/genassym.c Mon Jun  3 15:28:37 2019
(r348538)
+++ head/sys/amd64/amd64/genassym.c Mon Jun  3 15:32:42 2019
(r348539)
@@ -272,3 +272,4 @@ ASSYM(EC_R12, offsetof(struct efirt_callinfo, ec_r12))
 ASSYM(EC_R13, offsetof(struct efirt_callinfo, ec_r13));
 ASSYM(EC_R14, offsetof(struct efirt_callinfo, ec_r14));
 ASSYM(EC_R15, offsetof(struct efirt_callinfo, ec_r15));
+ASSYM(EC_RFLAGS, offsetof(struct efirt_callinfo, ec_rflags));

Modified: head/sys/amd64/include/efi.h
==
--- head/sys/amd64/include/efi.hMon Jun  3 15:28:37 2019
(r348538)
+++ head/sys/amd64/include/efi.hMon Jun  3 15:32:42 2019
(r348539)
@@ -72,6 +72,7 @@ struct efirt_callinfo {
register_t  ec_r13;
register_t  ec_r14;
register_t  ec_r15;
+   register_t  ec_rflags;
 };
 
 #endif /* __AMD64_INCLUDE_EFI_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348536 - head/sys/kern

2019-06-03 Thread Konstantin Belousov
Author: kib
Date: Mon Jun  3 15:23:37 2019
New Revision: 348536
URL: https://svnweb.freebsd.org/changeset/base/348536

Log:
  Remove dead check.
  
  We already handled the case when symstrindex < 0 at line 680.
  
  Reported by:  danfe using PVS-studio
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/link_elf_obj.c

Modified: head/sys/kern/link_elf_obj.c
==
--- head/sys/kern/link_elf_obj.cMon Jun  3 15:23:21 2019
(r348535)
+++ head/sys/kern/link_elf_obj.cMon Jun  3 15:23:37 2019
(r348536)
@@ -714,11 +714,6 @@ link_elf_load_file(linker_class_t cls, const char *fil
goto out;
}
 
-   if (symstrindex == -1) {
-   link_elf_error(filename, "lost symbol string index");
-   error = ENOEXEC;
-   goto out;
-   }
/* Allocate space for and load the symbol strings */
ef->ddbstrcnt = shdr[symstrindex].sh_size;
ef->ddbstrtab = malloc(shdr[symstrindex].sh_size, M_LINKER, M_WAITOK);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Andriy Gapon
On 03/06/2019 17:52, Ian Lepore wrote:
> Please don't.  We still have a situation where nobody has shown a
> runtime failure at all.  This build failure could be fixed by simply
> defining a do-nothing iicbus_set_nostop() function if a quick fix is
> needed.

Well, I am quite certain that the run-time failure will follow after the build
time failure is fixed.

> Putting this nostop concept into code that is shared by many drivers is
> an abomination.  We have exactly one driver that needs this
> functionality, so the right fix is to implement it wholly within that
> one driver.  I'll put together a diff for that.

That's true that we have just one such driver.
At the same time, the "no stop" (or rather, repeated start) behavior makes more
sense.  If stop+start between transfers are needed then that can be done with
multiple calls to iicbus_transfer.  If multiple messages are given to
iicbus_transfer, then it's reasonable to assume that a repeated started is
wanted between them.  But it would be a big change to review and, if needed, fix
or tidy up all code that uses iicbus_transfer.  So, iicbus_set_nostop() could be
just a small step towards the bigger goal.

But I really don't have a strong opinion.
Fixing drm2 directly is just as good for me as iicbus_set_nostop.

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


svn commit: r348533 - head/sys/vm

2019-06-03 Thread Konstantin Belousov
Author: kib
Date: Mon Jun  3 15:19:11 2019
New Revision: 348533
URL: https://svnweb.freebsd.org/changeset/base/348533

Log:
  Remove dead store.
  
  sw_flags is set to the function argument several lines later.
  
  Reported by:  danfe using PVS-studio
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cMon Jun  3 15:12:44 2019(r348532)
+++ head/sys/vm/swap_pager.cMon Jun  3 15:19:11 2019(r348533)
@@ -2230,7 +2230,6 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl
sp->sw_vp = vp;
sp->sw_id = id;
sp->sw_dev = dev;
-   sp->sw_flags = 0;
sp->sw_nblks = nblks;
sp->sw_used = 0;
sp->sw_strategy = strategy;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348532 - in head: . etc

2019-06-03 Thread Maxim Sobolev
Author: sobomax
Date: Mon Jun  3 15:12:44 2019
New Revision: 348532
URL: https://svnweb.freebsd.org/changeset/base/348532

Log:
  Leave mtree hardcoded for now. Reverting partially 348521 and also
  the followup stopgap change, because I don't think it's a correct. I still
  need to figure out where to stick it in. In cannot be in Makefile.inc1
  and it cannot be in etc/Makefile from the looks of it to avoid
  chicken-and-egg problem.

Modified:
  head/Makefile.inc1
  head/etc/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Jun  3 15:10:37 2019(r348531)
+++ head/Makefile.inc1  Mon Jun  3 15:12:44 2019(r348532)
@@ -888,7 +888,7 @@ INSTALLFLAGS+=  -h sha256
 .endif
 .if defined(DB_FROM_SRC) || defined(NO_ROOT)
 IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}"
-IMAKE_MTREE=   MTREE_CMD="${MTREE} ${MTREEFLAGS}"
+IMAKE_MTREE=   MTREE_CMD="mtree ${MTREEFLAGS}"
 .endif
 
 DESTDIR_MTREEFLAGS=-deU

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Mon Jun  3 15:10:37 2019(r348531)
+++ head/etc/Makefile   Mon Jun  3 15:12:44 2019(r348532)
@@ -93,8 +93,6 @@ distribution:
 .endif
 .endif
 
-MTREE_CMD?=mtree
-
 MTREES=mtree/BSD.root.dist /   \
mtree/BSD.var.dist  /var\
mtree/BSD.usr.dist  /usr\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Andriy Gapon
On 03/06/2019 17:17, Niclas Zeising wrote:
> On 2019-06-03 14:08, Andriy Gapon wrote:
>> Hi!  Thank you for the report.
>> I am going to restore iicbus_set_nostop, but this time as a function that
>> modifies iicbus softc (instead of an ivar accessor for the bus).
>> I am including a patch that I would like to commit.
>>
>> However, for the drm code to request the nostop mode correctly it needs to be
>> fixed as well.
>> My proposed patch is here: 
>> https://github.com/FreeBSDDesktop/drm-legacy/pull/9
>>
> 
> 
> Thank you, I will try it out.
> Will this break drm-legacy-kmod on 12, which doesn't have the iic bus change 
> you
> proposed?

No, it should not change anything for 12 / 11.
But see Ian's reaction.

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


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Ian Lepore
On Mon, 2019-06-03 at 15:08 +0300, Andriy Gapon wrote:
> On 03/06/2019 14:16, Niclas Zeising wrote:
> > Hi!
> > It seems like things broke after all, latest pkg build (on head-
> > amd64) reports
> > this:
> > 
> > 
> > /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-
> > 12bd551/src/dev/drm2/i915/intel_iic.c:570:2:
> > error: implicit declaration of function 'iicbus_set_nostop' is
> > invalid in C99
> > [-Werror,-Wimplicit-function-declaration]
> > iicbus_set_nostop(idev, true);
> > ^
> > /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-
> > 12bd551/src/dev/drm2/i915/intel_iic.c:570:2:
> > error: this function declaration is not a prototype [-Werror,-
> > Wstrict-prototypes]
> > 2 errors generated.
> > 
> > Full log:
> > 
> > 
http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log
> 
> Hi!  Thank you for the report.
> I am going to restore iicbus_set_nostop, but this time as a function
> that
> modifies iicbus softc (instead of an ivar accessor for the bus).
> I am including a patch that I would like to commit.
> 
> However, for the drm code to request the nostop mode correctly it
> needs to be
> fixed as well.
> My proposed patch is here: 
> https://github.com/FreeBSDDesktop/drm-legacy/pull/9
> 
> Index: sys/dev/iicbus/iicbus.h
> ===
> --- sys/dev/iicbus/iicbus.h   (revision 348529)
> +++ sys/dev/iicbus/iicbus.h   (working copy)
> @@ -46,6 +46,8 @@ struct iicbus_softc
>* 0 if no start condition succeeded */
>   u_char strict;  /* deny operations that violate the
>* I2C protocol */
> + bool nostop;/* iicbus_transfer defaults to
> repeated
> +  * start between messages */
>   struct mtx lock;
>   u_int bus_freq; /* Configured bus Hz. */
>  };
> @@ -77,6 +79,7 @@ IICBUS_ACCESSOR(addr,   ADDR,   
> uint32_t)
> 
>  int  iicbus_generic_intr(device_t dev, int event, char *buf);
>  void iicbus_init_frequency(device_t dev, u_int bus_freq);
> +void iicbus_set_nostop(device_t dev, bool val);
> 
>  extern driver_t iicbus_driver;
>  extern devclass_t iicbus_devclass;
> Index: sys/dev/iicbus/iiconf.c
> ===
> --- sys/dev/iicbus/iiconf.c   (revision 348529)
> +++ sys/dev/iicbus/iiconf.c   (working copy)
> @@ -383,6 +383,14 @@ iicbus_block_read(device_t bus, u_char slave,
> char
>   return (error);
>  }
> 
> +void
> +iicbus_set_nostop(device_t bus, bool val)
> +{
> + struct iicbus_softc *sc = device_get_softc(bus);
> +
> + sc->nostop = val;
> +}
> +
>  /*
>   * iicbus_transfer()
>   *
> @@ -427,7 +435,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg
> *
>  {
>   int i, error, lenread, lenwrote, nkid, rpstart, addr;
>   device_t *children, bus;
> - bool started;
> + struct iicbus_softc *sc;
> + bool nostop, started;
> 
>   if ((error = device_get_children(dev, &children, &nkid)) != 0)
>   return (IIC_ERESOURCE);
> @@ -438,6 +447,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg
> *
>   bus = children[0];
>   rpstart = 0;
>   free(children, M_TEMP);
> + sc = device_get_softc(bus);
> + nostop = sc->nostop;
>   started = false;
>   for (i = 0, error = 0; i < nmsgs && error == 0; i++) {
>   addr = msgs[i].slave;
> @@ -465,11 +476,12 @@ iicbus_transfer_gen(device_t dev, struct
> iic_msg *
>   if (error != 0)
>   break;
> 
> - if (!(msgs[i].flags & IIC_M_NOSTOP)) {
> + if ((msgs[i].flags & IIC_M_NOSTOP) != 0 ||
> + (nostop && i + 1 < nmsgs)) {
> + rpstart = 1;/* Next message gets repeated
> start */
> + } else {
>   rpstart = 0;
>   iicbus_stop(bus);
> - } else {
> - rpstart = 1;/* Next message gets repeated
> start */
>   }
>   }
>   if (error != 0 && started)
> 
> 

Please don't.  We still have a situation where nobody has shown a
runtime failure at all.  This build failure could be fixed by simply
defining a do-nothing iicbus_set_nostop() function if a quick fix is
needed.

Putting this nostop concept into code that is shared by many drivers is
an abomination.  We have exactly one driver that needs this
functionality, so the right fix is to implement it wholly within that
one driver.  I'll put together a diff for that.

-- Ian


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


Re: svn commit: r248514 - head/sys/vm

2019-06-03 Thread Alexey Dokuchaev
On Tue, Mar 19, 2013 at 02:39:27PM +, Konstantin Belousov wrote:
> New Revision: 248514
> URL: http://svnweb.freebsd.org/changeset/base/248514
> 
> Log:
>   Do not map the swap i/o pbufs if the geom provider for the swap
>   partition accepts unmapped requests.
>   
> Modified: head/sys/vm/swap_pager.c
> ...
> @@ -2180,6 +2190,7 @@ swaponsomething(struct vnode *vp, void *
>   sp->sw_flags = 0;
>   sp->sw_nblks = nblks;
>   sp->sw_used = 0;
>   sp->sw_strategy = strategy;
>   sp->sw_close = close;
> + sp->sw_flags = flags;

PVS Studio complains here: /usr/src/sys/vm/swap_pager.c:2238:1: warning:
V519 The 'sp->sw_flags' variable is assigned values twice successively.
Perhaps this is a mistake. Check lines: 2233, 2238.

Looks like "sp->sw_flags = 0" should've been removed, can you confirm?

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


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Enji Cooper
Hi Maxim,

> On Jun 2, 2019, at 16:38, Maxim Sobolev  wrote:
> 
> Author: sobomax
> Date: Sun Jun  2 23:38:19 2019
> New Revision: 348521
> URL: https://svnweb.freebsd.org/changeset/base/348521
> 
> Log:
>  Fix several places where tool name has been hardcoded:
> 
>  install -> ${INSTALL}
>  mtree -> ${MTREE_CMD}
>  services_mkdb -> ${SERVICES_MKDB_CMD}
>  cap_mkdb -> ${CAP_MKDB_CMD}
>  pwd_mkdb -> ${PWD_MKDB_CMD}
>  kldxref -> ${KLDXREF_CMD}
> 
>  If you do custom FreeBSD builds you may want to override those
>  in some cases.
> 
>  Sponsored by:Sippy Software, Inc.

Please get review from Bryan, Simon, or Warner next time, per MAINTAINERS, 
to avoid breakage in the future. There are some sand traps in our build 
infrastructure.

...

> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Sun Jun  2 22:27:26 2019(r348520)
> +++ head/Makefile.inc1Sun Jun  2 23:38:19 2019(r348521)
> @@ -887,8 +887,8 @@ MTREEFLAGS+=-W
> INSTALLFLAGS+=-h sha256
> .endif
> .if defined(DB_FROM_SRC) || defined(NO_ROOT)
> -IMAKE_INSTALL=INSTALL="install ${INSTALLFLAGS}"
> -IMAKE_MTREE=MTREE_CMD="mtree ${MTREEFLAGS}"
> +IMAKE_INSTALL=INSTALL="${INSTALL} ${INSTALLFLAGS}"
> +IMAKE_MTREE=MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}"
> .endif

Please back out this part of the change as it is unnecessary and adds a 
dependency on sys.mk’s definitions. $PATH should contain, i.e., be populated, 
with these tools when running make installworld. This is part of the logic 
behind how $ITOOLS, etc, works.
Thank you very much for your work and the rest of the change though!
-Enji
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r296467 - head/sys/kern

2019-06-03 Thread Alexey Dokuchaev
On Mon, Mar 07, 2016 at 06:44:07PM +, Konstantin Belousov wrote:
> New Revision: 296467
> URL: https://svnweb.freebsd.org/changeset/base/296467
> 
> Log:
>   Convert all panics from the link_elf_obj kernel linker for object
>   files format into printfs and errors to caller.  Some leaks of
>   resources are there, but the same leaks are present in other error
>   pathes.  With the change, the kernel at least boots even when module
>   with unexpected or corrupted ELF structure is preloaded.
>   
> Modified: head/sys/kern/link_elf_obj.c
> ...
> @@ -634,8 +645,11 @@ link_elf_load_file(linker_class_t cls, c
>   ef->relatab = malloc(ef->nrelatab * sizeof(*ef->relatab),
>   M_LINKER, M_WAITOK | M_ZERO);
>  
> - if (symtabindex == -1)
> - panic("lost symbol table index");
> + if (symtabindex == -1) {
> + link_elf_error(filename, "lost symbol table index");
> + error = ENOEXEC;
> + goto out;
> + }
>   /* Allocate space for and load the symbol table */
>   ef->ddbsymcnt = shdr[symtabindex].sh_size / sizeof(Elf_Sym);
>   ef->ddbsymtab = malloc(shdr[symtabindex].sh_size, M_LINKER, M_WAITOK);
> @@ -650,8 +664,11 @@ link_elf_load_file(linker_class_t cls, c
>   goto out;
>   }
>  
> - if (symstrindex == -1)
> - panic("lost symbol string index");
> + if (symstrindex == -1) {
> + link_elf_error(filename, "lost symbol string index");
> + error = ENOEXEC;
> + goto out;
> + }

PVS Studio reports: /usr/src/sys/kern/link_elf_obj.c:717:1: warning: V547
Expression 'symstrindex == - 1' is always false.

Original panic()s were added by peter@ in r129362 (CC'ed).  Could one of
you guys take a look?  Thanks,

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


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Niclas Zeising

On 2019-06-03 14:08, Andriy Gapon wrote:

On 03/06/2019 14:16, Niclas Zeising wrote:

Hi!
It seems like things broke after all, latest pkg build (on head-amd64) reports
this:


/wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2:
error: implicit declaration of function 'iicbus_set_nostop' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
     iicbus_set_nostop(idev, true);
     ^
/wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2:
error: this function declaration is not a prototype 
[-Werror,-Wstrict-prototypes]
2 errors generated.

Full log:

http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log


Hi!  Thank you for the report.
I am going to restore iicbus_set_nostop, but this time as a function that
modifies iicbus softc (instead of an ivar accessor for the bus).
I am including a patch that I would like to commit.

However, for the drm code to request the nostop mode correctly it needs to be
fixed as well.
My proposed patch is here: https://github.com/FreeBSDDesktop/drm-legacy/pull/9




Thank you, I will try it out.
Will this break drm-legacy-kmod on 12, which doesn't have the iic bus 
change you proposed?

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


svn commit: r348530 - head

2019-06-03 Thread Warner Losh
Author: imp
Date: Mon Jun  3 14:14:53 2019
New Revision: 348530
URL: https://svnweb.freebsd.org/changeset/base/348530

Log:
  Stopgap fix to breakage from r348521.
  
  MTREE is defined, while MTREE_CMD isn't, use it instead.
  This may not be 'right' but it fixes the CI and other issues.
  
  Submitted by: Andreas Nilsson

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Jun  3 10:04:34 2019(r348529)
+++ head/Makefile.inc1  Mon Jun  3 14:14:53 2019(r348530)
@@ -888,7 +888,7 @@ INSTALLFLAGS+=  -h sha256
 .endif
 .if defined(DB_FROM_SRC) || defined(NO_ROOT)
 IMAKE_INSTALL= INSTALL="${INSTALL} ${INSTALLFLAGS}"
-IMAKE_MTREE=   MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}"
+IMAKE_MTREE=   MTREE_CMD="${MTREE} ${MTREEFLAGS}"
 .endif
 
 DESTDIR_MTREEFLAGS=-deU
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Maxim Sobolev
Looking into it, sorry for breakage. Somehow it worked here. :( I'll
backout if I cannot figure it out in a 30 minutes or so.

Sorry about that.

-Max

On Mon, Jun 3, 2019 at 7:10 AM Warner Losh  wrote:

>
>
> On Mon, Jun 3, 2019 at 7:54 AM Rodney W. Grimes 
> wrote:
>
>> > In message <7bd6b7ad-5950-4015-b95d-9ffb609f5...@fubar.geek.nz>,
>> Andrew Turner
>> > writes:
>> > >
>> > >
>> > > > On 3 Jun 2019, at 00:38, Maxim Sobolev  wrote:
>> > > >
>> > > > Author: sobomax
>> > > > Date: Sun Jun  2 23:38:19 2019
>> > > > New Revision: 348521
>> > > > URL: https://svnweb.freebsd.org/changeset/base/348521
>> > > >
>> > > > Log:
>> > > >  Fix several places where tool name has been hardcoded:
>> > > >
>> > > >  install -> ${INSTALL}
>> > > >  mtree -> ${MTREE_CMD}
>> > > >  services_mkdb -> ${SERVICES_MKDB_CMD}
>> > > >  cap_mkdb -> ${CAP_MKDB_CMD}
>> > > >  pwd_mkdb -> ${PWD_MKDB_CMD}
>> > > >  kldxref -> ${KLDXREF_CMD}
>> > > >
>> > > >  If you do custom FreeBSD builds you may want to override those
>> > > >  in some cases.
>> > > >
>> > > >  Sponsored by:Sippy Software, Inc.
>> > >
>> > > This breaks installworld in a local Jenkins instance. I???m building
>> with -DD
>> > > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset.
>> > >
>> > > Andrew
>> > >
>> > > --
>> > > >>> Making hierarchy
>> > > --
>> > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f
>> Makefile.inc1
>> > >  LOCAL_MTREE= hierarchy
>> > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc;
>> PATH=/jenkins/work
>> ...
>> >
>> > It also breaks poudirere builds at make distrib-dirs, amd64 and i386,
>> i386
>> > distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs
>> target
>> > is the failing one.
>>
>> Something is pretty broke here then, as INSTALL has been defined for
>> ever in sys.mk:
>> sys.mk:INSTALL  ?=  install
>>
>
> The problem is that MTREE isn't defined, which makes MTREE_CMD start with
> -N.
>
> Warner
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Warner Losh
On Mon, Jun 3, 2019 at 7:54 AM Rodney W. Grimes 
wrote:

> > In message <7bd6b7ad-5950-4015-b95d-9ffb609f5...@fubar.geek.nz>, Andrew
> Turner
> > writes:
> > >
> > >
> > > > On 3 Jun 2019, at 00:38, Maxim Sobolev  wrote:
> > > >
> > > > Author: sobomax
> > > > Date: Sun Jun  2 23:38:19 2019
> > > > New Revision: 348521
> > > > URL: https://svnweb.freebsd.org/changeset/base/348521
> > > >
> > > > Log:
> > > >  Fix several places where tool name has been hardcoded:
> > > >
> > > >  install -> ${INSTALL}
> > > >  mtree -> ${MTREE_CMD}
> > > >  services_mkdb -> ${SERVICES_MKDB_CMD}
> > > >  cap_mkdb -> ${CAP_MKDB_CMD}
> > > >  pwd_mkdb -> ${PWD_MKDB_CMD}
> > > >  kldxref -> ${KLDXREF_CMD}
> > > >
> > > >  If you do custom FreeBSD builds you may want to override those
> > > >  in some cases.
> > > >
> > > >  Sponsored by:Sippy Software, Inc.
> > >
> > > This breaks installworld in a local Jenkins instance. I???m building
> with -DD
> > > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset.
> > >
> > > Andrew
> > >
> > > --
> > > >>> Making hierarchy
> > > --
> > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f
> Makefile.inc1
> > >  LOCAL_MTREE= hierarchy
> > > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc;
> PATH=/jenkins/work
> ...
> >
> > It also breaks poudirere builds at make distrib-dirs, amd64 and i386,
> i386
> > distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs
> target
> > is the failing one.
>
> Something is pretty broke here then, as INSTALL has been defined for
> ever in sys.mk:
> sys.mk:INSTALL  ?=  install
>

The problem is that MTREE isn't defined, which makes MTREE_CMD start with
-N.

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


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Rodney W. Grimes
> In message <7bd6b7ad-5950-4015-b95d-9ffb609f5...@fubar.geek.nz>, Andrew 
> Turner 
> writes:
> > 
> >
> > > On 3 Jun 2019, at 00:38, Maxim Sobolev  wrote:
> > > 
> > > Author: sobomax
> > > Date: Sun Jun  2 23:38:19 2019
> > > New Revision: 348521
> > > URL: https://svnweb.freebsd.org/changeset/base/348521
> > > 
> > > Log:
> > >  Fix several places where tool name has been hardcoded:
> > > 
> > >  install -> ${INSTALL}
> > >  mtree -> ${MTREE_CMD}
> > >  services_mkdb -> ${SERVICES_MKDB_CMD}
> > >  cap_mkdb -> ${CAP_MKDB_CMD}
> > >  pwd_mkdb -> ${PWD_MKDB_CMD}
> > >  kldxref -> ${KLDXREF_CMD}
> > > 
> > >  If you do custom FreeBSD builds you may want to override those
> > >  in some cases.
> > > 
> > >  Sponsored by:Sippy Software, Inc.
> >
> > This breaks installworld in a local Jenkins instance. I???m building with 
> > -DD
> > B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset.
> >
> > Andrew
> >
> > --
> > >>> Making hierarchy
> > --
> > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f 
> > Makefile.inc1 
> >  LOCAL_MTREE= hierarchy
> > cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; 
> > PATH=/jenkins/work
...
> 
> It also breaks poudirere builds at make distrib-dirs, amd64 and i386, i386
> distrib-dirs on amd64 sample below. The src/etc/Makefile distrib-dirs target
> is the failing one.

Something is pretty broke here then, as INSTALL has been defined for
ever in sys.mk:
sys.mk:INSTALL  ?=  install

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


Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Andriy Gapon
On 03/06/2019 14:16, Niclas Zeising wrote:
> Hi!
> It seems like things broke after all, latest pkg build (on head-amd64) reports
> this:
> 
> 
> /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2:
> error: implicit declaration of function 'iicbus_set_nostop' is invalid in C99
> [-Werror,-Wimplicit-function-declaration]
>     iicbus_set_nostop(idev, true);
>     ^
> /wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2:
> error: this function declaration is not a prototype 
> [-Werror,-Wstrict-prototypes]
> 2 errors generated.
> 
> Full log:
> 
> http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log

Hi!  Thank you for the report.
I am going to restore iicbus_set_nostop, but this time as a function that
modifies iicbus softc (instead of an ivar accessor for the bus).
I am including a patch that I would like to commit.

However, for the drm code to request the nostop mode correctly it needs to be
fixed as well.
My proposed patch is here: https://github.com/FreeBSDDesktop/drm-legacy/pull/9

Index: sys/dev/iicbus/iicbus.h
===
--- sys/dev/iicbus/iicbus.h (revision 348529)
+++ sys/dev/iicbus/iicbus.h (working copy)
@@ -46,6 +46,8 @@ struct iicbus_softc
 * 0 if no start condition succeeded */
u_char strict;  /* deny operations that violate the
 * I2C protocol */
+   bool nostop;/* iicbus_transfer defaults to repeated
+* start between messages */
struct mtx lock;
u_int bus_freq; /* Configured bus Hz. */
 };
@@ -77,6 +79,7 @@ IICBUS_ACCESSOR(addr, ADDR,   uint32_t)

 int  iicbus_generic_intr(device_t dev, int event, char *buf);
 void iicbus_init_frequency(device_t dev, u_int bus_freq);
+void iicbus_set_nostop(device_t dev, bool val);

 extern driver_t iicbus_driver;
 extern devclass_t iicbus_devclass;
Index: sys/dev/iicbus/iiconf.c
===
--- sys/dev/iicbus/iiconf.c (revision 348529)
+++ sys/dev/iicbus/iiconf.c (working copy)
@@ -383,6 +383,14 @@ iicbus_block_read(device_t bus, u_char slave, char
return (error);
 }

+void
+iicbus_set_nostop(device_t bus, bool val)
+{
+   struct iicbus_softc *sc = device_get_softc(bus);
+
+   sc->nostop = val;
+}
+
 /*
  * iicbus_transfer()
  *
@@ -427,7 +435,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *
 {
int i, error, lenread, lenwrote, nkid, rpstart, addr;
device_t *children, bus;
-   bool started;
+   struct iicbus_softc *sc;
+   bool nostop, started;

if ((error = device_get_children(dev, &children, &nkid)) != 0)
return (IIC_ERESOURCE);
@@ -438,6 +447,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *
bus = children[0];
rpstart = 0;
free(children, M_TEMP);
+   sc = device_get_softc(bus);
+   nostop = sc->nostop;
started = false;
for (i = 0, error = 0; i < nmsgs && error == 0; i++) {
addr = msgs[i].slave;
@@ -465,11 +476,12 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *
if (error != 0)
break;

-   if (!(msgs[i].flags & IIC_M_NOSTOP)) {
+   if ((msgs[i].flags & IIC_M_NOSTOP) != 0 ||
+   (nostop && i + 1 < nmsgs)) {
+   rpstart = 1;/* Next message gets repeated start */
+   } else {
rpstart = 0;
iicbus_stop(bus);
-   } else {
-   rpstart = 1;/* Next message gets repeated start */
}
}
if (error != 0 && started)


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


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Cy Schubert
In message <7bd6b7ad-5950-4015-b95d-9ffb609f5...@fubar.geek.nz>, Andrew Turner 
writes:
> 
>
> > On 3 Jun 2019, at 00:38, Maxim Sobolev  wrote:
> > 
> > Author: sobomax
> > Date: Sun Jun  2 23:38:19 2019
> > New Revision: 348521
> > URL: https://svnweb.freebsd.org/changeset/base/348521
> > 
> > Log:
> >  Fix several places where tool name has been hardcoded:
> > 
> >  install -> ${INSTALL}
> >  mtree -> ${MTREE_CMD}
> >  services_mkdb -> ${SERVICES_MKDB_CMD}
> >  cap_mkdb -> ${CAP_MKDB_CMD}
> >  pwd_mkdb -> ${PWD_MKDB_CMD}
> >  kldxref -> ${KLDXREF_CMD}
> > 
> >  If you do custom FreeBSD builds you may want to override those
> >  in some cases.
> > 
> >  Sponsored by:  Sippy Software, Inc.
>
> This breaks installworld in a local Jenkins instance. I’m building with -DD
> B_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset.
>
> Andrew
>
> --
> >>> Making hierarchy
> --
> cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f Makefile.inc1 
>  LOCAL_MTREE= hierarchy
> cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; PATH=/jenkins/work
> space/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-hea
> d/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkin
> s/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkin
> s/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freeb
> sd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-he
> ad/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/le
> gacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/Free
> BSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/jenkins/workspace/
> FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm6
> 4.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/work
> space/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/work
> space/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-hea
> d/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj
> /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/u
> sr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-ar
> m64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/tmp/install.ZQ3PdXVZ mak
> e LOCAL_MTREE= PATH=/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspa
> ce/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/worksp
> ace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/
> arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/w
> orkspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/j
> enkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/
> freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm6
> 4-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tm
> p/legacy/bin::/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/Fre
> eBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/Fr
> eeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.
> aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspa
> ce/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins
> /workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebs
> d-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head
> /obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/lega
> cy/bin::/tmp/install.ZQ3PdXVZ METALOG=/jenkins/workspace/FreeBSD-arm64-head/o
> bj/root//METALOG -DNO_ROOT distrib-dirs
> for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit /usr/share
> /doc/usd/12.vi /usr/share/doc/usd/13.viref; do  if [ -f /jenkins/workspace/Fr
> eeBSD-arm64-head/obj/root/${file} ]; then  rm -f /jenkins/workspace/FreeBSD-a
> rm64-head/obj/root/${file};  fi;  done
> -N /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc -W -deU -i -f /jenk
> ins/workspace/FreeBSD-arm64-head/freebsd-head/etc/mtree/BSD.root.dist -p /jen
> kins/workspace/FreeBSD-arm64-head/obj/root/
> /tmp/install.ZQ3PdXVZ/sh: -N: not found
> *** Error code 127
>
> Stop.
> make[4]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc
> *** Error code 1
>
> Stop.
> make[3]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
> *** Error code 1
>
> Stop.
> make[2]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
> *** Error code 1
>
> Stop.
> make[1]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
> *** Error code 1
>
> Stop.
> make: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
>

It also breaks poudirere builds at make distrib-dir

Re: svn commit: r348355 - head/sys/dev/iicbus

2019-06-03 Thread Niclas Zeising

On 2019-05-29 22:52, Ian Lepore wrote:

On Wed, 2019-05-29 at 15:12 +0300, Andriy Gapon wrote:

On 29/05/2019 14:54, Niclas Zeising wrote:

On 2019-05-29 11:08, Andriy Gapon wrote:

Author: avg
Date: Wed May 29 09:08:20 2019
New Revision: 348355
URL: https://svnweb.freebsd.org/changeset/base/348355

Log:
revert r273728 and parts of r306589, iicbus no-stop by default feature
   Since drm2 removal, there has not been any consumer of the feature in the
tree.  I am also unaware of any out-of-tree consumer.
More importantly, the feature has been broken from the very start, both
before and after r306589, because the ivar was set on a device that does
not support it and it was read from another device that also does not
support it.
   A bus-wide no-stop flag cannot be implemented as an ivar as iicbus
attaches as a child of various drivers.  Implementing the ivar in each
and every I2C driver is just impractical.
   If we ever want to implement this feature properly, then probably the
easiest way to do it would be via a flag in the softc of iicbus.
In fact, we might have to do that in the stable branches if we want to
fix the code for them.
   Reported by:ian (long time ago)
MFC after:1 month (maybe)
X-MFC-note:cannot just merge the change, must keep drm2 happy



Hi!
Just a note, be aware that drm2 lives on in ports as drm-legacy-kmod.  I haven't
tested, but, from the description above I worry that it will affect the port.
What do you think?


Oh, I forgot about that one...
I think that it could be affected if it still uses FreeBSD iic code.
I guess I might have to revert the change.




I don't think so, because I don't think this change ever worked.  I'm
not sure how anybody convinced themselves that it did.  It attempts to
retrieve ivars from a device that doesn't have them, so the net effect
is that the nostop variable is initialized from stack garbage.  Maybe
whoever wrote and tested it was lucky enough to have that accidentally
be consistently zero or non-zero, so their testing appeared to work.

Looking at the drm2 code that is the only user of this, it appears that
the nostop value is only used in the case where the driver falls back
to using the builtin intel_iicbb_driver.  That driver relies on
iicbus_transfer_gen() which is where the nostop kludge was added.
That's the fundamental problem in all of this:  the right thing to do,
IMO, would have been to implement the iicbus_transfer method directly
in the intel_iicbb_driver (probably by just cut-and-pasting the code
from iicconf.c then doing whatever is necessary to ignore stops).  And
we can still do that, pretty trivially, if necessary.

-- Ian




Hi!
It seems like things broke after all, latest pkg build (on head-amd64) 
reports this:



/wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2: 
error: implicit declaration of function 'iicbus_set_nostop' is invalid 
in C99 [-Werror,-Wimplicit-function-declaration]

iicbus_set_nostop(idev, true);
^
/wrkdirs/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-12bd551/src/dev/drm2/i915/intel_iic.c:570:2: 
error: this function declaration is not a prototype 
[-Werror,-Wstrict-prototypes]

2 errors generated.

Full log:

http://beefy12.nyi.freebsd.org/data/head-amd64-default/p503023_s348376/logs/drm-legacy-kmod-g20190523.log

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


Re: svn commit: r348521 - in head: . etc sys/conf sys/modules usr.bin/login usr.sbin/services_mkdb

2019-06-03 Thread Andrew Turner


> On 3 Jun 2019, at 00:38, Maxim Sobolev  wrote:
> 
> Author: sobomax
> Date: Sun Jun  2 23:38:19 2019
> New Revision: 348521
> URL: https://svnweb.freebsd.org/changeset/base/348521
> 
> Log:
>  Fix several places where tool name has been hardcoded:
> 
>  install -> ${INSTALL}
>  mtree -> ${MTREE_CMD}
>  services_mkdb -> ${SERVICES_MKDB_CMD}
>  cap_mkdb -> ${CAP_MKDB_CMD}
>  pwd_mkdb -> ${PWD_MKDB_CMD}
>  kldxref -> ${KLDXREF_CMD}
> 
>  If you do custom FreeBSD builds you may want to override those
>  in some cases.
> 
>  Sponsored by:Sippy Software, Inc.

This breaks installworld in a local Jenkins instance. I’m building with 
-DDB_FROM_SRC and -DNO_ROOT. It looks like INSTALL is unset.

Andrew

--
>>> Making hierarchy
--
cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head; make -f Makefile.inc1  
LOCAL_MTREE= hierarchy
cd /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc; 
PATH=/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/tmp/install.ZQ3PdXVZ
 make LOCAL_MTREE= 
PATH=/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/sbin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/usr/bin:/jenkins/workspace/FreeBSD-arm64-head/obj/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/arm64.aarch64/tmp/legacy/bin::/tmp/install.ZQ3PdXVZ
 METALOG=/jenkins/workspace/FreeBSD-arm64-head/obj/root//METALOG -DNO_ROOT 
distrib-dirs
for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit 
/usr/share/doc/usd/12.vi /usr/share/doc/usd/13.viref; do  if [ -f 
/jenkins/workspace/FreeBSD-arm64-head/obj/root/${file} ]; then  rm -f 
/jenkins/workspace/FreeBSD-arm64-head/obj/root/${file};  fi;  done
-N /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc -W -deU -i -f 
/jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc/mtree/BSD.root.dist -p 
/jenkins/workspace/FreeBSD-arm64-head/obj/root/
/tmp/install.ZQ3PdXVZ/sh: -N: not found
*** Error code 127

Stop.
make[4]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head/etc
*** Error code 1

Stop.
make[3]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
*** Error code 1

Stop.
make[2]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
*** Error code 1

Stop.
make[1]: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
*** Error code 1

Stop.
make: stopped in /jenkins/workspace/FreeBSD-arm64-head/freebsd-head
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r348529 - head/sys/dev/atkbdc

2019-06-03 Thread Vladimir Kondratyev
Author: wulf
Date: Mon Jun  3 10:04:34 2019
New Revision: 348529
URL: https://svnweb.freebsd.org/changeset/base/348529

Log:
  psm(4): Add natural scrolling support to sysmouse protocol
  
  This change enables natural scrolling with two finger scroll enabled
  and when user is using a trackpad (mouse and trackpoint are not affected).
  Depending on trackpad model it can be activated with setting of
  hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl
  values to 1.
  
  Evdev protocol is not affected by this change too. Tune userland client
  e.g. libinput to enable natural scrolling in that case.
  
  Submitted by: nyan_myuji.xyz
  Reviewed by:  wulf
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D20447

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Mon Jun  3 07:57:54 2019(r348528)
+++ head/sys/dev/atkbdc/psm.c   Mon Jun  3 10:04:34 2019(r348529)
@@ -236,6 +236,7 @@ typedef struct synapticsinfo {
int  softbutton3_x;
int  max_x;
int  max_y;
+   int  natural_scroll;
 } synapticsinfo_t;
 
 typedef struct synapticspacket {
@@ -571,6 +572,8 @@ enum {
SYNAPTICS_SYSCTL_SOFTBUTTONS_Y =SYN_OFFSET(softbuttons_y),
SYNAPTICS_SYSCTL_SOFTBUTTON2_X =SYN_OFFSET(softbutton2_x),
SYNAPTICS_SYSCTL_SOFTBUTTON3_X =SYN_OFFSET(softbutton3_x),
+   SYNAPTICS_SYSCTL_NATURAL_SCROLL =   SYN_OFFSET(natural_scroll),
+#defineSYNAPTICS_SYSCTL_LAST   SYNAPTICS_SYSCTL_NATURAL_SCROLL
 };
 
 /* packet formatting function */
@@ -4134,6 +4137,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo
int len, weight_prev_x, weight_prev_y;
int div_max_x, div_max_y, div_x, div_y;
int is_fuzzy;
+   int natural_scroll;
 
/* Read sysctl. */
/* XXX Verify values? */
@@ -4161,6 +4165,7 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo
two_finger_scroll = sc->syninfo.two_finger_scroll;
max_x = sc->syninfo.max_x;
max_y = sc->syninfo.max_y;
+   natural_scroll = sc->syninfo.natural_scroll;
 
is_fuzzy = (f->flags & PSM_FINGER_FUZZY) != 0;
 
@@ -4322,14 +4327,24 @@ psmsmoother(struct psm_softc *sc, finger_t *f, int smo
smoother_id, dx, dy, dxp, dyp));
break;
case 1: /* Vertical scrolling. */
-   if (dyp != 0)
-   ms->button |= (dyp > 0) ?
-   MOUSE_BUTTON4DOWN : MOUSE_BUTTON5DOWN;
+   if (dyp != 0) {
+   if (two_finger_scroll && natural_scroll)
+   ms->button |= (dyp > 0) ?
+   MOUSE_BUTTON5DOWN : 
MOUSE_BUTTON4DOWN;
+   else
+   ms->button |= (dyp > 0) ?
+   MOUSE_BUTTON4DOWN : 
MOUSE_BUTTON5DOWN;
+   }
break;
case 2: /* Horizontal scrolling. */
-   if (dxp != 0)
-   ms->button |= (dxp > 0) ?
-   MOUSE_BUTTON7DOWN : MOUSE_BUTTON6DOWN;
+   if (dxp != 0) {
+   if (two_finger_scroll && natural_scroll)
+   ms->button |= (dxp > 0) ?
+   MOUSE_BUTTON6DOWN : 
MOUSE_BUTTON7DOWN;
+   else
+   ms->button |= (dxp > 0) ?
+   MOUSE_BUTTON7DOWN : 
MOUSE_BUTTON6DOWN;
+   }
break;
}
 
@@ -5641,7 +5656,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS)
int error, arg;
 
if (oidp->oid_arg1 == NULL || oidp->oid_arg2 < 0 ||
-   oidp->oid_arg2 > SYNAPTICS_SYSCTL_SOFTBUTTON3_X)
+   oidp->oid_arg2 > SYNAPTICS_SYSCTL_LAST)
return (EINVAL);
 
sc = oidp->oid_arg1;
@@ -5730,6 +5745,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS)
return (EINVAL);
break;
 case SYNAPTICS_SYSCTL_TOUCHPAD_OFF:
+   case SYNAPTICS_SYSCTL_NATURAL_SCROLL:
if (arg < 0 || arg > 1)
return (EINVAL);
break;
@@ -6121,6 +6137,15 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con
sc, SYNAPTICS_SYSCTL_TOUCHPAD_OFF,
synaptics_sysctl, "I",
"Turn off touchpad");
+
+   /* hw.psm.syn