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

2020-11-05 Thread Allan Jude
Author: allanjude
Date: Thu Nov  5 17:10:14 2020
New Revision: 367393
URL: https://svnweb.freebsd.org/changeset/base/367393

Log:
  VirtIO: Make sure the guest knows the TRIM alignment requirements
  
  If bhyve is used to emulate 512e access in guest OS, then discard addresses 
should be properly aligned.
  Otherwise ioctl DIOCGDELETE fails for 512b requires on devices with 4K sector 
size.
  see g_dev_ioctl() in sys/geom/geom_dev.c
  
  Submitted by: Vitaliy Gusev 
  MFC after:1 week
  Sponsored by: vStack.com
  Differential Revision:https://reviews.freebsd.org/D27075

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

Modified: head/usr.sbin/bhyve/pci_virtio_block.c
==
--- head/usr.sbin/bhyve/pci_virtio_block.c  Thu Nov  5 16:47:23 2020
(r367392)
+++ head/usr.sbin/bhyve/pci_virtio_block.c  Thu Nov  5 17:10:14 2020
(r367393)
@@ -523,7 +523,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *
sc->vbsc_cfg.vbc_writeback = 0;
sc->vbsc_cfg.max_discard_sectors = VTBLK_MAX_DISCARD_SECT;
sc->vbsc_cfg.max_discard_seg = VTBLK_MAX_DISCARD_SEG;
-   sc->vbsc_cfg.discard_sector_alignment = sectsz / VTBLK_BSIZE;
+   sc->vbsc_cfg.discard_sector_alignment = MAX(sectsz, sts) / VTBLK_BSIZE;
 
/*
 * Should we move some of this into virtio.c?  Could
___
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: r363324 - head/usr.bin/at

2020-07-19 Thread Allan Jude
Author: allanjude
Date: Sun Jul 19 14:42:13 2020
New Revision: 363324
URL: https://svnweb.freebsd.org/changeset/base/363324

Log:
  at(1): Markup environment variables with proper macros
  
  Submitted by: debdrup
  Reported by:  0mp
  Reviewed by:  imp
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D25721

Modified:
  head/usr.bin/at/at.man

Modified: head/usr.bin/at/at.man
==
--- head/usr.bin/at/at.man  Sun Jul 19 12:34:19 2020(r363323)
+++ head/usr.bin/at/at.man  Sun Jul 19 14:42:13 2020(r363324)
@@ -216,7 +216,11 @@ might not be optimal for every deployment.
 If a finer granularity is desired, the
 .Pa /etc/cron.d/at
 file can be edited and will be read by the system crontab, from which
-the SHELL and PATH environment variables are inherited. 
+the 
+.Ev SHELL 
+and 
+.Ev PATH
+environment variables are inherited. 
 .Sh OPTIONS
 .Bl -tag -width indent
 .It Fl q Ar queue
___
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: r363286 - head/usr.bin/at

2020-07-17 Thread Allan Jude
Author: allanjude
Date: Fri Jul 17 20:43:00 2020
New Revision: 363286
URL: https://svnweb.freebsd.org/changeset/base/363286

Log:
  at(1): Fix location of at(1) crontab
  
  With r318443, atrun was moved from /etc/crontab to /etc/cron.d/at,
  but the man-page was unfortunately not updated to reflect this.
  
  PR:   248048
  Submitted by: debdrup
  Reported by:  yoitsmeremember+fbsd at gmail.com
  Reviewed by:  Pau Amma 
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D25709

Modified:
  head/usr.bin/at/at.man

Modified: head/usr.bin/at/at.man
==
--- head/usr.bin/at/at.man  Fri Jul 17 19:07:59 2020(r363285)
+++ head/usr.bin/at/at.man  Fri Jul 17 20:43:00 2020(r363286)
@@ -213,9 +213,10 @@ every five minutes.
 This implies that the granularity of
 .Nm
 might not be optimal for every deployment.
-If a finer granularity is needed, the system crontab at
-.Pa /etc/crontab
-needs to be changed.
+If a finer granularity is desired, the
+.Pa /etc/cron.d/at
+file can be edited and will be read by the system crontab, from which
+the SHELL and PATH environment variables are inherited. 
 .Sh OPTIONS
 .Bl -tag -width indent
 .It Fl q Ar queue
___
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: r363255 - head/sys/dev/virtio/block

2020-07-16 Thread Allan Jude
Author: allanjude
Date: Thu Jul 16 16:32:16 2020
New Revision: 363255
URL: https://svnweb.freebsd.org/changeset/base/363255

Log:
  Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver
  
  If the hypervisor advertises support for the DISCARD command then the
  guest can perform TRIM commands, freeing space on the backing store.
  
  If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE
  
  Tested with FreeBSD guests on bhyve and KVM
  
  Reviewed by:  jhb
  Tested by:freqlabs
  MFC after:1 month
  Relnotes: yes
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D21708

Modified:
  head/sys/dev/virtio/block/virtio_blk.c
  head/sys/dev/virtio/block/virtio_blk.h

Modified: head/sys/dev/virtio/block/virtio_blk.c
==
--- head/sys/dev/virtio/block/virtio_blk.c  Thu Jul 16 15:12:52 2020
(r363254)
+++ head/sys/dev/virtio/block/virtio_blk.c  Thu Jul 16 16:32:16 2020
(r363255)
@@ -81,6 +81,7 @@ struct vtblk_softc {
 #define VTBLK_FLAG_SUSPEND 0x0008
 #define VTBLK_FLAG_BARRIER 0x0010
 #define VTBLK_FLAG_WC_CONFIG   0x0020
+#define VTBLK_FLAG_DISCARD 0x0040
 
struct virtqueue*vtblk_vq;
struct sglist   *vtblk_sglist;
@@ -112,6 +113,7 @@ static struct virtio_feature_desc vtblk_feature_desc[]
{ VIRTIO_BLK_F_WCE, "WriteCache"},
{ VIRTIO_BLK_F_TOPOLOGY,"Topology"  },
{ VIRTIO_BLK_F_CONFIG_WCE,  "ConfigWCE" },
+   { VIRTIO_BLK_F_DISCARD, "Discard"   },
 
{ 0, NULL }
 };
@@ -210,6 +212,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", _writeca
  VIRTIO_BLK_F_WCE  | \
  VIRTIO_BLK_F_TOPOLOGY | \
  VIRTIO_BLK_F_CONFIG_WCE   | \
+ VIRTIO_BLK_F_DISCARD  | \
  VIRTIO_RING_F_INDIRECT_DESC)
 
 #define VTBLK_MTX(_sc) &(_sc)->vtblk_mtx
@@ -459,7 +462,7 @@ vtblk_config_change(device_t dev)
vtblk_read_config(sc, );
 
/* Capacity is always in 512-byte units. */
-   capacity = blkcfg.capacity * 512;
+   capacity = blkcfg.capacity * VTBLK_BSIZE;
 
if (sc->vtblk_disk->d_mediasize != capacity)
vtblk_resize_disk(sc, capacity);
@@ -544,13 +547,14 @@ vtblk_strategy(struct bio *bp)
 * be a better way to report our readonly'ness to GEOM above.
 */
if (sc->vtblk_flags & VTBLK_FLAG_READONLY &&
-   (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) {
+   (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH ||
+   bp->bio_cmd == BIO_DELETE)) {
vtblk_bio_done(sc, bp, EROFS);
return;
}
 
if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE) &&
-   (bp->bio_cmd != BIO_FLUSH)) {
+   (bp->bio_cmd != BIO_FLUSH) && (bp->bio_cmd != BIO_DELETE)) {
vtblk_bio_done(sc, bp, EOPNOTSUPP);
return;
}
@@ -563,6 +567,13 @@ vtblk_strategy(struct bio *bp)
return;
}
 
+   if ((bp->bio_cmd == BIO_DELETE) &&
+   !(sc->vtblk_flags & VTBLK_FLAG_DISCARD)) {
+   VTBLK_UNLOCK(sc);
+   vtblk_bio_done(sc, bp, EOPNOTSUPP);
+   return;
+   }
+
bioq_insert_tail(>vtblk_bioq, bp);
vtblk_startio(sc);
 
@@ -598,6 +609,8 @@ vtblk_setup_features(struct vtblk_softc *sc)
sc->vtblk_flags |= VTBLK_FLAG_BARRIER;
if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE))
sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG;
+   if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD))
+   sc->vtblk_flags |= VTBLK_FLAG_DISCARD;
 }
 
 static int
@@ -687,12 +700,12 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio
dp->d_dump = vtblk_dump;
 
/* Capacity is always in 512-byte units. */
-   dp->d_mediasize = blkcfg->capacity * 512;
+   dp->d_mediasize = blkcfg->capacity * VTBLK_BSIZE;
 
if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE))
dp->d_sectorsize = blkcfg->blk_size;
else
-   dp->d_sectorsize = 512;
+   dp->d_sectorsize = VTBLK_BSIZE;
 
/*
 * The VirtIO maximum I/O size is given in terms of segments.
@@ -726,6 +739,11 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio
dp->d_stripesize;
}
 
+   if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) {
+   dp->d_flags |= DISKFLAG_CANDELETE;
+   dp->d_delmaxsize = blkcfg->max_discard_sectors * VTBLK_BSIZE;
+   }
+
if (vtblk_write_cache_enabled(sc, blkcfg) != 0)
sc->vtblk_write_cache = VTBLK_CACHE_WRITEBACK;
else
@@ -876,12 +894,16 @@ vtblk_request_bio(struct vtblk_softc *sc)
break;
case BIO_READ:
req->vbr_hdr.type 

svn commit: r363224 - head/cddl/contrib/opensolaris/cmd/zpool

2020-07-15 Thread Allan Jude
Author: allanjude
Date: Wed Jul 15 14:38:15 2020
New Revision: 363224
URL: https://svnweb.freebsd.org/changeset/base/363224

Log:
  zpool-features(7): Note that the boot loader has support for large_blocks
  
  Since r304321 (-current: Aug 18, 2016) and r328866 (stable/11: Feb 5, 2018)
  the FreeBSD loader has supported reading from datasets with the
  large_blocks feature active.
  
  PR:   247992
  Reported by:  Anton Saietskii 
  MFC after:2 weeks
  Sponsored by: Klara Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Wed Jul 15 
14:27:23 2020(r363223)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Wed Jul 15 
14:38:15 2020(r363224)
@@ -521,10 +521,9 @@ property has been set larger than 128KB, and will retu
 once all filesystems that have ever had their recordsize larger than 128KB
 are destroyed.
 .Pp
-Please note that booting from datasets that have recordsize greater than
-128KB is
-.Em NOT
-supported by the
+Booting from datasets that use the
+.Sy large_block
+feature is supported by the
 .Fx
 boot loader.
 .It Sy large_dnode
___
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: r363223 - head/share/man/man4

2020-07-15 Thread Allan Jude
Author: allanjude
Date: Wed Jul 15 14:27:23 2020
New Revision: 363223
URL: https://svnweb.freebsd.org/changeset/base/363223

Log:
  vlan(4): Minor grammar corrections
  
  Note: date not bumped because "content" was not changed, just inserted some
  missing words.
  
  PR:   248001
  Submitted by: Jose Luis Duran 
  MFC after:2 weeks
  Sponsored by: Klara Inc.

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

Modified: head/share/man/man4/vxlan.4
==
--- head/share/man/man4/vxlan.4 Wed Jul 15 13:43:48 2020(r363222)
+++ head/share/man/man4/vxlan.4 Wed Jul 15 14:27:23 2020(r363223)
@@ -80,7 +80,7 @@ The
 driver creates a pseudo Ethernet network interface
 that supports the usual network
 .Xr ioctl 2 Ns s
-and is thus can be used with
+and thus can be used with
 .Xr ifconfig 8
 like any other Ethernet interface.
 The
@@ -89,7 +89,7 @@ interface encapsulates the Ethernet frame
 by prepending IP/UDP and
 .Nm
 headers.
-Thus, the encapsulated (inner) frame is able to transmitted
+Thus, the encapsulated (inner) frame is able to be transmitted
 over a routed, Layer 3 network to the remote host.
 .Pp
 The
@@ -102,7 +102,7 @@ When in multicast mode,
 the interface joins an IP multicast group,
 and receives packets sent to the group address,
 and transmits packets to either the multicast group address,
-or directly the remote host if there is an appropriate
+or directly to the remote host if there is an appropriate
 forwarding table entry.
 .Pp
 When the
@@ -155,7 +155,7 @@ The maximum number of entries in the table is configur
 .Xr ifconfig 8
 .Cm vxlanmaxaddr
 command.
-Stale entries in the table periodically pruned.
+Stale entries in the table are periodically pruned.
 The timeout is configurable with the
 .Xr ifconfig 8
 .Cm vxlantimeout
___
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: r363169 - head/usr.sbin/periodic/etc/daily

2020-07-13 Thread Allan Jude
Author: allanjude
Date: Tue Jul 14 00:46:20 2020
New Revision: 363169
URL: https://svnweb.freebsd.org/changeset/base/363169

Log:
  Actually install the new 221.backup-gpart periodic script
  
  Submitted by: Rob Fairbanks 
  Reported by:  Michael Butler 
  MFC with: r363110
  Sponsored by: Klara Inc.

Modified:
  head/usr.sbin/periodic/etc/daily/Makefile

Modified: head/usr.sbin/periodic/etc/daily/Makefile
==
--- head/usr.sbin/periodic/etc/daily/Makefile   Mon Jul 13 19:28:10 2020
(r363168)
+++ head/usr.sbin/periodic/etc/daily/Makefile   Tue Jul 14 00:46:20 2020
(r363169)
@@ -10,6 +10,7 @@ CONFS=100.clean-disks \
140.clean-rwho \
200.backup-passwd \
210.backup-aliases \
+   221.backup-gpart \
330.news \
400.status-disks \
401.status-graid \
___
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: r363103 - head/usr.sbin/bsdinstall/scripts

2020-07-13 Thread Allan Jude
On 2020-07-12 13:32, Enji Cooper wrote:
> 
>> On Jul 11, 2020, at 10:20 AM, Allan Jude  wrote:
>>
>> Author: allanjude
>> Date: Sat Jul 11 17:20:17 2020
>> New Revision: 363103
>> URL: https://svnweb.freebsd.org/changeset/base/363103
>>
>> Log:
>>  bsdinstall: only kill the dhclient for the interface we are restarting
>>
>>  PR: 205821
>>  Reported by:mjg
>>  MFC after:  2 weeks
>>  Sponsored by:   Klara Inc.
>>  Event:  July 2020 Bugathon
>>
>> Modified:
>>  head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
> 
> Allan,
>   Thank you so very much for doing this!!! This has been an annoying 
> nitpick of mine with sysinstall/bsdinstall, for many moons :).
>   It looks like equivalent logic doesn’t need to be implemented for IPv6. 
> Yay :).
> Cheers!
> -Enji
> 

Someone else wrote the patch, although I had a similar idea previously.
Mark Johnston came up with the pkill -F part, that made it only kill
dhclient for the correct interface.


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


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

2020-07-13 Thread Allan Jude
Author: allanjude
Date: Mon Jul 13 13:44:54 2020
New Revision: 363142
URL: https://svnweb.freebsd.org/changeset/base/363142

Log:
  Remove excess spaces from rc.d scripts
  
  The space between words is already being echoed by the space between quoted 
strings:
  
  % echo 'foo' 'bar'
  foo bar
  
  % echo 'foo' ' baz'
  foo  baz
  
  Found in `ipfw` and `mountlate` messages.
  
  PR:   247948
  Submitted by: Jose Luis Duran 
  MFC after:2 weeks
  Sponsored by: Klara Inc.

Modified:
  head/libexec/rc/rc.d/ipfw
  head/libexec/rc/rc.d/mountlate

Modified: head/libexec/rc/rc.d/ipfw
==
--- head/libexec/rc/rc.d/ipfw   Mon Jul 13 13:35:36 2020(r363141)
+++ head/libexec/rc/rc.d/ipfw   Mon Jul 13 13:44:54 2020(r363142)
@@ -63,7 +63,7 @@ ipfw_start()
echo 'Firewall rules loaded.'
elif [ "`ipfw list 65535`" = "65535 deny ip from any to any" ]; then
echo 'Warning: kernel has firewall functionality, but' \
-   ' firewall rules are not enabled.'
+   'firewall rules are not enabled.'
echo '   All ip services are disabled.'
fi
 

Modified: head/libexec/rc/rc.d/mountlate
==
--- head/libexec/rc/rc.d/mountlate  Mon Jul 13 13:35:36 2020
(r363141)
+++ head/libexec/rc/rc.d/mountlate  Mon Jul 13 13:44:54 2020
(r363142)
@@ -32,7 +32,7 @@ mountlate_start()
;;
*)
echo 'Mounting /etc/fstab filesystems failed,' \
-   ' startup aborted'
+   'startup aborted'
stop_boot true
;;
esac
___
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: r363139 - head/stand/man

2020-07-12 Thread Allan Jude
Author: allanjude
Date: Mon Jul 13 02:09:21 2020
New Revision: 363139
URL: https://svnweb.freebsd.org/changeset/base/363139

Log:
  Loader: explain the syntax of currdev
  
  The origin text was: "Syntax for devices is odd."
  That is not very helpful.
  
  PR:   199103
  Reviewed by:  kevans, tsoome
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon
  Differential Revision:https://reviews.freebsd.org/D25629

Modified:
  head/stand/man/loader.8

Modified: head/stand/man/loader.8
==
--- head/stand/man/loader.8 Mon Jul 13 01:32:37 2020(r363138)
+++ head/stand/man/loader.8 Mon Jul 13 02:09:21 2020(r363139)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 15, 2018
+.Dd July 11, 2020
 .Dt LOADER 8
 .Os
 .Sh NAME
@@ -479,8 +479,14 @@ In that case, the first listed console will become the
 userland output (e.g.\& from
 .Xr init 8 ) .
 .It Va currdev
-Selects the default device.
-Syntax for devices is odd.
+Selects the default device to loader the kernel from.
+The syntax is:
+.Dl Ic loader_device:
+or
+.Dl Ic zfs:dataset:
+Examples:
+.Dl Ic disk0p2:
+.Dl Ic zfs:zroot/ROOT/default:
 .It Va dumpdev
 Sets the device for kernel dumps.
 This can be used to ensure that a device is configured before the corresponding
___
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: r363114 - head/share/man/man5

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 22:14:44 2020
New Revision: 363114
URL: https://svnweb.freebsd.org/changeset/base/363114

Log:
  periodic.conf: correct capitailization in the middle of a sentence
  
  Reported by:  yuripv
  Event:July 2020 Bugathon

Modified:
  head/share/man/man5/periodic.conf.5

Modified: head/share/man/man5/periodic.conf.5
==
--- head/share/man/man5/periodic.conf.5 Sat Jul 11 21:57:43 2020
(r363113)
+++ head/share/man/man5/periodic.conf.5 Sat Jul 11 22:14:44 2020
(r363114)
@@ -256,17 +256,17 @@ as configured in
 .Pq Vt bool
 Set to
 .Dq Li YES
-To create backup of EFI System Partion (ESP).
+to create backup of EFI System Partion (ESP).
 .It Va daily_backup_gpart_enable
 .Pq Vt bool
 Set to
 .Dq Li YES
-To create backups of partition tables, and bootcode partition contents.
+to create backups of partition tables, and bootcode partition contents.
 .It Va daily_backup_gpart_verbose
 .Pq Vt bool
 Set to
 .Dq Li YES
-To be verbose if existing backups for kern.geom.conftxt or the partition 
tables differ
+to be verbose if existing backups for kern.geom.conftxt or the partition 
tables differ
 from the new backups.
 .It Va daily_backup_passwd_enable
 .Pq Vt bool
___
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: r363111 - in head: libexec/getty share/man/man4

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 20:56:57 2020
New Revision: 363111
URL: https://svnweb.freebsd.org/changeset/base/363111

Log:
  Add cross references betwen ttys(5) and related drivers
  
  nmdm(4), ucom(4), and uart(4)
  
  PR:   247638
  Submitted by: Pau Amma 
  Reported by:  0mp
  MFC after:4 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon

Modified:
  head/libexec/getty/ttys.5
  head/share/man/man4/nmdm.4
  head/share/man/man4/uart.4
  head/share/man/man4/ucom.4

Modified: head/libexec/getty/ttys.5
==
--- head/libexec/getty/ttys.5   Sat Jul 11 20:53:31 2020(r363110)
+++ head/libexec/getty/ttys.5   Sat Jul 11 20:56:57 2020(r363111)
@@ -28,7 +28,7 @@
 .\" from: @(#)ttys.5   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\" "
-.Dd August 3, 2018
+.Dd July 11, 2020
 .Dt TTYS 5
 .Os
 .Sh NAME
@@ -162,6 +162,9 @@ ttyv0   "/usr/local/bin/xterm -display :0"  xterm   
on wind
 .Sh SEE ALSO
 .Xr login 1 ,
 .Xr getttyent 3 ,
+.Xr nmdm 4 ,
+.Xr uart 4 ,
+.Xr ucom 4 ,
 .Xr gettytab 5 ,
 .Xr login.conf 5 ,
 .Xr termcap 5 ,

Modified: head/share/man/man4/nmdm.4
==
--- head/share/man/man4/nmdm.4  Sat Jul 11 20:53:31 2020(r363110)
+++ head/share/man/man4/nmdm.4  Sat Jul 11 20:56:57 2020(r363111)
@@ -21,7 +21,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2018
+.Dd July 11, 2020
 .Dt NMDM 4
 .Os
 .Sh NAME
@@ -89,7 +89,8 @@ None.
 .Sh SEE ALSO
 .Xr stty 1 ,
 .Xr termios 4 ,
-.Xr tty 4
+.Xr tty 4 ,
+.Xr ttys 5
 .Sh HISTORY
 The
 .Nm

Modified: head/share/man/man4/uart.4
==
--- head/share/man/man4/uart.4  Sat Jul 11 20:53:31 2020(r363110)
+++ head/share/man/man4/uart.4  Sat Jul 11 20:56:57 2020(r363111)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 26, 2017
+.Dd July 11, 2020
 .Dt UART 4
 .Os
 .Sh NAME
@@ -286,8 +286,10 @@ for callout ports
 corresponding callout initial-state and lock-state devices
 .El
 .Sh SEE ALSO
+.Xr cu 1 ,
 .Xr puc 4 ,
-.Xr scc 4
+.Xr scc 4 ,
+.Xr ttys 5
 .\"
 .Sh HISTORY
 The

Modified: head/share/man/man4/ucom.4
==
--- head/share/man/man4/ucom.4  Sat Jul 11 20:53:31 2020(r363110)
+++ head/share/man/man4/ucom.4  Sat Jul 11 20:56:57 2020(r363111)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2018
+.Dd July 11, 2020
 .Dt UCOM 4
 .Os
 .Sh NAME
@@ -125,6 +125,7 @@ for callout ports
 corresponding callout initial-state and lock-state devices
 .El
 .Sh SEE ALSO
+.Xr cu 1 ,
 .Xr tty 4 ,
 .Xr uark 4 ,
 .Xr ubsa 4 ,
@@ -144,7 +145,8 @@ corresponding callout initial-state and lock-state dev
 .Xr usb 4 ,
 .Xr uslcom 4 ,
 .Xr uvisor 4 ,
-.Xr uvscom 4
+.Xr uvscom 4 ,
+.Xr ttys 5
 .Sh HISTORY
 The
 .Nm
___
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: r363110 - in head: share/man/man5 usr.sbin/periodic usr.sbin/periodic/etc/daily

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 20:53:31 2020
New Revision: 363110
URL: https://svnweb.freebsd.org/changeset/base/363110

Log:
  Add a periodic script to backup the partition table and boot code
  
  Optionally, alert you if the contents change from the previous backup
  
  PR:   86388
  Submitted by: Rob Fairbanks , Miroslav Lachman 
<000.f...@quip.cz> (Original Version)
  MFC after:4 weeks
  Relnotes: yes
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon
  Differential Revision:https://reviews.freebsd.org/D25628

Added:
  head/usr.sbin/periodic/etc/daily/221.backup-gpart   (contents, props changed)
Modified:
  head/share/man/man5/periodic.conf.5
  head/usr.sbin/periodic/periodic.conf

Modified: head/share/man/man5/periodic.conf.5
==
--- head/share/man/man5/periodic.conf.5 Sat Jul 11 19:44:12 2020
(r363109)
+++ head/share/man/man5/periodic.conf.5 Sat Jul 11 20:53:31 2020
(r363110)
@@ -252,6 +252,22 @@ Files will be deleted using the same criteria as
 would normally use when determining whether to believe the cached information,
 as configured in
 .Pa /etc/mail/sendmail.cf .
+.It Va daily_backup_efi_enable
+.Pq Vt bool
+Set to
+.Dq Li YES
+To create backup of EFI System Partion (ESP).
+.It Va daily_backup_gpart_enable
+.Pq Vt bool
+Set to
+.Dq Li YES
+To create backups of partition tables, and bootcode partition contents.
+.It Va daily_backup_gpart_verbose
+.Pq Vt bool
+Set to
+.Dq Li YES
+To be verbose if existing backups for kern.geom.conftxt or the partition 
tables differ
+from the new backups.
 .It Va daily_backup_passwd_enable
 .Pq Vt bool
 Set to

Added: head/usr.sbin/periodic/etc/daily/221.backup-gpart
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/periodic/etc/daily/221.backup-gpart   Sat Jul 11 20:53:31 
2020(r363110)
@@ -0,0 +1,124 @@
+#!/bin/sh
+
+## $FreeBSD$
+## Created by: Miroslav Lachman <000.f...@quip.cz>
+
+## Backup of disk partitions layout, useful for gpart restore.
+## Data are stored on local filesystem, in /var/backup.
+## It is recommended to copy those files to off-site storage.
+
+
+## If there is a global system configuration file, suck it in.
+##
+if [ -r /etc/defaults/periodic.conf ]
+then
+   . /etc/defaults/periodic.conf
+   source_periodic_confs
+fi
+
+bak_dir=/var/backups
+
+rotate() {
+   base_name=$1
+   show_diff=$2
+   file="$bak_dir/$base_name"
+
+   if [ -f "${file}.bak" ] ; then
+   rc=0
+   if cmp -s "${file}.bak" "${file}.tmp"; then
+   rm "${file}.tmp"
+   else
+   rc=1
+   [ -n "$show_diff" ] && diff "${file}.bak" "${file}.tmp"
+   mv "${file}.bak" "${file}.bak2" || rc=3
+   mv "${file}.tmp" "${file}.bak" || rc=3
+   fi
+   else
+   rc=1
+   mv "${file}.tmp" "${file}.bak" || rc=3
+   [ -n "$show_diff" ] && cat "${file}.bak"
+   fi
+}
+
+case "$daily_backup_gpart_verbose" in
+   [Yy][Ee][Ss]) show="YES"
+esac
+
+case "$daily_backup_gpart_enable" in
+   [Yy][Ee][Ss])
+
+   echo ""
+   echo "Dump of kern.geom.conftxt:";
+   sysctl -n kern.geom.conftxt > "$bak_dir/kern.geom.conftxt.tmp"
+   rotate "kern.geom.conftxt" $show
+
+   gpart_devs=$(gpart show | awk '$1 == "=>" { print $4 }')
+   if [ -n "$daily_backup_gpart_exclude" ]; then
+   gpart_devs=$(echo ${gpart_devs} | grep -E -v 
"${daily_backup_gpart_exclude}")
+   fi
+
+   if [ -z "$gpart_devs"  ]; then
+   echo '$daily_backup_gpart_enable is set but no disk probed by 
kernel.' \
+   "perhaps NFS diskless client."
+   rc=2
+   else
+   echo ""
+   echo "Backup of partitions information for:";
+
+   for d in ${gpart_devs}; do
+   echo "$d"
+   safe_name=$(echo "gpart.${d}" | tr -cs ".[:alnum:]\n" 
"_")
+   gpart backup "$d" > "$bak_dir/$safe_name.tmp"
+   rotate "$safe_name" $show
+   done
+
+   gpart_show=$(gpart show -p)
+   boot_part=$(echo "$gpart_show" | awk '$4 ~ 
/(bios|freebsd)-boot/ { print $3 }')
+   if [ -n "$boot_part" ]; then
+   echo ""
+   echo "Backup of boot partition content:"
+   for b in ${boot_part}; do
+   echo "$b"
+   safe_name=$(echo "boot.${b}" | tr -cs 
".[:alnum:]\n" "_")
+   dd if="/dev/${b}" of="$bak_dir/$safe_name.tmp" 
2> /dev/null
+   rotate "$safe_name"
+   done
+  

svn commit: r363109 - head/usr.sbin/nscd

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 19:44:12 2020
New Revision: 363109
URL: https://svnweb.freebsd.org/changeset/base/363109

Log:
  nscd: does not warn about invalid values what parsing config file
  
  PR:   202135
  Submitted by: am...@amutu.com
  Reported By:  trond.endres...@ximalas.info
  Reviewed by:  markj, freqlabs
  MFC after:4 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon
  Differential Revision:https://reviews.freebsd.org/D25627

Modified:
  head/usr.sbin/nscd/parser.c

Modified: head/usr.sbin/nscd/parser.c
==
--- head/usr.sbin/nscd/parser.c Sat Jul 11 19:29:24 2020(r363108)
+++ head/usr.sbin/nscd/parser.c Sat Jul 11 19:44:12 2020(r363109)
@@ -375,6 +375,7 @@ parse_config_file(struct configuration *config,
char*fields[128];
int field_count, line_num, value;
int res;
+   int invalid_value;
 
TRACE_IN(parse_config_file);
assert(config != NULL);
@@ -388,6 +389,7 @@ parse_config_file(struct configuration *config,
 
res = 0;
line_num = 0;
+   invalid_value = 0;
memset(buffer, 0, sizeof(buffer));
while ((res == 0) && (fgets(buffer, sizeof(buffer) - 1, fin) != NULL)) {
field_count = strbreak(buffer, fields, sizeof(fields));
@@ -421,12 +423,20 @@ parse_config_file(struct configuration *config,
(strcmp(fields[0], "positive-time-to-live") == 0) &&
(check_cachename(fields[1]) == 0) &&
((value = get_number(fields[2], 0, -1)) != -1)) {
+   if (value <= 0) {
+   invalid_value = 1;
+   break;
+   }
set_positive_time_to_live(config,
fields[1], value);
continue;
} else if ((field_count == 3) &&
(strcmp(fields[0], "positive-confidence-threshold") == 
0) &&
((value = get_number(fields[2], 1, -1)) != -1)) {
+   if (value <= 0) {
+   invalid_value = 1;
+   break;
+   }
set_positive_confidence_threshold(config,
fields[1], value);
continue;
@@ -450,12 +460,20 @@ parse_config_file(struct configuration *config,
(strcmp(fields[0], "negative-time-to-live") == 0) &&
(check_cachename(fields[1]) == 0) &&
((value = get_number(fields[2], 0, -1)) != -1)) {
+   if (value <= 0) {
+   invalid_value = 1;
+   break;
+   }
set_negative_time_to_live(config,
fields[1], value);
continue;
} else if ((field_count == 3) &&
(strcmp(fields[0], "negative-confidence-threshold") == 
0) &&
((value = get_number(fields[2], 1, -1)) != -1)) {
+   if (value <= 0) {
+   invalid_value = 1;
+   break;
+   }
set_negative_confidence_threshold(config,
fields[1], value);
continue;
@@ -473,6 +491,10 @@ parse_config_file(struct configuration *config,
(strcmp(fields[0], "suggested-size") == 0) &&
(check_cachename(fields[1]) == 0) &&
((value = get_number(fields[2], 1, -1)) != -1)) {
+   if (value <= 0) {
+   invalid_value = 1;
+   break;
+   }
set_suggested_size(config, fields[1], value);
continue;
}
@@ -490,6 +512,10 @@ parse_config_file(struct configuration *config,
(strcmp(fields[0], "keep-hot-count") == 0) &&
(check_cachename(fields[1]) == 0) &&
((value = get_number(fields[2], 0, -1)) != -1)) {
+   if (value < 0) {
+   invalid_value = 1;
+   break;
+   }
set_keep_hot_count(config,
 

svn commit: r363108 - head/sbin/reboot

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 19:29:24 2020
New Revision: 363108
URL: https://svnweb.freebsd.org/changeset/base/363108

Log:
  boot(8): fix sorting of cross references
  
  Reported by:  yuripv
  Event:July 2020 Bugathon

Modified:
  head/sbin/reboot/boot_i386.8

Modified: head/sbin/reboot/boot_i386.8
==
--- head/sbin/reboot/boot_i386.8Sat Jul 11 19:18:43 2020
(r363107)
+++ head/sbin/reboot/boot_i386.8Sat Jul 11 19:29:24 2020
(r363108)
@@ -328,6 +328,8 @@ requirement has not been adhered to.
 .Xr boot0cfg 8 ,
 .Xr btxld 8 ,
 .Xr config 8 ,
+.Xr efibootmgr 8 ,
+.Xr efivar 8 ,
 .Xr gpart 8 ,
 .Xr gptboot 8 ,
 .Xr gptzfsboot 8 ,
@@ -336,10 +338,8 @@ requirement has not been adhered to.
 .Xr nextboot 8 ,
 .Xr reboot 8 ,
 .Xr shutdown 8 ,
-.Xr zfsbootcfg 8 ,
-.Xr efibootmgr 8 ,
-.Xr efivar 8 ,
-.Xr uefi 8
+.Xr uefi 8 ,
+.Xr zfsbootcfg 8
 .Sh BUGS
 The bsdlabel format used by this version of
 .Bx
___
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: r363107 - head/sbin/reboot

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 19:18:43 2020
New Revision: 363107
URL: https://svnweb.freebsd.org/changeset/base/363107

Log:
  boot(8): Add additional cross references
  
  Provide hints to direct people towards gptzfsboot, zfsbootcfg, efibootmgr, etc
  
  PR:   199103
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon

Modified:
  head/sbin/reboot/boot_i386.8

Modified: head/sbin/reboot/boot_i386.8
==
--- head/sbin/reboot/boot_i386.8Sat Jul 11 18:27:05 2020
(r363106)
+++ head/sbin/reboot/boot_i386.8Sat Jul 11 19:18:43 2020
(r363107)
@@ -36,7 +36,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2020
+.Dd July 11, 2020
 .Dt BOOT 8 i386
 .Os
 .Sh NAME
@@ -330,11 +330,15 @@ requirement has not been adhered to.
 .Xr config 8 ,
 .Xr gpart 8 ,
 .Xr gptboot 8 ,
+.Xr gptzfsboot 8 ,
 .Xr halt 8 ,
 .Xr loader 8 ,
 .Xr nextboot 8 ,
 .Xr reboot 8 ,
 .Xr shutdown 8 ,
+.Xr zfsbootcfg 8 ,
+.Xr efibootmgr 8 ,
+.Xr efivar 8 ,
 .Xr uefi 8
 .Sh BUGS
 The bsdlabel format used by this version of
___
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: r363105 - head/usr.sbin/ppp

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 18:24:16 2020
New Revision: 363105
URL: https://svnweb.freebsd.org/changeset/base/363105

Log:
  ppp: Document the fact that ppp_nat is enabled by default
  
  No functional change.
  
  PR:   243062
  Submitted by: Evilham  (original version)
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon
  Differential Revision:https://reviews.freebsd.org/D25623

Modified:
  head/usr.sbin/ppp/ppp.8

Modified: head/usr.sbin/ppp/ppp.8
==
--- head/usr.sbin/ppp/ppp.8 Sat Jul 11 18:04:09 2020(r363104)
+++ head/usr.sbin/ppp/ppp.8 Sat Jul 11 18:24:16 2020(r363105)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 25, 2017
+.Dd July 11, 2020
 .Dt PPP 8
 .Os
 .Sh NAME
@@ -1653,6 +1653,15 @@ Check that IP forwarding is enabled in
 and that other machines have designated the
 .Nm
 host as the gateway for the LAN.
+When starting
+.Nm
+with the provided rc script, the default is to
+enable NAT; see
+.Va ppp_nat
+in
+.Xr rc.conf 5
+and
+.Pa /etc/defaults/rc.conf .
 .Sh PACKET FILTERING
 This implementation supports packet filtering.
 There are four kinds of
___
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: r363104 - head/lib/libc/sys

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 18:04:09 2020
New Revision: 363104
URL: https://svnweb.freebsd.org/changeset/base/363104

Log:
  procctl(2): consistently refer to the last agrument as 'data'
  
  Some older references called it 'arg'
  
  Also fix a syntax error that was underlining an entire sentence.
  
  PR:   247386
  Reported by:  Paul Floyd , PauAmma (research)
  MFC after:2 weeks
  Sponsored by: Klara Inc.

Modified:
  head/lib/libc/sys/procctl.2

Modified: head/lib/libc/sys/procctl.2
==
--- head/lib/libc/sys/procctl.2 Sat Jul 11 17:20:17 2020(r363103)
+++ head/lib/libc/sys/procctl.2 Sat Jul 11 18:04:09 2020(r363104)
@@ -483,7 +483,7 @@ and
 must be the either caller's pid or zero, with no difference in effect.
 The value is cleared for child processes
 and when executing set-user-ID or set-group-ID binaries.
-.Fa arg
+.Fa data
 must point to a value of type
 .Vt int
 indicating the signal
@@ -498,7 +498,7 @@ must be
 and
 .Fa id
 must be the either caller's pid or zero, with no difference in effect.
-.Fa arg
+.Fa data
 must point to a memory location that can hold a value of type
 .Vt int .
 If signal delivery has not been requested, it will contain zero
@@ -596,7 +596,8 @@ privilege might use this option.
 .El
 .It Dv PROC_KPTI_STATUS
 Returns the current KPTI status for the specified process.
-.Fa data must point to the integer variable, which returns the
+.Fa data
+must point to the integer variable, which returns the
 following statuses:
 .Bl -tag -width PROC_KPTI_CTL_DISABLE_ON_EXEC
 .It Dv PROC_KPTI_CTL_ENABLE_ON_EXEC
@@ -624,7 +625,7 @@ will fail if:
 .Bl -tag -width Er
 .It Bq Er EFAULT
 The
-.Fa arg
+.Fa data
 parameter points outside the process's allocated address space.
 .It Bq Er EINVAL
 The
@@ -644,7 +645,7 @@ and
 .Fa id .
 .It Bq Er EINVAL
 An invalid operation or flag was passed in
-.Fa arg
+.Fa data
 for a
 .Dv PROC_SPROTECT
 command.
___
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: r363103 - head/usr.sbin/bsdinstall/scripts

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 17:20:17 2020
New Revision: 363103
URL: https://svnweb.freebsd.org/changeset/base/363103

Log:
  bsdinstall: only kill the dhclient for the interface we are restarting
  
  PR:   205821
  Reported by:  mjg
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon

Modified:
  head/usr.sbin/bsdinstall/scripts/netconfig_ipv4

Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
==
--- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Sat Jul 11 17:10:16 
2020(r363102)
+++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Sat Jul 11 17:20:17 
2020(r363103)
@@ -51,7 +51,7 @@ if [ $? -eq $DIALOG_OK ]; then
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
ifconfig $INTERFACE up
dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring 
DHCP lease..." 0 0
-   err=$( pkill dhclient; dhclient $INTERFACE 2>&1 )
+   err=$( pkill -F /var/run/dhclient/dhclient.${INTERFACE}.pid; 
dhclient $INTERFACE 2>&1 )
if [ $? -ne 0 ]; then
f_dprintf "%s" "$err"
dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP 
lease acquisition failed." 0 0
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363097 - head/usr.sbin/bsdinstall/scripts

2020-07-11 Thread Allan Jude
On 2020-07-11 11:44, Mateusz Guzik wrote:
> On 7/11/20, Allan Jude  wrote:
>> Author: allanjude
>> Date: Sat Jul 11 15:32:53 2020
>> New Revision: 363097
>> URL: https://svnweb.freebsd.org/changeset/base/363097
>>
>> Log:
>>   bsdinstall: kill dhclient before starting a new instance
>>
>>   PR:205821
>>   Submitted by:  William Orr 
>>   MFC after: 2 weeks
>>   Sponsored by:  Klara Inc.
>>   Event: July 2020 Bugathon
>>   Differential Revision: https://reviews.freebsd.org/D14572
>>
>> Modified:
>>   head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
>>
>> Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
>> ==
>> --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4  Sat Jul 11 14:55:11
>> 2020 (r363096)
>> +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4  Sat Jul 11 15:32:53
>> 2020 (r363097)
>> @@ -51,7 +51,7 @@ if [ $? -eq $DIALOG_OK ]; then
>>  if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
>>  ifconfig $INTERFACE up
>>  dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP
>> lease..." 0 0
>> -err=$( dhclient $INTERFACE 2>&1 )
>> +err=$( pkill dhclient; dhclient $INTERFACE 2>&1 )
>>  if [ $? -ne 0 ]; then
>>  f_dprintf "%s" "$err"
>>  dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP 
>> lease acquisition
>> failed." 0 0
> 
> There can be more than one dhclient running, but this will kill everything.
> 

Good point.

Thanks to markj for the suggested fix, committed as r363103


-- 
Allan Jude
___
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: r363101 - head/usr.sbin/bsdinstall/scripts

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 17:06:48 2020
New Revision: 363101
URL: https://svnweb.freebsd.org/changeset/base/363101

Log:
  bsdinstall: don't fail if fstab is empty
  
  PR:   210865
  Submitted by: Tim Lukasiewicz , 
h-fujish...@sakura.ad.jp (original version)
  Reported by:  h-fujish...@sakura.ad.jp
  Reviewed by:  sef
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon

Modified:
  head/usr.sbin/bsdinstall/scripts/umount

Modified: head/usr.sbin/bsdinstall/scripts/umount
==
--- head/usr.sbin/bsdinstall/scripts/umount Sat Jul 11 16:57:44 2020
(r363100)
+++ head/usr.sbin/bsdinstall/scripts/umount Sat Jul 11 17:06:48 2020
(r363101)
@@ -39,4 +39,6 @@ cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL
 }' > $TMP_FSTAB
 
 umount $BSDINSTALL_CHROOT/dev 2>/dev/null
-umount -F $TMP_FSTAB -a 2>/dev/null
+if [ -n "$TMP_FSTAB" ]; then
+   umount -F $TMP_FSTAB -a 2>/dev/null
+fi
___
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: r363100 - head/share/man/man5

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 16:57:44 2020
New Revision: 363100
URL: https://svnweb.freebsd.org/changeset/base/363100

Log:
  defaults/rc.conf: note that the default is ppp_nat="YES"
  
  PR:   243062
  Submitted by: Evilham 
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D25621

Modified:
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Sat Jul 11 16:38:46 2020
(r363099)
+++ head/share/man/man5/rc.conf.5   Sat Jul 11 16:57:44 2020
(r363100)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 28, 2020
+.Dd July 11, 2020
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -1955,6 +1955,8 @@ Used in conjunction with
 .Va gateway_enable
 allows hosts on private network addresses access to the Internet using
 this host as a network address translating router.
+Default is
+.Dq Li YES .
 .It Va ppp_ Ns Ao Ar profile Ac Ns _nat
 .Pq Vt str
 Overrides the global
___
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: r363097 - head/usr.sbin/bsdinstall/scripts

2020-07-11 Thread Allan Jude
Author: allanjude
Date: Sat Jul 11 15:32:53 2020
New Revision: 363097
URL: https://svnweb.freebsd.org/changeset/base/363097

Log:
  bsdinstall: kill dhclient before starting a new instance
  
  PR:   205821
  Submitted by: William Orr 
  MFC after:2 weeks
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon
  Differential Revision:https://reviews.freebsd.org/D14572

Modified:
  head/usr.sbin/bsdinstall/scripts/netconfig_ipv4

Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
==
--- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Sat Jul 11 14:55:11 
2020(r363096)
+++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Sat Jul 11 15:32:53 
2020(r363097)
@@ -51,7 +51,7 @@ if [ $? -eq $DIALOG_OK ]; then
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
ifconfig $INTERFACE up
dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring 
DHCP lease..." 0 0
-   err=$( dhclient $INTERFACE 2>&1 )
+   err=$( pkill dhclient; dhclient $INTERFACE 2>&1 )
if [ $? -ne 0 ]; then
f_dprintf "%s" "$err"
dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP 
lease acquisition failed." 0 0
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362654 - head/sbin/ifconfig

2020-06-26 Thread Allan Jude
Author: allanjude
Date: Fri Jun 26 16:20:34 2020
New Revision: 362654
URL: https://svnweb.freebsd.org/changeset/base/362654

Log:
  ifconfig(8): optimize -f ether:dash mode
  
  Switch to the simplified while loop suggest by Aaron LI
  
  Post commit review via: https://reviews.freebsd.org/rS301185#inline-232
  
  Submitted by: Aaron LI 
  Sponsored by: Klara Inc.

Modified:
  head/sbin/ifconfig/af_link.c

Modified: head/sbin/ifconfig/af_link.c
==
--- head/sbin/ifconfig/af_link.cFri Jun 26 16:16:25 2020
(r362653)
+++ head/sbin/ifconfig/af_link.cFri Jun 26 16:20:34 2020
(r362654)
@@ -74,10 +74,10 @@ link_status(int s __unused, const struct ifaddrs *ifa)
sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) {
ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl));
if (f_ether != NULL && strcmp(f_ether, "dash") == 0) {
-   for (format_char = strchr(ether_format, ':');
-   format_char != NULL;
-   format_char = strchr(ether_format, ':'))
+   while ((format_char = strchr(ether_format, ':')) !=
+   NULL) {
*format_char = '-';
+   }
}
printf("\tether %s\n", ether_format);
} else {
___
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: r362652 - head/sbin/ifconfig

2020-06-26 Thread Allan Jude
Author: allanjude
Date: Fri Jun 26 15:14:03 2020
New Revision: 362652
URL: https://svnweb.freebsd.org/changeset/base/362652

Log:
  ifconfig(8): remove duplicate line from man page
  
  Reported by:  Weitian LI 
  Sponsored by: Klara Inc.

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Fri Jun 26 14:18:08 2020
(r362651)
+++ head/sbin/ifconfig/ifconfig.8   Fri Jun 26 15:14:03 2020
(r362652)
@@ -2914,7 +2914,6 @@ The
 flag limits this to interfaces that are down,
 .Fl u
 limits this to interfaces that are up,
-limits this to interfaces that are up,
 .Fl g
 limits this to members of the specified group of interfaces, and
 .Fl G
___
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: r362505 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-06-22 Thread Allan Jude
Author: allanjude
Date: Mon Jun 22 19:03:02 2020
New Revision: 362505
URL: https://svnweb.freebsd.org/changeset/base/362505

Log:
  MFOpenZFS: Add zio_ddt_free()+ddt_phys_decref() error handling
  
  The assumption in zio_ddt_free() is that ddt_phys_select() must
  always find a match.  However, if that fails due to a damaged
  DDT or some other reason the code will NULL dereference in
  ddt_phys_decref().
  
  While this should never happen it has been observed on various
  platforms.  The result is that unless your willing to patch the
  ZFS code the pool is inaccessible.  Therefore, we're choosing
  to more gracefully handle this case rather than leave it fatal.
  
  http://mail.opensolaris.org/pipermail/zfs-discuss/2012-February/050972.html
  
  https://github.com/openzfs/zfs/commit/5dc6af0eec29b119b731c793037fd77214fc9438
  
  Reported by:  Pierre Beyssac
  Obtained from:OpenZFS
  MFC after:2 weeks
  Sponsored by: Klara Inc.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c   Mon Jun 22 
17:57:49 2020(r362504)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c   Mon Jun 22 
19:03:02 2020(r362505)
@@ -325,8 +325,10 @@ ddt_phys_addref(ddt_phys_t *ddp)
 void
 ddt_phys_decref(ddt_phys_t *ddp)
 {
-   ASSERT((int64_t)ddp->ddp_refcnt > 0);
-   ddp->ddp_refcnt--;
+   if (ddp) {
+   ASSERT((int64_t)ddp->ddp_refcnt > 0);
+   ddp->ddp_refcnt--;
+   }
 }
 
 void

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 22 
17:57:49 2020(r362504)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Mon Jun 22 
19:03:02 2020(r362505)
@@ -2937,8 +2937,11 @@ zio_ddt_free(zio_t *zio)
 
ddt_enter(ddt);
freedde = dde = ddt_lookup(ddt, bp, B_TRUE);
-   ddp = ddt_phys_select(dde, bp);
-   ddt_phys_decref(ddp);
+   if (dde) {
+   ddp = ddt_phys_select(dde, bp);
+   if (ddp)
+   ddt_phys_decref(ddp);
+   }
ddt_exit(ddt);
 
return (zio);
___
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: r362412 - head/sbin/md5

2020-06-19 Thread Allan Jude
Author: allanjude
Date: Fri Jun 19 19:16:25 2020
New Revision: 362412
URL: https://svnweb.freebsd.org/changeset/base/362412

Log:
  md5(1): fix -c flag to work with input on stdin
  
  Previously, the -p and -c flags were ignored when reading from stdin
  Additionally, -s and -c can be used together now.
  
  PR:   247295
  Reviewed by:  kevans
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D25362

Modified:
  head/sbin/md5/md5.c

Modified: head/sbin/md5/md5.c
==
--- head/sbin/md5/md5.c Fri Jun 19 18:54:55 2020(r362411)
+++ head/sbin/md5/md5.c Fri Jun 19 19:16:25 2020(r362412)
@@ -52,11 +52,14 @@ __FBSDID("$FreeBSD$");
 #define TEST_BLOCK_COUNT 10
 #define MDTESTCOUNT 8
 
+static int pflag;
 static int qflag;
 static int rflag;
 static int sflag;
+static int skip;
 static char* checkAgainst;
 static int checksFailed;
+static int failed;
 
 typedef void (DIGEST_Init)(void *);
 typedef void (DIGEST_Update)(void *, const unsigned char *, size_t);
@@ -86,10 +89,10 @@ typedef struct Algorithm_t {
 } Algorithm_t;
 
 static void MD5_Update(MD5_CTX *, const unsigned char *, size_t);
-static void MDString(const Algorithm_t *, const char *);
+static void MDOutput(const Algorithm_t *, char *, char **);
 static void MDTimeTrial(const Algorithm_t *);
 static void MDTestSuite(const Algorithm_t *);
-static void MDFilter(const Algorithm_t *, int);
+static char *MDFilter(const Algorithm_t *, char*, int);
 static void usage(const Algorithm_t *);
 
 typedef union {
@@ -170,9 +173,9 @@ main(int argc, char *argv[])
cap_rights_trights;
 #endif
int ch, fd;
-   char   *p;
+   char   *p, *string;
charbuf[HEX_DIGEST_LENGTH];
-   int failed;
+   size_t  len;
unsigneddigest;
const char* progname;
 
@@ -191,13 +194,14 @@ main(int argc, char *argv[])
failed = 0;
checkAgainst = NULL;
checksFailed = 0;
+   skip = 0;
while ((ch = getopt(argc, argv, "c:pqrs:tx")) != -1)
switch (ch) {
case 'c':
checkAgainst = optarg;
break;
case 'p':
-   MDFilter([digest], 1);
+   pflag = 1;
break;
case 'q':
qflag = 1;
@@ -207,13 +211,15 @@ main(int argc, char *argv[])
break;
case 's':
sflag = 1;
-   MDString([digest], optarg);
+   string = optarg;
break;
case 't':
MDTimeTrial([digest]);
+   skip = 1;
break;
case 'x':
MDTestSuite([digest]);
+   skip = 1;
break;
default:
usage([digest]);
@@ -249,32 +255,19 @@ main(int argc, char *argv[])
}
p = Algorithm[digest].Fd(fd, buf);
(void)close(fd);
-   if (p == NULL) {
-   warn("%s", *argv);
-   failed++;
-   } else {
-   if (qflag)
-   printf("%s", p);
-   else if (rflag)
-   printf("%s %s", p, *argv);
-   else
-   printf("%s (%s) = %s",
-   Algorithm[digest].name, *argv, p);
-   if (checkAgainst && strcasecmp(checkAgainst, p) 
!= 0)
-   {
-   checksFailed++;
-   if (!qflag)
-   printf(" [ Failed ]");
-   }
-   printf("\n");
-   }
+   MDOutput([digest], p, argv);
} while (*++argv);
-   } else if (!sflag && (optind == 1 || qflag || rflag)) {
+   } else if (!sflag && !skip) {
 #ifdef HAVE_CAPSICUM
if (caph_limit_stdin() < 0 || caph_enter() < 0)
err(1, "capsicum");
 #endif
-   MDFilter([digest], 0);
+   p = MDFilter([digest], (char *), pflag);
+   MDOutput([digest], p, NULL);
+   } else if (sflag) {
+   len = strlen(string);
+   p = Algorithm[digest].Data(string, len, buf);
+   MDOutput([digest], p, );
}
 
if (failed != 0)
@@ -284,30 +277,38 @@ main(int argc, char *argv[])
 
   

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

2020-06-19 Thread Allan Jude
Author: allanjude
Date: Fri Jun 19 17:59:55 2020
New Revision: 362396
URL: https://svnweb.freebsd.org/changeset/base/362396

Log:
  ZFS: Allow setting checksum=skein on boot pools
  
  PR:   245889
  Reported by:  delphij
  Sponsored by: Klara Inc.

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 19 17:56:05 2020
(r362395)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Jun 19 17:59:55 2020
(r362396)
@@ -1001,9 +1001,9 @@ for more information on these algorithms.
 .Pp
 Changing this property affects only newly-written data.
 .Pp
-Salted checksum algorithms
-.Pq Cm edonr , skein
-are currently not supported for any filesystem on the boot pools.
+The salted checksum algorithm
+.Pq Cm edonr
+is currently not supported on FreeBSD.
 .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle 
| Cm lz4
 Controls the compression algorithm used for this dataset.
 Setting compression to

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Fri Jun 19 
17:56:05 2020(r362395)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7Fri Jun 19 
17:59:55 2020(r362396)
@@ -632,6 +632,9 @@ and will return to being
 once all filesystems that have ever had their checksum set to
 .Sy skein
 are destroyed.
+Booting off of pools using
+.Sy skein
+is supported.
 .It Sy allocation_classes
 .Bl -column "READ\-ONLY COMPATIBLE" "com.intel:allocation_classes"
 .It GUID Ta com.intel:allocation_classes

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 
19 17:56:05 2020(r362395)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 
19 17:59:55 2020(r362396)
@@ -4373,16 +4373,7 @@ zfs_check_settable(const char *dsname, nvpair_t *pair,
 
if ((err = spa_open(dsname, , FTAG)) != 0)
return (err);
-   /*
-* Salted checksums are not supported on root pools.
-*/
-   if (spa_bootfs(spa) != 0 &&
-   intval < ZIO_CHECKSUM_FUNCTIONS &&
-   (zio_checksum_table[intval].ci_flags &
-   ZCHECKSUM_FLAG_SALTED)) {
-   spa_close(spa, FTAG);
-   return (SET_ERROR(ERANGE));
-   }
+
if (!spa_feature_is_enabled(spa, feature)) {
spa_close(spa, FTAG);
return (SET_ERROR(ENOTSUP));
___
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: r361870 - in head/sys/geom: . label

2020-06-06 Thread Allan Jude
On 2020-06-06 10:55, Shawn Webb wrote:
> On Sat, Jun 06, 2020 at 02:19:16PM +, Conrad Meyer wrote:
>> Author: cem
>> Date: Sat Jun  6 14:19:16 2020
>> New Revision: 361870
>> URL: https://svnweb.freebsd.org/changeset/base/361870
>>
>> Log:
>>   Revert r361838
> 
> Why?
> 

https://lists.freebsd.org/pipermail/freebsd-current/2020-June/076210.html


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r360230 - head/usr.sbin/trim

2020-04-23 Thread Allan Jude
Author: allanjude
Date: Thu Apr 23 20:14:59 2020
New Revision: 360230
URL: https://svnweb.freebsd.org/changeset/base/360230

Log:
  trim(8): candelete() returns wrong results because fd is opened O_WRONLY
  
  This was discovered while using trim(8) to test bhyve trim
  
  Reviewed by:  asomers
  Differential Revision:https://reviews.freebsd.org/D24371

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

Modified: head/usr.sbin/trim/trim.c
==
--- head/usr.sbin/trim/trim.c   Thu Apr 23 19:20:58 2020(r360229)
+++ head/usr.sbin/trim/trim.c   Thu Apr 23 20:14:59 2020(r360230)
@@ -220,7 +220,7 @@ trim(const char *path, off_t offset, off_t length, boo
return (0);
}
 
-   fd = opendev(path, O_WRONLY | O_DIRECT);
+   fd = opendev(path, O_RDWR | O_DIRECT);
arg[0] = offset;
arg[1] = length;
 
___
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: r360229 - head/usr.sbin/bhyve

2020-04-23 Thread Allan Jude
Author: allanjude
Date: Thu Apr 23 19:20:58 2020
New Revision: 360229
URL: https://svnweb.freebsd.org/changeset/base/360229

Log:
  Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend
  
  This will advertise support for TRIM to the guest virtio-blk driver and
  perform the DIOCGDELETE ioctl on the backing storage if it supports it.
  
  Thanks to Jason King and others at Joyent and illumos for expanding on
  my original patch, adding improvements including better error handling
  and making sure to following the virtio spec.
  
  Submitted by: Jason King  (improvements)
  Reviewed by:  jhb
  Obtained from:illumos-joyent (improvements)
  MFC after:1 month
  Relnotes: yes
  Sponsored by: Klara Inc.
  Differential Revision:https://reviews.freebsd.org/D21707

Modified:
  head/usr.sbin/bhyve/block_if.c
  head/usr.sbin/bhyve/pci_virtio_block.c

Modified: head/usr.sbin/bhyve/block_if.c
==
--- head/usr.sbin/bhyve/block_if.c  Thu Apr 23 19:16:20 2020
(r360228)
+++ head/usr.sbin/bhyve/block_if.c  Thu Apr 23 19:20:58 2020
(r360229)
@@ -3,6 +3,7 @@
  *
  * Copyright (c) 2013  Peter Grehan 
  * All rights reserved.
+ * Copyright 2020 Joyent, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -410,6 +411,8 @@ blockif_open(const char *optstr, const char *ident)
off_t size, psectsz, psectoff;
int extra, fd, i, sectsz;
int nocache, sync, ro, candelete, geom, ssopt, pssopt;
+   int nodelete;
+
 #ifndef WITHOUT_CAPSICUM
cap_rights_t rights;
cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE };
@@ -422,6 +425,7 @@ blockif_open(const char *optstr, const char *ident)
nocache = 0;
sync = 0;
ro = 0;
+   nodelete = 0;
 
/*
 * The first element in the optstring is always a pathname.
@@ -434,6 +438,8 @@ blockif_open(const char *optstr, const char *ident)
continue;
else if (!strcmp(cp, "nocache"))
nocache = 1;
+   else if (!strcmp(cp, "nodelete"))
+   nodelete = 1;
else if (!strcmp(cp, "sync") || !strcmp(cp, "direct"))
sync = 1;
else if (!strcmp(cp, "ro"))
@@ -500,7 +506,7 @@ blockif_open(const char *optstr, const char *ident)
ioctl(fd, DIOCGSTRIPEOFFSET, );
strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name));
arg.len = sizeof(arg.value.i);
-   if (ioctl(fd, DIOCGATTR, ) == 0)
+   if (nodelete == 0 && ioctl(fd, DIOCGATTR, ) == 0)
candelete = arg.value.i;
if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0)
geom = 1;

Modified: head/usr.sbin/bhyve/pci_virtio_block.c
==
--- head/usr.sbin/bhyve/pci_virtio_block.c  Thu Apr 23 19:16:20 2020
(r360228)
+++ head/usr.sbin/bhyve/pci_virtio_block.c  Thu Apr 23 19:20:58 2020
(r360229)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2011 NetApp, Inc.
  * All rights reserved.
- * Copyright (c) 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -57,26 +57,37 @@ __FBSDID("$FreeBSD$");
 #include "virtio.h"
 #include "block_if.h"
 
-#define VTBLK_RINGSZ   128
+#defineVTBLK_BSIZE 512
+#defineVTBLK_RINGSZ128
 
 _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each ring entry must be able 
to queue a request");
 
-#define VTBLK_S_OK 0
-#define VTBLK_S_IOERR  1
+#defineVTBLK_S_OK  0
+#defineVTBLK_S_IOERR   1
 #defineVTBLK_S_UNSUPP  2
 
 #defineVTBLK_BLK_ID_BYTES  20 + 1
 
 /* Capability bits */
-#defineVTBLK_F_SEG_MAX (1 << 2)/* Maximum request 
segments */
-#defineVTBLK_F_BLK_SIZE(1 << 6)/* cfg block size valid 
*/
-#defineVTBLK_F_FLUSH   (1 << 9)/* Cache flush support 
*/
-#defineVTBLK_F_TOPOLOGY(1 << 10)   /* Optimal I/O 
alignment */
+#defineVTBLK_F_BARRIER (1 << 0)/* Does host support 
barriers? */
+#defineVTBLK_F_SIZE_MAX(1 << 1)/* Indicates maximum 
segment size */
+#defineVTBLK_F_SEG_MAX (1 << 2)/* Indicates maximum # 
of segments */
+#defineVTBLK_F_GEOMETRY(1 << 4)/* Legacy geometry 
available  */
+#defineVTBLK_F_RO  (1 << 5)/* Disk is read-only */
+#defineVTBLK_F_BLK_SIZE(1 << 6)/* Block size of disk 
is available*/
+#defineVTBLK_F_SCSI

Re: svn commit: r353057 - head/sys/net

2019-10-06 Thread Allan Jude
On 2019-10-04 08:57, Kyle Evans wrote:
> On Thu, Oct 3, 2019 at 12:54 PM Kyle Evans  wrote:
>>
>> Author: kevans
>> Date: Thu Oct  3 17:54:00 2019
>> New Revision: 353057
>> URL: https://svnweb.freebsd.org/changeset/base/353057
>>
>> Log:
>>   if_tuntap: create /dev aliases when a tuntap device gets renamed
>>
>>   Currently, if you do:
>>
>>   $ ifconfig tun0 create
>>   $ ifconfig tun0 name wg0
>>   $ ls -l /dev | egrep 'wg|tun'
>>
>>   You will see tun0, but no wg0. In fact, it's slightly more annoying to make
>>   the association between the new name and the old name in order to open the
>>   device (if it hadn't been opened during the rename).
>>
>>   Register an eventhandler for ifnet_arrival_events and catch interface
>>   renames. We can determine if the ifnet is a tun easily enough from the
>>   if_dname, which matches the cevsw.d_name from the associated tuntap_driver.
>>
>>   Some locking dance is required because renames don't require the device to
>>   be opened, so it could go away in the middle of handling the ioctl, but as
>>   soon as we've verified this isn't the case we can attempt to busy the tun
>>   and either bail out if the tun device is dying, or we can proceed with the
>>   rename.
>>
>>   We only create these aliases on a best-effort basis. Renaming a tun device
>>   to "usbctl", which doesn't exist as an ifnet but does as a /dev, is clearly
>>   not that disastrous, but we can't and won't create a /dev for that.
>>
> 
> It's been brought to my attention that I actually had a PR that I took
> six months ago that this should've belonged to.
> 
> PR: 219746
> 

Thanks for this, I was having similar problems with this trying to use
wireguard inside a VNET jail, so it was even harder to find and destroy
the correct interface.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r352504 - head/sys/vm

2019-09-19 Thread Allan Jude
Author: allanjude
Date: Thu Sep 19 07:28:24 2019
New Revision: 352504
URL: https://svnweb.freebsd.org/changeset/base/352504

Log:
  sys/vm/vm_glue.c: Incorrect function name in panic string
  
  Use __func__ to avoid this issue in the future.
  
  Submitted by: Wuyang Chung 
  Reviewed by:  markj, emaste
  Obtained from:https://github.com/freebsd/freebsd/pull/410

Modified:
  head/sys/vm/vm_glue.c

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Wed Sep 18 23:33:38 2019(r352503)
+++ head/sys/vm/vm_glue.c   Thu Sep 19 07:28:24 2019(r352504)
@@ -320,7 +320,7 @@ vm_thread_stack_create(struct domainset *ds, vm_object
ks = kva_alloc((pages + KSTACK_GUARD_PAGES) * PAGE_SIZE);
 #endif
if (ks == 0) {
-   printf("vm_thread_new: kstack allocation failed\n");
+   printf("%s: kstack allocation failed\n", __func__);
vm_object_deallocate(ksobj);
return (0);
}
@@ -362,7 +362,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t
for (i = 0; i < pages; i++) {
m = vm_page_lookup(ksobj, i);
if (m == NULL)
-   panic("vm_thread_dispose: kstack already missing?");
+   panic("%s: kstack already missing?", __func__);
vm_page_unwire_noq(m);
vm_page_free(m);
}
___
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: r351812 - head/usr.sbin/mpsutil

2019-09-04 Thread Allan Jude
On 2019-09-04 09:50, Alan Somers wrote:
> On Wed, Sep 4, 2019 at 7:47 AM Andriy Gapon  <mailto:a...@freebsd.org>> wrote:
> 
> Author: avg
> Date: Wed Sep  4 13:47:38 2019
> New Revision: 351812
> URL: https://svnweb.freebsd.org/changeset/base/351812
> 
> Log:
>   mpsutil slot set status
> 
>   This code has been written as a proof of concept, but I think that it
>   can be useful in general.  It allows to set the status of an enclosure
>   slot.  Practically, this means controlling whatever slot status
> LEDs the
>   enclosure provides.  At present, the new command does not have sanity
>   checks or any conveniences.  That means that it is possible to
> issue the
>   command for an invalid slot and an enclosure.  But the worst I
> have seen
>   happening is either the command failing or simply being ignored. 
> Also,
>   at the moment, the status has to be specified as a numeric bit mask.
>   The bit definitions can be found in sys/dev/mps/mpi/mpi2_init.h, they
>   are prefixed with MPI2_SEP_REQ_SLOTSTATUS_.  The only way to address a
>   slot is by the enclosure handle and the slot number.  Both are readily
>   available from mpsutil show commands.
> 
>   So, future enhancements could include alternative ways to address
> a slot
>   (e.g., by a disk handle or a disk device name) and human friendly
> names
>   for slot statuses.
> 
>   The new command is useful alternative to 'sas2ircu locate' command.
>   First, sas2ircu is a proprietary blob.  Second, it supports
> setting only
>   locate / identify status bit.
> 
>   Tested on HP H220 running LSI IT firmware 20.x.
> 
>   Reviewed by:  bapt
>   MFC after:    3 weeks
>   Differential Revision:        https://reviews.freebsd.org/D20535
> 
> Added:
>   head/usr.sbin/mpsutil/mps_slot.c   (contents, props changed)
> Modified:
>   head/usr.sbin/mpsutil/Makefile
>   head/usr.sbin/mpsutil/mps_cmd.c
>   head/usr.sbin/mpsutil/mpsutil.h
> 
> 
> Is this redundant with sesutil, or does it work on different kinds of
> enclosures? 

mpsutil's method will work on direct-attach backplanes and enclosures,
where sesutil only works if there is an expander that provides the SES
service.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r345491 - in head/sys: conf fs/tmpfs modules/tmpfs

2019-09-03 Thread Allan Jude
On 2019-03-25 15:17, Cy Schubert wrote:
> In message <3398a21318a4a6715609004d569d20de86f1dc7a.ca...@freebsd.org>
> , Ian Le
> pore writes:
>> On Mon, 2019-03-25 at 05:42 -0700, Cy Schubert wrote:
>>> In message <201903250746.x2p7kkuu019...@repo.freebsd.org>, Allan
>>> Jude 
>>> writes:
>>>> Author: allanjude
>>>> Date: Mon Mar 25 07:46:20 2019
>>>> New Revision: 345491
>>>> URL: https://svnweb.freebsd.org/changeset/base/345491
>>>>
>>>> Log:
>>>>   Make TMPFS_PAGES_MINRESERVED a kernel option
>>>>   
>>>>   TMPFS_PAGES_MINRESERVED controls how much memory is reserved for
>>>> the system
>>>>   and not used by tmpfs.
>>>>   
>>>>   On very small memory systems, the default value may be too high
>>>> and this
>>>>   prevents these small memory systems from using reroot, which is
>>>> required
>>>>   for them to install firmware updates.
>>>>   
>>>>   Submitted by:Hiroki Mori 
>>>>   Reviewed by: mizhka
>>>>   Differential Revision:   https://reviews.freebsd.org/D13583
>>>>
>>>> Modified:
>>>>   head/sys/conf/options
>>>>   head/sys/fs/tmpfs/tmpfs.h
>>>>   head/sys/fs/tmpfs/tmpfs_vfsops.c
>>>>   head/sys/modules/tmpfs/Makefile
>>>>
>>>
>>> Would this be a good candidate for a sysctl or tuneable?
>>>
>>
>> The small-memory embedded systems most affected by this often don't use
>> loader(8) at all, so tunables aren't an option, and sysctl may be too
>> late.  No reason it can't be a tunable as well, but it'll probably need
>> to remain as a compile-time option too.
> 
> Yes, I should have been more clear. I can see using a tuneable on a 2 
> GB or 4 GB Intel pandaboard. (Perfect for a firewall or a UPS 
> management station.)
> 
> 

The default value is 4MB. For any system with more than 32mb of memory,
it shouldn't require tuning, although you may wish to prevent tmpfs from
using all but 4mb of your memory.

I think the only case where you definitely need to override the default,
is when you have so little memory that you can't create a tmpfs image of
your root filesystem to reroot into, as is the case on many tiny router
boards, with 8-32mb of ram, and 4-16mb of flash.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r349235 - head/usr.bin/top

2019-06-20 Thread Allan Jude
Author: allanjude
Date: Thu Jun 20 15:44:43 2019
New Revision: 349235
URL: https://svnweb.freebsd.org/changeset/base/349235

Log:
  top(1): Don't show the swap line when there are no swap devices
  
  Submitted by: antran...@freebsd.am
  Reviewed by:  bapt
  MFC after:1 month
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D18928

Modified:
  head/usr.bin/top/display.c
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/display.c
==
--- head/usr.bin/top/display.c  Thu Jun 20 14:40:36 2019(r349234)
+++ head/usr.bin/top/display.c  Thu Jun 20 15:44:43 2019(r349235)
@@ -675,6 +675,9 @@ i_swap(int *stats)
 {
 swap_buffer = setup_buffer(swap_buffer, 0);
 
+if (swap_names == NULL)
+   return;
+
 fputs("\nSwap: ", stdout);
 lastline++;
 
@@ -689,6 +692,9 @@ u_swap(int *stats)
 static char *new = NULL;
 
 new = setup_buffer(new, 0);
+
+if (swap_names == NULL)
+   return;
 
 /* format the new line */
 summary_format(new, stats, swap_names);

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Thu Jun 20 14:40:36 2019(r349234)
+++ head/usr.bin/top/machine.c  Thu Jun 20 15:44:43 2019(r349235)
@@ -150,6 +150,7 @@ static const char *swapnames[] = {
 };
 static int swap_stats[nitems(swapnames)];
 
+static int has_swap;
 
 /* these are for keeping track of the proc array */
 
@@ -248,12 +249,12 @@ update_layout(void)
y_mem = 3;
y_arc = 4;
y_carc = 5;
-   y_swap = 4 + arc_enabled + carc_enabled;
-   y_idlecursor = 5 + arc_enabled + carc_enabled;
-   y_message = 5 + arc_enabled + carc_enabled;
-   y_header = 6 + arc_enabled + carc_enabled;
-   y_procs = 7 + arc_enabled + carc_enabled;
-   Header_lines = 7 + arc_enabled + carc_enabled;
+   y_swap = 3 + arc_enabled + carc_enabled + has_swap;
+   y_idlecursor = 4 + arc_enabled + carc_enabled + has_swap;
+   y_message = 4 + arc_enabled + carc_enabled + has_swap;
+   y_header = 5 + arc_enabled + carc_enabled + has_swap;
+   y_procs = 6 + arc_enabled + carc_enabled + has_swap;
+   Header_lines = 6 + arc_enabled + carc_enabled + has_swap;
 
if (pcpu_stats) {
y_mem += ncpus - 1;
@@ -273,7 +274,7 @@ machine_init(struct statics *statics)
 {
int i, j, empty, pagesize;
uint64_t arc_size;
-   int carc_en;
+   int carc_en, nswapdev;
size_t size;
 
size = sizeof(smpmode);
@@ -298,6 +299,11 @@ machine_init(struct statics *statics)
if (kd == NULL)
return (-1);
 
+   size = sizeof(nswapdev);
+   if (sysctlbyname("vm.nswapdev", , , NULL,
+   0) == 0 && nswapdev != 0)
+   has_swap = 1;
+
GETSYSCTL("kern.ccpu", ccpu);
 
/* this is used in calculating WCPU -- calculate it ahead of time */
@@ -332,7 +338,10 @@ machine_init(struct statics *statics)
statics->carc_names = carcnames;
else
statics->carc_names = NULL;
-   statics->swap_names = swapnames;
+   if (has_swap)
+   statics->swap_names = swapnames;
+   else
+   statics->swap_names = NULL;
statics->order_names = ordernames;
 
/* Allocate state for per-CPU stats. */
___
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: r348714 - head/cddl/contrib/opensolaris/cmd/zpool

2019-06-05 Thread Allan Jude
Author: allanjude
Date: Thu Jun  6 01:32:00 2019
New Revision: 348714
URL: https://svnweb.freebsd.org/changeset/base/348714

Log:
  zpool.8: the comment property is not read-only
  
  The comment property was listed in the man page twice, once under the list
  of read-only properties, and again (correctly), under the list of user
  editable properties.
  
  PR:   238355
  Reported by:  Michael Zuo 
  Sponsored by: Klara Systems

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun  6 01:16:04 
2019(r348713)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Jun  6 01:32:00 
2019(r348714)
@@ -604,10 +604,6 @@ Amount of storage space within the pool that has been 
 .It Sy capacity
 Percentage of pool space used. This property can also be referred to by its
 shortened column name, "cap".
-.It Sy comment
-A text string consisting of printable ASCII characters that will be stored
-such that it is available even if the pool becomes faulted.  An administrator
-can provide additional information about a pool using this property.
 .It Sy dedupratio
 The deduplication ratio specified for a pool, expressed as a multiplier.
 For example, 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: r348699 - head/lib/libmd

2019-06-05 Thread Allan Jude
Author: allanjude
Date: Wed Jun  5 20:18:08 2019
New Revision: 348699
URL: https://svnweb.freebsd.org/changeset/base/348699

Log:
  sha.3: clarify admonition against use in NEW signature schemes
  
  Reported by:  cem, cperciva (grammar)

Modified:
  head/lib/libmd/sha.3

Modified: head/lib/libmd/sha.3
==
--- head/lib/libmd/sha.3Wed Jun  5 20:16:25 2019(r348698)
+++ head/lib/libmd/sha.3Wed Jun  5 20:18:08 2019(r348699)
@@ -195,7 +195,7 @@ The
 .Tn SHA1
 algorithm has been proven to be vulnerable to practical collision
 attacks and should not be relied upon to produce unique outputs,
-.Em nor should they be used as part of a cryptographic signature scheme.
+.Em nor should it be used as part of a new cryptographic signature scheme.
 .Pp
 The
 .Tn IA32
___
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: r348370 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-05-29 Thread Allan Jude
Author: allanjude
Date: Wed May 29 20:34:35 2019
New Revision: 348370
URL: https://svnweb.freebsd.org/changeset/base/348370

Log:
  Fix assertion in ZFS TRIM code
  
  Due to an attempt to check two conditions at once in a macro not designed
  as such, the assertion would always evaluate to true.
  
  #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
  const TYPE __left = (TYPE)(LEFT); \
  const TYPE __right = (TYPE)(RIGHT); \
  if (!(__left OP __right)) \
  assfail3(#LEFT " " #OP " " #RIGHT, \
  (uintmax_t)__left, #OP, (uintmax_t)__right, \
  __FILE__, __LINE__); \
  _NOTE(CONSTCOND) } while (0)
  #define ASSERT3U(x, y, z)   VERIFY3_IMPL(x, y, z, uint64_t)
  
  Mean that we compared:
  left = (type == ZIO_TYPE_FREE || psize)
  OP = "<="
  right = (SPA_MAXBLOCKSIZE)
  
  If the type was not FREE, 0 is less than SPA_MAXBLOCKSIZE (16MB)
  If the type is ZIO_TYPE_FREE, 1 is less than SPA_MAXBLOCKSIZE
  The constraint on psize (physical size of the FREE operation) is never
  checked against SPA_MAXBLOCKSIZE
  
  Reported by:  Ka Ho Ng 
  Reviewed by:  kevans
  MFC after:2 weeks
  Sponsored by: Klara Systems

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Wed May 29 
19:11:09 2019(r348369)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Wed May 29 
20:34:35 2019(r348370)
@@ -643,7 +643,7 @@ zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const
 {
zio_t *zio;
 
-   ASSERT3U(type == ZIO_TYPE_FREE || psize, <=, SPA_MAXBLOCKSIZE);
+   IMPLY(type != ZIO_TYPE_FREE, psize <= SPA_MAXBLOCKSIZE);
ASSERT(P2PHASE(psize, SPA_MINBLOCKSIZE) == 0);
ASSERT(P2PHASE(offset, SPA_MINBLOCKSIZE) == 0);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r348073 - head/lib/libmd

2019-05-22 Thread Allan Jude
On 2019-05-21 19:03, Rodney W. Grimes wrote:
>> Author: allanjude
>> Date: Tue May 21 22:17:00 2019
>> New Revision: 348073
>> URL: https://svnweb.freebsd.org/changeset/base/348073
>>
>> Log:
>>   Add admonitions against using MD5 and SHA1 to the API man pages
>>
>> Modified:
>>   head/lib/libmd/mdX.3
>>   head/lib/libmd/sha.3
>>
>> Modified: head/lib/libmd/mdX.3
>> ==
>> --- head/lib/libmd/mdX.3 Tue May 21 22:11:53 2019(r348072)
>> +++ head/lib/libmd/mdX.3 Tue May 21 22:17:00 2019(r348073)
>> @@ -208,6 +208,8 @@ This code is derived directly from these implementatio
>>  .Pp
>>  Phk ristede runen.
>>  .Sh BUGS
>> -No method is known to exist which finds two files having the same hash 
>> value,
>> -nor to find a file with a specific hash value.
>> -There is on the other hand no guarantee that such a method does not exist.
>> +The
>> +.Tn MD5
> 
> There needs to be a discussion about .Tn, some people are ripping
> them out of man pages, others are adding them.  mandoc is a semantic
> mark up language, .Tn gives the following word the semantic of being
> a Tradename.
> 
> Yes, I know, mandoc ignroes them BUTT other tools do not, mandoc is
> not the end all in what can process our man pages, groff/troff should
> still be able to produce photo typesetter output and the .Tn's look
> nice when you do that.
> 
> I would like to see that we stop removing them and infact, as this
> man page does, properly recognize trademarks/names in our man pages
> "as is often required by law."
> 
> Now, one final nit, I can neither verify nor deny that "MD5" is
> a tradename.
> 
>> +algorithm has been proven to be vulnerable to practical collision
>> +attacks and should not be relied upon to produce unique outputs,
>> +.Em nor should they be used as part of a cryptographic signature scheme.
>>
>> Modified: head/lib/libmd/sha.3
>> ==
>> --- head/lib/libmd/sha.3 Tue May 21 22:11:53 2019(r348072)
>> +++ head/lib/libmd/sha.3 Tue May 21 22:17:00 2019(r348073)
>> @@ -191,9 +191,11 @@ published
>>  .Tn FIPS
>>  standards.
>>  .Sh BUGS
>> -No method is known to exist which finds two files having the same hash 
>> value,
>> -nor to find a file with a specific hash value.
>> -There is on the other hand no guarantee that such a method does not exist.
>> +The
>> +.Tn SHA1
>> +algorithm has been proven to be vulnerable to practical collision
>> +attacks and should not be relied upon to produce unique outputs,
>> +.Em nor should they be used as part of a cryptographic signature scheme.
>>  .Pp
>>  The
>>  .Tn IA32
>>
>>
> 

I borrowed the message (with .Tn markup) from the md5(1) man page, and
just added it to the library reference man pages since they said 'No
method is known to exist which finds two files having the same hash
value' which has not been true in a while.

I did not spend any effort deciding which markup to use there, as I
don't think MD5 or SHA1 are tradenames, just acronyms.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r348073 - head/lib/libmd

2019-05-21 Thread Allan Jude
Author: allanjude
Date: Tue May 21 22:17:00 2019
New Revision: 348073
URL: https://svnweb.freebsd.org/changeset/base/348073

Log:
  Add admonitions against using MD5 and SHA1 to the API man pages

Modified:
  head/lib/libmd/mdX.3
  head/lib/libmd/sha.3

Modified: head/lib/libmd/mdX.3
==
--- head/lib/libmd/mdX.3Tue May 21 22:11:53 2019(r348072)
+++ head/lib/libmd/mdX.3Tue May 21 22:17:00 2019(r348073)
@@ -208,6 +208,8 @@ This code is derived directly from these implementatio
 .Pp
 Phk ristede runen.
 .Sh BUGS
-No method is known to exist which finds two files having the same hash value,
-nor to find a file with a specific hash value.
-There is on the other hand no guarantee that such a method does not exist.
+The
+.Tn MD5
+algorithm has been proven to be vulnerable to practical collision
+attacks and should not be relied upon to produce unique outputs,
+.Em nor should they be used as part of a cryptographic signature scheme.

Modified: head/lib/libmd/sha.3
==
--- head/lib/libmd/sha.3Tue May 21 22:11:53 2019(r348072)
+++ head/lib/libmd/sha.3Tue May 21 22:17:00 2019(r348073)
@@ -191,9 +191,11 @@ published
 .Tn FIPS
 standards.
 .Sh BUGS
-No method is known to exist which finds two files having the same hash value,
-nor to find a file with a specific hash value.
-There is on the other hand no guarantee that such a method does not exist.
+The
+.Tn SHA1
+algorithm has been proven to be vulnerable to practical collision
+attacks and should not be relied upon to produce unique outputs,
+.Em nor should they be used as part of a cryptographic signature scheme.
 .Pp
 The
 .Tn IA32
___
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: r348072 - head/lib/libmd

2019-05-21 Thread Allan Jude
Author: allanjude
Date: Tue May 21 22:11:53 2019
New Revision: 348072
URL: https://svnweb.freebsd.org/changeset/base/348072

Log:
  Add missing errors section to md[2-5], ripemd160, sha*, and skein* manpages
  
  PR:   148987
  Submitted by: Dan Lukes  (original version)
  MFC after:1 week
  Sponsored by: Klara Systems
  Event:Waterloo Hackathon 2019

Modified:
  head/lib/libmd/mdX.3
  head/lib/libmd/ripemd.3
  head/lib/libmd/sha.3
  head/lib/libmd/sha256.3
  head/lib/libmd/sha512.3
  head/lib/libmd/skein.3

Modified: head/lib/libmd/mdX.3
==
--- head/lib/libmd/mdX.3Tue May 21 21:39:03 2019(r348071)
+++ head/lib/libmd/mdX.3Tue May 21 22:11:53 2019(r348072)
@@ -8,7 +8,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 20, 2018
+.Dd May 21, 2019
 .Dt MDX 3
 .Os
 .Sh NAME
@@ -144,6 +144,26 @@ after use.
 If the
 .Fa buf
 argument is non-null it must point to at least 33 characters of buffer space.
+.Sh ERRORS
+The
+.Fn MDXEnd
+function called with a null buf argument may fail and return NULL if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
+.Pp
+The
+.Fn MDXFile
+and
+.Fn MDXFileChunk
+may return NULL when underlying 
+.Xr open 2 ,
+.Xr fstat 2 ,
+.Xr lseek 2 ,
+or
+.Xr MDXEnd 2
+fail.
 .Sh SEE ALSO
 .Xr md4 3 ,
 .Xr md5 3 ,

Modified: head/lib/libmd/ripemd.3
==
--- head/lib/libmd/ripemd.3 Tue May 21 21:39:03 2019(r348071)
+++ head/lib/libmd/ripemd.3 Tue May 21 22:11:53 2019(r348072)
@@ -124,6 +124,26 @@ after use.
 If the
 .Fa buf
 argument is non-null it must point to at least 41 characters of buffer space.
+.Sh ERRORS
+The
+.Fn RIPEMD160_End
+function called with a null buf argument may fail and return NULL if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
+.Pp
+The
+.Fn RIPEMD160_File
+and
+.Fn RIPEMD160_FileChunk
+may return NULL when underlying 
+.Xr open 2 ,
+.Xr fstat 2 ,
+.Xr lseek 2 ,
+or
+.Xr RIPEMD160_End 2
+fail.
 .Sh SEE ALSO
 .Xr md4 3 ,
 .Xr md5 3 ,

Modified: head/lib/libmd/sha.3
==
--- head/lib/libmd/sha.3Tue May 21 21:39:03 2019(r348071)
+++ head/lib/libmd/sha.3Tue May 21 22:11:53 2019(r348072)
@@ -9,7 +9,7 @@
 .\"From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp
 .\" $FreeBSD$
 .\"
-.Dd July 20, 2018
+.Dd May 21, 2019
 .Dt SHA 3
 .Os
 .Sh NAME
@@ -155,6 +155,26 @@ after use.
 If the
 .Fa buf
 argument is non-null it must point to at least 41 characters of buffer space.
+.Sh ERRORS
+The
+.Fn SHA1_End
+function called with a null buf argument may fail and return NULL if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
+.Pp
+The
+.Fn SHA1_File
+and
+.Fn SHA1_FileChunk
+may return NULL when underlying 
+.Xr open 2 ,
+.Xr fstat 2 ,
+.Xr lseek 2 ,
+or
+.Xr SHA1_End 2
+fail.
 .Sh SEE ALSO
 .Xr md4 3 ,
 .Xr md5 3 ,

Modified: head/lib/libmd/sha256.3
==
--- head/lib/libmd/sha256.3 Tue May 21 21:39:03 2019(r348071)
+++ head/lib/libmd/sha256.3 Tue May 21 22:11:53 2019(r348072)
@@ -146,6 +146,26 @@ argument is non-null it must point to at least 65 char
 .Pp
 SHA224 is identical SHA256, except it has slightly different initialization
 vectors, and is truncated to a shorter digest.
+.Sh ERRORS
+The
+.Fn SHA256_End
+function called with a null buf argument may fail and return NULL if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
+.Pp
+The
+.Fn SHA256_File
+and
+.Fn SHA256_FileChunk
+may return NULL when underlying 
+.Xr open 2 ,
+.Xr fstat 2 ,
+.Xr lseek 2 ,
+or
+.Xr SHA256_End 2
+fail.
 .Sh SEE ALSO
 .Xr md4 3 ,
 .Xr md5 3 ,

Modified: head/lib/libmd/sha512.3
==
--- head/lib/libmd/sha512.3 Tue May 21 21:39:03 2019(r348071)
+++ head/lib/libmd/sha512.3 Tue May 21 22:11:53 2019(r348072)
@@ -9,7 +9,7 @@
 .\"From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp
 .\" $FreeBSD$
 .\"
-.Dd July 20, 2018
+.Dd May 21, 2019
 .Dt SHA512 3
 .Os
 .Sh NAME
@@ -190,6 +190,26 @@ which converts the return value to a 65-character
 (including the terminating '\e0')
 .Tn ASCII
 string which represents the 256 bits in hexadecimal.
+.Sh ERRORS
+The
+.Fn SHA512_End
+function called with a null buf argument may fail and return NULL if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
+.Pp
+The
+.Fn SHA512_File
+and
+.Fn SHA512_FileChunk
+may return NULL when underlying 
+.Xr open 2 ,
+.Xr fstat 2 ,
+.Xr lseek 2 ,
+or
+.Xr SHA512_End 2
+fail.
 .Sh SEE ALSO
 .Xr md4 3 ,
 .Xr md5 3 ,

Modified: 

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

2019-05-21 Thread Allan Jude
Author: allanjude
Date: Tue May 21 21:39:03 2019
New Revision: 348071
URL: https://svnweb.freebsd.org/changeset/base/348071

Log:
  Fix typo in r348068

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c  Tue May 
21 21:35:37 2019(r348070)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c  Tue May 
21 21:39:03 2019(r348071)
@@ -366,7 +366,7 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags,
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RWTUN,
 _deadman_synctime_ms, 0,
 "Stalled ZFS I/O expiration time in milliseconds");
-SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RwTUN,
+SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RWTUN,
 _deadman_checktime_ms, 0,
 "Period of checks for stalled ZFS I/O in milliseconds");
 SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RWTUN,
___
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: r348068 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2019-05-21 Thread Allan Jude
Author: allanjude
Date: Tue May 21 21:26:18 2019
New Revision: 348068
URL: https://svnweb.freebsd.org/changeset/base/348068

Log:
  ZFS: Make deadman tunables no longer read-only
  
  This allows the user to enable, disable, and adjust the I/O deadman at
  runtime. This can be especially useful when a pool is backed by remote
  storage (such as iscsi, ggated, etc).
  
  PR:   221906
  Submitted by: Fabian Keil 
  Obtained from:ElectroBSD
  MFC after:1 week
  Sponsored by: Klara Systems
  Event:Waterloo Hackathon 2019

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c  Tue May 
21 21:26:14 2019(r348067)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c  Tue May 
21 21:26:18 2019(r348068)
@@ -363,13 +363,13 @@ SYSCTL_PROC(_vfs_zfs, OID_AUTO, debugflags,
 CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RWTUN, 0, sizeof(int),
 sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing.");
 
-SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN,
+SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RWTUN,
 _deadman_synctime_ms, 0,
 "Stalled ZFS I/O expiration time in milliseconds");
-SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN,
+SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RwTUN,
 _deadman_checktime_ms, 0,
 "Period of checks for stalled ZFS I/O in milliseconds");
-SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RWTUN,
 _deadman_enabled, 0, "Kernel panic on stalled ZFS I/O");
 SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN,
 _asize_inflation, 0, "Worst case inflation factor for single sector 
writes");
___
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: r348065 - head/sys/dev/acpica

2019-05-21 Thread Allan Jude
Author: allanjude
Date: Tue May 21 21:14:22 2019
New Revision: 348065
URL: https://svnweb.freebsd.org/changeset/base/348065

Log:
  Correct the way remaining battery life is calculated
  
  Previously, if a system had multiple batteries, the remaining life
  percentage was calculated as the average of each battery's percent
  remaining. This results in rather incorrect values when you consider the
  case of the Thinkpad X270 that has a small 3 cell internally battery, and
  a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%,
  but battery 1 is at 10%, you do not infact have 55% of your capacity
  remaining.
  
  The new method calculates the percentage based on remaining capacity
  out of total capacity, giving a much more accurate reading.
  
  PR:   229818
  Submitted by: Keegan Drake H.P. 
  MFC after:2 weeks
  Sponsored by: Klara Systems
  Event:Waterloo Hackathon 2019

Modified:
  head/sys/dev/acpica/acpi_battery.c

Modified: head/sys/dev/acpica/acpi_battery.c
==
--- head/sys/dev/acpica/acpi_battery.c  Tue May 21 20:38:48 2019
(r348064)
+++ head/sys/dev/acpica/acpi_battery.c  Tue May 21 21:14:22 2019
(r348065)
@@ -119,7 +119,7 @@ int
 acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo)
 {
 intbatt_stat, devcount, dev_idx, error, i;
-int total_cap, total_min, valid_rate, valid_units;
+int total_cap, total_lfcap, total_min, valid_rate, valid_units;
 devclass_t batt_dc;
 device_t batt_dev;
 struct acpi_bst *bst;
@@ -152,6 +152,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba
  */
 dev_idx = -1;
 batt_stat = valid_rate = valid_units = 0;
+total_cap = total_lfcap = 0;
 for (i = 0; i < devcount; i++) {
/* Default info for every battery is "not present". */
acpi_reset_battinfo([i]);
@@ -210,17 +211,23 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba
if (!acpi_battery_bif_valid(bif))
continue;
 
-   /* Calculate percent capacity remaining. */
-   bi[i].cap = (100 * bst[i].cap) / bif->lfcap;
-
/*
 * Some laptops report the "design-capacity" instead of the
 * "real-capacity" when the battery is fully charged.  That breaks
 * the above arithmetic as it needs to be 100% maximum.
 */
-   if (bi[i].cap > 100)
-   bi[i].cap = 100;
+   if (bst[i].cap > bif->lfcap)
+   bst[i].cap = bif->lfcap;
 
+   /* Calculate percent capacity remaining. */
+   bi[i].cap = (100 * bst[i].cap) / bif->lfcap;
+
+   /* If this battery is not present, don't use its capacity. */
+   if (bi[i].cap != -1) {
+   total_cap += bst[i].cap;
+   total_lfcap += bif->lfcap;
+   }
+
/*
 * On systems with more than one battery, they may get used
 * sequentially, thus bst.rate may only signify the one currently
@@ -241,7 +248,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba
 }
 
 /* Pass 2:  calculate capacity and remaining time for all batteries. */
-total_cap = total_min = 0;
+total_min = 0;
 for (i = 0; i < devcount; i++) {
/*
 * If any batteries are discharging, use the sum of the bst.rate
@@ -253,10 +260,6 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba
else
bi[i].min = 0;
total_min += bi[i].min;
-
-   /* If this battery is not present, don't use its capacity. */
-   if (bi[i].cap != -1)
-   total_cap += bi[i].cap;
 }
 
 /*
@@ -265,7 +268,7 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba
  */
 if (valid_units > 0) {
if (dev == NULL) {
-   battinfo->cap = total_cap / valid_units;
+   battinfo->cap = (total_cap * 100) / total_lfcap;
battinfo->min = total_min;
battinfo->state = batt_stat;
battinfo->rate = valid_rate;
___
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: r347953 - head/cddl/contrib/opensolaris/cmd/zfs

2019-05-18 Thread Allan Jude

On 5/18/19 8:37 AM, Alexey Dokuchaev wrote:

On Sat, May 18, 2019 at 12:27:22PM +, Allan Jude wrote:

New Revision: 347953
URL: https://svnweb.freebsd.org/changeset/base/347953

Log:
   MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first
   
   zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee
   
   zfs_main: fix `zfs userspace` squashing unresolved entries
   
...

@@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u
if (rv64 != lv64)
rc = (rv64 < lv64) ? 1 : -1;
} else {
-   (void) nvlist_lookup_string(lnvl, propname,
-   );
-   (void) nvlist_lookup_string(rnvl, propname,
-   );
+   if ((nvlist_lookup_string(lnvl, propname,
+   ) == ENOENT) ||
+   (nvlist_lookup_string(rnvl, propname,
+   ) == ENOENT)) {
+   goto compare_nums;
+   }


Another thing not to like about ZoL: their completely bogus code style
and formatting practices (look at those ") == ENOENT").  If they
are going to listen to us, can we at least try to convince them not to
break existing, much FreeBSD-like formatting?

./danfe



They have strict CI that enforces Solaris cstyle, as that is what the 
code base has always used. No commit is merged until it passes that, and 
many other tests.


--
Allan Jude
___
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: r347953 - head/cddl/contrib/opensolaris/cmd/zfs

2019-05-18 Thread Allan Jude
Author: allanjude
Date: Sat May 18 12:27:22 2019
New Revision: 347953
URL: https://svnweb.freebsd.org/changeset/base/347953

Log:
  MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first
  
  zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee
  
  zfs_main: fix `zfs userspace` squashing unresolved entries
  
  The `zfs userspace` squashes all entries with unresolved numeric
  values into a single output entry due to the comparsion always
  made by the string name which is empty in case of unresolved IDs.
  
  Fix this by falling to a numerical comparison when either one
  of string values is not found. This then compares any numerical
  values after all with a name resolved.
  
  Signed-off-by: Pavel Boldin 
  Signed-off-by: Brian Behlendorf 
  
  Reported by:  clusteradm
  Obtained from:ZFS-on-Linux
  MFC after:3 days

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cSat May 18 11:14:43 
2019(r347952)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cSat May 18 12:27:22 
2019(r347953)
@@ -2361,6 +2361,7 @@ us_compare(const void *larg, const void *rarg, void *u
case ZFS_PROP_NAME:
propname = "name";
if (numname) {
+compare_nums:
(void) nvlist_lookup_uint64(lnvl, propname,
);
(void) nvlist_lookup_uint64(rnvl, propname,
@@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u
if (rv64 != lv64)
rc = (rv64 < lv64) ? 1 : -1;
} else {
-   (void) nvlist_lookup_string(lnvl, propname,
-   );
-   (void) nvlist_lookup_string(rnvl, propname,
-   );
+   if ((nvlist_lookup_string(lnvl, propname,
+   ) == ENOENT) ||
+   (nvlist_lookup_string(rnvl, propname,
+   ) == ENOENT)) {
+   goto compare_nums;
+   }
rc = strcmp(lvstr, rvstr);
}
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: r345491 - in head/sys: conf fs/tmpfs modules/tmpfs

2019-03-28 Thread Allan Jude
On 2019-03-25 15:17, Cy Schubert wrote:
> In message <3398a21318a4a6715609004d569d20de86f1dc7a.ca...@freebsd.org>
> , Ian Le
> pore writes:
>> On Mon, 2019-03-25 at 05:42 -0700, Cy Schubert wrote:
>>> In message <201903250746.x2p7kkuu019...@repo.freebsd.org>, Allan
>>> Jude 
>>> writes:
>>>> Author: allanjude
>>>> Date: Mon Mar 25 07:46:20 2019
>>>> New Revision: 345491
>>>> URL: https://svnweb.freebsd.org/changeset/base/345491
>>>>
>>>> Log:
>>>>   Make TMPFS_PAGES_MINRESERVED a kernel option
>>>>   
>>>>   TMPFS_PAGES_MINRESERVED controls how much memory is reserved for
>>>> the system
>>>>   and not used by tmpfs.
>>>>   
>>>>   On very small memory systems, the default value may be too high
>>>> and this
>>>>   prevents these small memory systems from using reroot, which is
>>>> required
>>>>   for them to install firmware updates.
>>>>   
>>>>   Submitted by:Hiroki Mori 
>>>>   Reviewed by: mizhka
>>>>   Differential Revision:   https://reviews.freebsd.org/D13583
>>>>
>>>> Modified:
>>>>   head/sys/conf/options
>>>>   head/sys/fs/tmpfs/tmpfs.h
>>>>   head/sys/fs/tmpfs/tmpfs_vfsops.c
>>>>   head/sys/modules/tmpfs/Makefile
>>>>
>>>
>>> Would this be a good candidate for a sysctl or tuneable?
>>>
>>
>> The small-memory embedded systems most affected by this often don't use
>> loader(8) at all, so tunables aren't an option, and sysctl may be too
>> late.  No reason it can't be a tunable as well, but it'll probably need
>> to remain as a compile-time option too.
> 
> Yes, I should have been more clear. I can see using a tuneable on a 2 
> GB or 4 GB Intel pandaboard. (Perfect for a firewall or a UPS 
> management station.)
> 
> 

The default value is 4MB. For any system with more than 32mb of memory,
it shouldn't require tuning, although you may wish to prevent tmpfs from
using all but 4mb of your memory.

I think the only case where you definitely need to override the default,
is when you have so little memory that you can't create a tmpfs image of
your root filesystem to reroot into, as is the case on many tiny router
boards, with 8-32mb of ram, and 4-16mb of flash.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r345491 - in head/sys: conf fs/tmpfs modules/tmpfs

2019-03-25 Thread Allan Jude
Author: allanjude
Date: Mon Mar 25 07:46:20 2019
New Revision: 345491
URL: https://svnweb.freebsd.org/changeset/base/345491

Log:
  Make TMPFS_PAGES_MINRESERVED a kernel option
  
  TMPFS_PAGES_MINRESERVED controls how much memory is reserved for the system
  and not used by tmpfs.
  
  On very small memory systems, the default value may be too high and this
  prevents these small memory systems from using reroot, which is required
  for them to install firmware updates.
  
  Submitted by: Hiroki Mori 
  Reviewed by:  mizhka
  Differential Revision:https://reviews.freebsd.org/D13583

Modified:
  head/sys/conf/options
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_vfsops.c
  head/sys/modules/tmpfs/Makefile

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Mon Mar 25 01:18:26 2019(r345490)
+++ head/sys/conf/options   Mon Mar 25 07:46:20 2019(r345491)
@@ -640,6 +640,9 @@ NFS_MINDIRATTRTIMO  opt_nfs.h
 NFS_MAXDIRATTRTIMO opt_nfs.h
 NFS_DEBUG  opt_nfs.h
 
+# TMPFS options
+TMPFS_PAGES_MINRESERVEDopt_tmpfs.h
+
 # For the Bt848/Bt848A/Bt849/Bt878/Bt879 driver
 OVERRIDE_CARD  opt_bktr.h
 OVERRIDE_TUNER opt_bktr.h

Modified: head/sys/fs/tmpfs/tmpfs.h
==
--- head/sys/fs/tmpfs/tmpfs.h   Mon Mar 25 01:18:26 2019(r345490)
+++ head/sys/fs/tmpfs/tmpfs.h   Mon Mar 25 07:46:20 2019(r345491)
@@ -487,7 +487,9 @@ struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node 
  * Amount of memory pages to reserve for the system (e.g., to not use by
  * tmpfs).
  */
+#if !defined(TMPFS_PAGES_MINRESERVED)
 #define TMPFS_PAGES_MINRESERVED(4 * 1024 * 1024 / PAGE_SIZE)
+#endif
 
 size_t tmpfs_mem_avail(void);
 

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cMon Mar 25 01:18:26 2019
(r345490)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cMon Mar 25 07:46:20 2019
(r345491)
@@ -42,6 +42,9 @@
  * memory-specific data structures and algorithms to automatically
  * allocate and release resources.
  */
+
+#include "opt_tmpfs.h"
+
 #include 
 __FBSDID("$FreeBSD$");
 

Modified: head/sys/modules/tmpfs/Makefile
==
--- head/sys/modules/tmpfs/Makefile Mon Mar 25 01:18:26 2019
(r345490)
+++ head/sys/modules/tmpfs/Makefile Mon Mar 25 07:46:20 2019
(r345491)
@@ -4,6 +4,6 @@
 
 KMOD=  tmpfs
 SRCS=  vnode_if.h \
-   tmpfs_vnops.c tmpfs_fifoops.c tmpfs_vfsops.c tmpfs_subr.c
+   tmpfs_vnops.c tmpfs_fifoops.c tmpfs_vfsops.c tmpfs_subr.c opt_tmpfs.h
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r345492 - head/sys/mips/atheros

2019-03-25 Thread Allan Jude
Author: allanjude
Date: Mon Mar 25 07:48:52 2019
New Revision: 345492
URL: https://svnweb.freebsd.org/changeset/base/345492

Log:
  The Atheros AR7241 has 20 GPIO pins
  
  AR724X_GPIO_PINS used for this family is defined as 18
  The datasheet for the AR7241 describes 20 pins, allow all to be used.
  
  Submitted by: Hiroki Mori 
  Reviewed by:  mizhka
  Differential Revision:https://reviews.freebsd.org/D17580

Modified:
  head/sys/mips/atheros/ar71xx_gpio.c
  head/sys/mips/atheros/ar71xx_gpiovar.h

Modified: head/sys/mips/atheros/ar71xx_gpio.c
==
--- head/sys/mips/atheros/ar71xx_gpio.c Mon Mar 25 07:46:20 2019
(r345491)
+++ head/sys/mips/atheros/ar71xx_gpio.c Mon Mar 25 07:48:52 2019
(r345492)
@@ -226,9 +226,11 @@ ar71xx_gpio_pin_max(device_t dev, int *maxpin)
*maxpin = AR91XX_GPIO_PINS - 1;
break;
case AR71XX_SOC_AR7240:
-   case AR71XX_SOC_AR7241:
case AR71XX_SOC_AR7242:
*maxpin = AR724X_GPIO_PINS - 1;
+   break;
+   case AR71XX_SOC_AR7241:
+   *maxpin = AR7241_GPIO_PINS - 1;
break;
case AR71XX_SOC_AR9330:
case AR71XX_SOC_AR9331:

Modified: head/sys/mips/atheros/ar71xx_gpiovar.h
==
--- head/sys/mips/atheros/ar71xx_gpiovar.h  Mon Mar 25 07:46:20 2019
(r345491)
+++ head/sys/mips/atheros/ar71xx_gpiovar.h  Mon Mar 25 07:48:52 2019
(r345492)
@@ -55,6 +55,7 @@
 
 #defineAR71XX_GPIO_PINS12
 #defineAR724X_GPIO_PINS18
+#defineAR7241_GPIO_PINS20
 #defineAR91XX_GPIO_PINS22
 
 struct ar71xx_gpio_softc {
___
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: r345464 - head/sys/dev/cfi

2019-03-24 Thread Allan Jude
Author: allanjude
Date: Sun Mar 24 06:28:25 2019
New Revision: 345464
URL: https://svnweb.freebsd.org/changeset/base/345464

Log:
  Fix AMD type flash write operations, and display chip information at boot
  
  Applies to MX flash chips on AR9132 and RT3050
  
  Submitted by: Hiroki Mori 
  Reviewed by:  imp, sbruno
  Differential Revision:https://reviews.freebsd.org/D14279

Modified:
  head/sys/dev/cfi/cfi_core.c
  head/sys/dev/cfi/cfi_reg.h
  head/sys/dev/cfi/cfi_var.h

Modified: head/sys/dev/cfi/cfi_core.c
==
--- head/sys/dev/cfi/cfi_core.c Sat Mar 23 23:44:40 2019(r345463)
+++ head/sys/dev/cfi/cfi_core.c Sun Mar 24 06:28:25 2019(r345464)
@@ -421,6 +421,16 @@ cfi_attach(device_t dev) 
}
}
 
+   if (sc->sc_cmdset == CFI_VEND_AMD_ECS  ||
+   sc->sc_cmdset == CFI_VEND_AMD_SCS) {
+   cfi_amd_write(sc, 0, AMD_ADDR_START, CFI_AMD_AUTO_SELECT);
+   sc->sc_manid = cfi_read(sc, 0);
+   sc->sc_devid = cfi_read(sc, 2);
+   device_printf(dev, "Manufacturer ID:%x Device ID:%x\n",
+   sc->sc_manid, sc->sc_devid);
+   cfi_write(sc, 0, CFI_BCS_READ_ARRAY2);
+   }
+
u = device_get_unit(dev);
sc->sc_nod = make_dev(_cdevsw, u, UID_ROOT, GID_WHEEL, 0600,
"%s%u", cfi_driver_name, u);
@@ -500,6 +510,37 @@ cfi_detach(device_t dev)
return (0);
 }
 
+static bool
+cfi_check_erase(struct cfi_softc *sc, u_int ofs, u_int sz)
+{
+   bool result;
+   int i;
+   uint32_t val;
+
+   result = FALSE;
+   for (i = 0; i < sz; i += sc->sc_width) {
+   val = cfi_read(sc, ofs + i);
+   switch (sc->sc_width) {
+   case 1:
+   if (val != 0xff)
+   goto out;
+   continue;
+   case 2:
+   if (val != 0x)
+   goto out;
+   continue;
+   case 4:
+   if (val != 0x)
+   goto out;
+   continue;
+   }
+   }
+   result = TRUE;
+
+out:
+   return (result);
+}
+
 static int
 cfi_wait_ready(struct cfi_softc *sc, u_int ofs, sbintime_t start,
 enum cfi_wait_cmd cmd)
@@ -581,10 +622,12 @@ cfi_write_block(struct cfi_softc *sc)
uint32_t*x32;
} ptr, cpyprt;
register_t intr;
-   int error, i, neederase = 0;
+   int error, i, j, neederase = 0;
uint32_t st;
u_int wlen;
sbintime_t start;
+   u_int minsz;
+   uint32_t val;
 
/* Intel flash must be unlocked before modification */
switch (sc->sc_cmdset) {
@@ -615,9 +658,27 @@ cfi_write_block(struct cfi_softc *sc)
break;
case CFI_VEND_AMD_SCS:
case CFI_VEND_AMD_ECS:
+   /* find minimum sector size */
+   minsz = sc->sc_region[0].r_blksz;
+   for (i = 1; i < sc->sc_regions; i++) {
+   if (sc->sc_region[i].r_blksz < minsz)
+   minsz = sc->sc_region[i].r_blksz;
+   }
cfi_amd_write(sc, sc->sc_wrofs, AMD_ADDR_START,
CFI_AMD_ERASE_SECTOR);
-   cfi_amd_write(sc, sc->sc_wrofs, 0, CFI_AMD_BLOCK_ERASE);
+   cfi_amd_write(sc, sc->sc_wrofs, 
+   sc->sc_wrofs >> (ffs(minsz) - 1),
+   CFI_AMD_BLOCK_ERASE);
+   for (i = 0; i < CFI_AMD_MAXCHK; ++i) {
+   if (cfi_check_erase(sc, sc->sc_wrofs,
+   sc->sc_wrbufsz))
+   break;
+   DELAY(10);
+   }
+   if (i == CFI_AMD_MAXCHK) {
+   printf("\nCFI Sector Erase time out error\n");
+   return (ENODEV);
+   }
break;
default:
/* Better safe than sorry... */
@@ -749,10 +810,37 @@ cfi_write_block(struct cfi_softc *sc)

intr_restore(intr);
 
-   error = cfi_wait_ready(sc, sc->sc_wrofs, start,
-  CFI_TIMEOUT_WRITE);
-   if (error)
-   goto out;
+   if (sc->sc_cmdset == CFI_VEND_AMD_ECS  ||
+   sc->sc_cmdset == CFI_VEND_AMD_SCS) {
+   for (j = 0; j < CFI_AMD_MAXCHK; ++j) {
+   switch (sc->sc_width) {
+   case 1:
+   val = *(ptr.x8 + i);
+  

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

2019-01-12 Thread Allan Jude
Author: allanjude
Date: Sat Jan 12 17:52:52 2019
New Revision: 342971
URL: https://svnweb.freebsd.org/changeset/base/342971

Log:
  Add missing documentation for dev.acpi_ibm.0.mic_led added in r335304
  
  PR:   229074
  X-MFC-With:   335304
  Submitted by: Ali Abdallah 

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

Modified: head/share/man/man4/acpi_ibm.4
==
--- head/share/man/man4/acpi_ibm.4  Sat Jan 12 17:00:54 2019
(r342970)
+++ head/share/man/man4/acpi_ibm.4  Sat Jan 12 17:52:52 2019
(r342971)
@@ -273,6 +273,9 @@ Current brightness level of the display.
 Speaker volume.
 .It Va dev.acpi_ibm.0.mute
 Indicates, whether the speakers are muted or not.
+.It Va dev.acpi_ibm.0.mic_mute
+Indicates, whether the microphone led (present on some model) is on or not. 
+Note that this does not mean that the microphone input is muted.
 .It Va dev.acpi_ibm.0.thinklight
 Indicates, whether the ThinkLight keyboard light is activated or not.
 .It Va dev.acpi_ibm.0.bluetooth
@@ -437,6 +440,17 @@ case ${NOTIFY} in
 MESSAGE="volume unmuted"
 fi
 ;;
+   0x1b)
+   LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led`
+   if [ $LEVEL -eq 0 ]; then
+   sysctl dev.acpi_ibm.0.mic_led=1
+   mixer rec 0
+   fi 
+   if [ $LEVEL -eq 1 ]; then 
+   sysctl dev.acpi_ibm.0.mic_led=0
+   mixer rec 30
+   fi
+   ;;
 *)
 ;;
 esac
___
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: r342754 - head/usr.bin/lam

2019-01-03 Thread Allan Jude
Author: allanjude
Date: Fri Jan  4 02:48:43 2019
New Revision: 342754
URL: https://svnweb.freebsd.org/changeset/base/342754

Log:
  The lam(1) man page is unclear about the uppercase versions of the flags
  
  PR:   229571
  Submitted by: Tim Chase 

Modified:
  head/usr.bin/lam/lam.1

Modified: head/usr.bin/lam/lam.1
==
--- head/usr.bin/lam/lam.1  Fri Jan  4 02:21:00 2019(r342753)
+++ head/usr.bin/lam/lam.1  Fri Jan  4 02:48:43 2019(r342754)
@@ -58,14 +58,8 @@ are considered fragments of the single long
 output line into which they are assembled.
 The name `\fB\-\fP' means the standard input, and may be repeated.
 .Pp
-Normally, each option affects only the
-.Ar file
-after it.
-If the option letter is capitalized it affects all subsequent files
-until it appears again uncapitalized.
-The options are described below:
 .Bl -tag -width indent
-.It Fl f Ar min . Ns Ar max
+.It Fl f Ar min . Ns Ar max , Fl F Ar min . Ns Ar max
 Print line fragments according to the format string
 .Ar min . Ns Ar max ,
 where
@@ -78,21 +72,41 @@ If
 begins with a zero, zeros will be added to make up the field width,
 and if it begins with a `\-', the fragment will be left-adjusted
 within the field.
-.It Fl p Ar min . Ns Ar max
+Using
+.Fl f
+applies only to the next file while
+.Fl F
+applies to all subsequent files until it appears again uncapitalized.
+.It Fl p Ar min . Ns Ar max , Fl P Ar min . Ns Ar max
 Like
 .Fl f ,
 but pad this file's field when end-of-file is reached
 and other files are still active.
-.It Fl s Ar sepstring
+Using
+.Fl p
+applies only to the next file while
+.Fl P
+applies to all subsequent files until it appears again uncapitalized.
+.It Fl s Ar sepstring , Fl S Ar sepstring
 Print
 .Ar sepstring
 before printing line fragments from the next file.
 This option may appear after the last file.
-.It Fl t Ar c
+Using
+.Fl s
+applies only to the next file while
+.Fl S
+applies to all subsequent files until it appears again uncapitalized.
+.It Fl t Ar c , Fl T Ar c
 The input line terminator is
 .Ar c
 instead of a newline.
 The newline normally appended to each output line is omitted.
+Using
+.Fl t
+applies only to the next file while
+.Fl T
+applies to all subsequent files until it appears again uncapitalized.
 .El
 .Pp
 To print files simultaneously for easy viewing use
___
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: r340450 - head/sys/sys

2018-11-18 Thread Allan Jude
On 2018-11-15 11:02, Warner Losh wrote:
> Author: imp
> Date: Thu Nov 15 16:02:13 2018
> New Revision: 340450
> URL: https://svnweb.freebsd.org/changeset/base/340450
> 
> Log:
>   When converting ns,us,ms to sbt, return the ceil() of the result
>   rather than the floor(). Returning the floor means that
>   sbttoX(Xtosbt(y)) != y for almost all values of y.  In practice, this
>   results in a difference of at most 1 in the lsb of the sbintime_t.
>   This difference is meaningless for all current users of these
>   functions, but is important for the newly introduced sysctl conversion
>   routines which implicitly rely on the transformation being idempotent.
>   
>   Sponsored by: Netflix, Inc
> 

This seems to break attaching for my mlxen(4), with or without r340451

I don't understand why at this point.

Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0:  mem
0xfbe0-0xfbef,0xfa80-0xfaff irq 48 at device 0.0
numa-domain 1 on pci11
Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core
Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go
bit not cleared)
Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be reset
Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset successfully
Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed,
aborting
Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, aborting.
Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach
returned 5

It works fine under r340449:

Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0:  mem
0xfbe0-0xfbef,0xfa80-0xfaff irq 48 at device 0.0
numa-domain 1 on pci11
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core
driver v3.4.1 (October 2017)
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI
device chain minimum BW
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1
Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address:
00:02:c9:4d:6a:e8
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32
TX rings
Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16
RX rings
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port
Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down
Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP



> Modified:
>   head/sys/sys/time.h
> 
> Modified: head/sys/sys/time.h
> ==
> --- head/sys/sys/time.h   Thu Nov 15 08:43:17 2018(r340449)
> +++ head/sys/sys/time.h   Thu Nov 15 16:02:13 2018(r340450)
> @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt)
>   * Decimal<->sbt conversions.  Multiplying or dividing by SBT_1NS results in
>   * large roundoff errors which sbttons() and nstosbt() avoid.  Millisecond 
> and
>   * microsecond functions are also provided for completeness.
> + *
> + * These functions return the smallest sbt larger or equal to the number of
> + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term 
> added
> + * transforms the >> 32 from floor() to ceil().
>   */
>  static __inline int64_t
>  sbttons(sbintime_t _sbt)
> @@ -173,7 +177,7 @@ static __inline sbintime_t
>  nstosbt(int64_t _ns)
>  {
>  
> - return ((_ns * (((uint64_t)1 << 63) / 5)) >> 32);
> + return ((_ns * (((uint64_t)1 << 63) / 5) + (1ull << 32) - 1) >> 
> 32);
>  }
>  
>  static __inline int64_t
> @@ -187,7 +191,7 @@ static __inline sbintime_t
>  ustosbt(int64_t _us)
>  {
>  
> - return ((_us * (((uint64_t)1 << 63) / 50)) >> 32);
> + return ((_us * (((uint64_t)1 << 63) / 50) + (1ull << 32) - 1) >> 
> 32);
>  }
>  
>  static __inline int64_t
> @@ -201,7 +205,7 @@ static __inline sbintime_t
>  mstosbt(int64_t _ms)
>  {
>  
> - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32);
> + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32);
>  }
>  
>  /*-
> 


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r339344 - head/usr.sbin/mfiutil

2018-10-13 Thread Allan Jude
Author: allanjude
Date: Sat Oct 13 02:21:23 2018
New Revision: 339344
URL: https://svnweb.freebsd.org/changeset/base/339344

Log:
  Make `mfiutil show progress` print out the elapsed time estimate in a
  more humanized way
  
  PR:   225993
  Submitted by: Enji Cooper 
  Reviewed by:  jhb (previous version)
  Approved by:  re (rgrimes)

Modified:
  head/usr.sbin/mfiutil/mfi_cmd.c

Modified: head/usr.sbin/mfiutil/mfi_cmd.c
==
--- head/usr.sbin/mfiutil/mfi_cmd.c Sat Oct 13 02:20:16 2018
(r339343)
+++ head/usr.sbin/mfiutil/mfi_cmd.c Sat Oct 13 02:21:23 2018
(r339344)
@@ -31,17 +31,18 @@
  * $FreeBSD$
  */
 
-#include 
-#include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "mfiutil.h"
@@ -311,24 +312,34 @@ mfi_open(int unit, int acs)
return (open(path, acs));
 }
 
+static void
+print_time_humanized(uint seconds)
+{
+
+   if (seconds > 3600) {
+   printf("%u:", seconds / 3600);
+   }
+   if (seconds > 60) {
+   seconds %= 3600;
+   printf("%02u:%02u", seconds / 60, seconds % 60);
+   } else {
+   printf("%us", seconds);
+   }
+}
+
 void
 mfi_display_progress(const char *label, struct mfi_progress *prog)
 {
uint seconds;
 
-   printf("%s: %.2f%% complete, after %ds", label,
-   (float)prog->progress * 100 / 0x, prog->elapsed_seconds);
+   printf("%s: %.2f%% complete after ", label,
+   (float)prog->progress * 100 / 0x);
+   print_time_humanized(prog->elapsed_seconds);
if (prog->progress != 0 && prog->elapsed_seconds > 10) {
printf(" finished in ");
seconds = (0x1 * (uint32_t)prog->elapsed_seconds) /
prog->progress - prog->elapsed_seconds;
-   if (seconds > 3600)
-   printf("%u:", seconds / 3600);
-   if (seconds > 60) {
-   seconds %= 3600;
-   printf("%02u:%02u", seconds / 60, seconds % 60);
-   } else
-   printf("%us", seconds);
+   print_time_humanized(seconds);
}
printf("\n");
 }
___
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: r339343 - head/lib/libc/sys

2018-10-12 Thread Allan Jude
Author: allanjude
Date: Sat Oct 13 02:20:16 2018
New Revision: 339343
URL: https://svnweb.freebsd.org/changeset/base/339343

Log:
  Document that sendfile(2) can return ENOTCAPABLE
  
  PR:   232207
  Submitted by: Enji Cooper 
  Approved by:  re (rgrimes)

Modified:
  head/lib/libc/sys/sendfile.2

Modified: head/lib/libc/sys/sendfile.2
==
--- head/lib/libc/sys/sendfile.2Sat Oct 13 00:13:24 2018
(r339342)
+++ head/lib/libc/sys/sendfile.2Sat Oct 13 02:20:16 2018
(r339343)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 17, 2016
+.Dd October 12, 2018
 .Dt SENDFILE 2
 .Os
 .Sh NAME
@@ -336,6 +336,12 @@ is negative.
 .It Bq Er EIO
 An error occurred while reading from
 .Fa fd .
+.It Bq Er ENOTCAPABLE
+The
+.Fa fd
+or the
+.Fa s
+argument has insufficient rights.
 .It Bq Er ENOBUFS
 The system was unable to allocate an internal buffer.
 .It Bq Er ENOTCONN
___
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: r339299 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-10-10 Thread Allan Jude
Author: allanjude
Date: Wed Oct 10 22:59:15 2018
New Revision: 339299
URL: https://svnweb.freebsd.org/changeset/base/339299

Log:
  Pull in a follow-on commit to resolve a deadlock in ZFS sequential
  resilver (r334844)
  
  MFV/ZoL: Fix deadlock in IO pipeline
  
  commit a76f3d0437e5e974f0f748f8735af3539443b388
  Author: Brian Behlendorf 
  Date:   Fri Mar 16 16:46:06 2018 -0700
  
  Fix deadlock in IO pipeline
  
  In vdev_queue_aggregate() the zio_execute() bypass should not be
  called under the vdev queue lock.  This can result in a deadlock
  as shown in the stack traces below.
  
  Drop the vdev queue lock then walk the parents of the aggregate IO
  to determine the list of component IOs to be bypassed.  This can
  be done safely without holding the io_lock since the new aggregate
  IO has not yet been returned and its parents cannot change.
  
  ---  THREAD 1 ---
  arc_read()
zio_nowait()
  zio_vdev_io_start()
vdev_queue_io() <--- mutex_enter(vq->vq_lock)
  vdev_queue_io_to_issue()
vdev_queue_aggregate()
  zio_execute()
  vdev_queue_io_to_issue()
vdev_queue_aggregate()
  zio_execute()
zio_vdev_io_assess()
  zio_wait_for_children() <- mutex_enter(zio->io_lock)
  
  --- THREAD 2 --- (inverse order)
  arc_read()
zio_change_priority() <- mutex_enter(zio->zio_lock)
  vdev_queue_change_io_priority() <- mutex_enter(vq->vq_lock)
  
  Reviewed-by: Tom Caputi 
  Reviewed-by: Don Brady 
  Signed-off-by: Brian Behlendorf 
  
  Reported by:  ZFS Leadership Meeting
  Reviewed by:  mav
  Approved by:  re (kib)
  Obtained from:ZFS-on-Linux
  MFC after:2 weeks
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D17495

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cWed Oct 
10 22:55:31 2018(r339298)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cWed Oct 
10 22:59:15 2018(r339299)
@@ -670,6 +670,7 @@ static zio_t *
 vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
 {
zio_t *first, *last, *aio, *dio, *mandatory, *nio;
+   zio_link_t *zl = NULL;
uint64_t maxgap = 0;
uint64_t size;
boolean_t stretch;
@@ -813,9 +814,18 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
 
zio_add_child(dio, aio);
vdev_queue_io_remove(vq, dio);
+   } while (dio != last);
+
+   /*
+* We need to drop the vdev queue's lock to avoid a deadlock that we
+* could encounter since this I/O will complete immediately.
+*/
+   mutex_exit(>vq_lock);
+   while ((dio = zio_walk_parents(aio, )) != NULL) {
zio_vdev_io_bypass(dio);
zio_execute(dio);
-   } while (dio != last);
+   }
+   mutex_enter(>vq_lock);
 
return (aio);
 }
___
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: r339298 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-10-10 Thread Allan Jude
Author: allanjude
Date: Wed Oct 10 22:55:31 2018
New Revision: 339298
URL: https://svnweb.freebsd.org/changeset/base/339298

Log:
  Add missing sysctls for tuning vdev queue depths for new I/O types
  
  This connects new tunables that were added but not exposed in:
  r329502 (zpool remove)
  r337007 (zpool initialize)
  
  Reviewed by:  avg
  Approved by:  re (kib)
  MFC after:2 weeks
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D17494

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cWed Oct 
10 22:51:45 2018(r339297)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cWed Oct 
10 22:55:31 2018(r339298)
@@ -252,6 +252,10 @@ ZFS_VDEV_QUEUE_KNOB_MIN(scrub);
 ZFS_VDEV_QUEUE_KNOB_MAX(scrub);
 ZFS_VDEV_QUEUE_KNOB_MIN(trim);
 ZFS_VDEV_QUEUE_KNOB_MAX(trim);
+ZFS_VDEV_QUEUE_KNOB_MIN(removal);
+ZFS_VDEV_QUEUE_KNOB_MAX(removal);
+ZFS_VDEV_QUEUE_KNOB_MIN(initializing);
+ZFS_VDEV_QUEUE_KNOB_MAX(initializing);
 
 #undef ZFS_VDEV_QUEUE_KNOB
 
___
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: r339289 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-10-10 Thread Allan Jude
Author: allanjude
Date: Wed Oct 10 19:39:47 2018
New Revision: 339289
URL: https://svnweb.freebsd.org/changeset/base/339289

Log:
  Resolve a hang in ZFS during vnode reclaimation
  
  This is caused by a deadlock between zil_commit() and zfs_zget()
  
  Add a way for zfs_zget() to break out of the retry loop in the common case
  
  PR:   229614
  Reported by:  grembo, Andreas Sommer, many others
  Tested by:Andreas Sommer, Vicki Pfau
  Reviewed by:  avg (no objection)
  Approved by:  re (gjb)
  MFC after:2 months
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D17460

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Oct 
10 16:34:53 2018(r339288)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Oct 
10 19:39:47 2018(r339289)
@@ -1165,15 +1165,27 @@ again:
 */
ASSERT3P(zp, !=, NULL);
ASSERT3U(zp->z_id, ==, obj_num);
-   *zpp = zp;
-   vp = ZTOV(zp);
+   if (zp->z_unlinked) {
+   err = SET_ERROR(ENOENT);
+   } else {
+   vp = ZTOV(zp);
+   /*
+* Don't let the vnode disappear after
+* ZFS_OBJ_HOLD_EXIT.
+*/
+   VN_HOLD(vp);
+   *zpp = zp;
+   err = 0;
+   }
 
-   /* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */
-   VN_HOLD(vp);
-
sa_buf_rele(db, NULL);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
 
+   if (err) {
+   getnewvnode_drop_reserve();
+   return (err);
+   }
+
locked = VOP_ISLOCKED(vp);
VI_LOCK(vp);
if ((vp->v_iflag & VI_DOOMED) != 0 &&
@@ -1206,7 +1218,7 @@ again:
}
VI_UNLOCK(vp);
getnewvnode_drop_reserve();
-   return (0);
+   return (err);
}
 
/*
___
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: r339224 - head/usr.bin/truss

2018-10-07 Thread Allan Jude
Author: allanjude
Date: Sun Oct  7 19:50:44 2018
New Revision: 339224
URL: https://svnweb.freebsd.org/changeset/base/339224

Log:
  Teach truss how to display shm_open(2), shm_unlink(2)
  
  Submitted by: Thomas Munro 
  Reviewed by:  tuexen, kib
  Approved by:  re (rgrimes)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D17457

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Sun Oct  7 15:54:13 2018
(r339223)
+++ head/usr.bin/truss/syscalls.c   Sun Oct  7 19:50:44 2018
(r339224)
@@ -461,6 +461,10 @@ static struct syscall decoded_syscalls[] = {
{ .name = "setsockopt", .ret_type = 1, .nargs = 5,
  .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 },
{ Ptr | IN, 3 }, { Socklent, 4 } } },
+   { .name = "shm_open", .ret_type = 1, .nargs = 3,
+ .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
+   { .name = "shm_unlink", .ret_type = 1, .nargs = 1,
+ .args = { { Name | IN, 0 } } },
{ .name = "shutdown", .ret_type = 1, .nargs = 2,
  .args = { { Int, 0 }, { Shutdown, 1 } } },
{ .name = "sigaction", .ret_type = 1, .nargs = 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: r339026 - head/sys/dev/usb/net

2018-09-30 Thread Allan Jude
Author: allanjude
Date: Sun Sep 30 21:23:31 2018
New Revision: 339026
URL: https://svnweb.freebsd.org/changeset/base/339026

Log:
  Use PNP metadata to allow devmatch to autoload ure(4)
  
  Reviewed by:  manu imp
  Approved by:  re (kib)
  X-MFC-with:   devmatch
  Sponsored by: Klara Systems

Modified:
  head/sys/dev/usb/net/if_ure.c

Modified: head/sys/dev/usb/net/if_ure.c
==
--- head/sys/dev/usb/net/if_ure.c   Sun Sep 30 16:57:30 2018
(r339025)
+++ head/sys/dev/usb/net/if_ure.c   Sun Sep 30 21:23:31 2018
(r339026)
@@ -169,6 +169,7 @@ MODULE_DEPEND(ure, usb, 1, 1, 1);
 MODULE_DEPEND(ure, ether, 1, 1, 1);
 MODULE_DEPEND(ure, miibus, 1, 1, 1);
 MODULE_VERSION(ure, 1);
+USB_PNP_HOST_INFO(ure_devs);
 
 static const struct usb_ether_methods ure_ue_methods = {
.ue_attach_post = ure_attach_post,
___
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: r339009 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-09-28 Thread Allan Jude
Author: allanjude
Date: Sat Sep 29 01:26:07 2018
New Revision: 339009
URL: https://svnweb.freebsd.org/changeset/base/339009

Log:
  Avoid panic when adjusting priority of a read in the face of an IO error
  
  PR:   231516
  Reported by:  sbruno
  Approved by:  re (rgrimes)
  Obtained from:ZFS-on-Linux
  X-MFC-with:   334844
  Sponsored by: Klara Systems
  
  MFV/ZoL:  Fix zio->io_priority failed (7 < 6) assert
  
  commit c26cf0966d131b722c32f8ccecfe5791a789d975
  Author: Tony Hutter 
  Date:   Tue May 29 18:13:48 2018 -0700
  
Fix zio->io_priority failed (7 < 6) assert
  
This fixes an assert in vdev_queue_change_io_priority():
  
  VERIFY3(zio->io_priority < ZIO_PRIORITY_NUM_QUEUEABLE) failed (7 < 6)
  PANIC at vdev_queue.c:832:vdev_queue_change_io_priority()
  
Reviewed-by: Tom Caputi 
Reviewed-by: George Melikov 
Reviewed-by: Brian Behlendorf 
Signed-off-by: Tony Hutter 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cSat Sep 
29 00:44:23 2018(r339008)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cSat Sep 
29 01:26:07 2018(r339009)
@@ -958,6 +958,15 @@ vdev_queue_change_io_priority(zio_t *zio, zio_priority
vdev_queue_t *vq = >io_vd->vdev_queue;
avl_tree_t *tree;
 
+   /*
+* ZIO_PRIORITY_NOW is used by the vdev cache code and the aggregate zio
+* code to issue IOs without adding them to the vdev queue. In this
+* case, the zio is already going to be issued as quickly as possible
+* and so it doesn't need any reprioitization to help.
+*/
+   if (zio->io_priority == ZIO_PRIORITY_NOW)
+   return;
+
ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
ASSERT3U(priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
 
___
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: r338282 - head/usr.sbin/bsdinstall/scripts

2018-08-23 Thread Allan Jude
Author: allanjude
Date: Thu Aug 23 22:50:11 2018
New Revision: 338282
URL: https://svnweb.freebsd.org/changeset/base/338282

Log:
  bsdinstall/zfsboot: Enable new UEFI+GELI support
  
  After r336252 it is no longer necessary to have a separate bootpool when
  booting from an encrypted disk with UEFI.
  
  This change also switches the EFI System Partition contents from
  the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos
  and uses loader.efi directly, instead of boot1.efi.
  
  PR:   228916
  Reviewed by:  dteske
  MFC after:1 month
  Relnotes: yes
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D12315

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootThu Aug 23 22:35:14 2018
(r338281)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootThu Aug 23 22:50:11 2018
(r338282)
@@ -185,9 +185,11 @@ FSTAB_FMT="%s\t\t%s\t%s\t%s\t\t%s\t%s\n"
 #
 # Command strings for various tasks
 #
+COPY='cp "%s" "%s"'
 CHMOD_MODE='chmod %s "%s"'
 DD_WITH_OPTIONS='dd if="%s" of="%s" %s'
 ECHO_APPEND='echo "%s" >> "%s"'
+ECHO_OVERWRITE='echo "%s" > "%s"'
 GELI_ATTACH='geli attach -j - -k "%s" "%s"'
 GELI_ATTACH_NOKEY='geli attach -j - "%s"'
 GELI_DETACH_F='geli detach -f "%s"'
@@ -211,6 +213,7 @@ KLDLOAD='kldload %s'
 LN_SF='ln -sf "%s" "%s"'
 MKDIR_P='mkdir -p "%s"'
 MOUNT_TYPE='mount -t %s "%s" "%s"'
+NEWFS_ESP='newfs_msdos -F %s -L "%s" "%s"'
 PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\""
 PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"'
 SHELL_TRUNCATE=':> "%s"'
@@ -841,18 +844,34 @@ zfs_create_diskpart()
# 2. Add small freebsd-boot and/or efi partition
#
if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = 
"BIOS+UEFI" ]; then
-   #
-   # Enable boot pool if encryption is desired
-   #
-   [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1
-
f_eval_catch $funcname gpart \
 "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \
-"$align_small" efiboot$index efi 200M 
$disk ||
+"$align_small" efiboot$index efi 200M \
+$disk ||
 return $FAILURE
-   f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" 
\
-/boot/boot1.efifat 1 $disk ||
-return $FAILURE
+
+   f_eval_catch $funcname mkdir "$MKDIR_P" \
+"$BSDINSTALL_TMPETC/esp" || return $FAILURE
+   f_eval_catch $funcname newfs_msdos "$NEWFS_ESP" "16" \
+"EFISYS" "/dev/${disk}p1" ||
+return $FAILURE
+   f_eval_catch $funcname mount "$MOUNT_TYPE" "msdosfs" \
+"/dev/${disk}p1" \
+"$BSDINSTALL_TMPETC/esp" ||
+return $FAILURE
+   f_eval_catch $funcname mkdir "$MKDIR_P" \
+"$BSDINSTALL_TMPETC/esp/efi/boot" ||
+return $FAILURE
+   f_eval_catch $funcname cp "$COPY" "/boot/loader.efi" \
+
"$BSDINSTALL_TMPETC/esp/efi/boot/$ZFSBOOT_ESP_NAME" ||
+return $FAILURE
+   f_eval_catch $funcname echo "$ECHO_OVERWRITE" \
+"$ZFSBOOT_ESP_NAME" \
+
"$BSDINSTALL_TMPETC/esp/efi/boot/startup.nsh" ||
+return $FAILURE
+   f_eval_catch $funcname umount "$UMOUNT" \
+"$BSDINSTALL_TMPETC/esp" ||
+return $FAILURE
fi
 
if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o "$ZFSBOOT_BOOT_TYPE" = 
"BIOS+UEFI" ]; then
@@ -1574,6 +1593,20 @@ arm64)
: ${ZFSBOOT_PARTITION_SCHEME:=GPT}
fi
;;
+esac
+
+#
+# The EFI loader installed in the ESP (EFI System Partition) must
+# have the expected name in order to load correctly.
+#
+[ "$ZFSBOOT_ESP_NAME" ] || case "${UNAME_m:-$( uname -m )}" in
+   arm64) ZFSBOOT_ESP_NAME=BOOTaa64.efi ;;
+   arm) ZFSBOOT_ESP_NAME=BOOTarm.efi ;;
+   i386) ZFSBOOT_ESP_NAME=BOOTia32.efi ;;
+   amd64) ZFSBOOT_ESP_NAME=BOOTx64.efi ;;
+   *)
+   f_dprintf "Unsupported architecture: %s" $UNAME_m
+   f_die
 esac
 
 #

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

2018-07-23 Thread Allan Jude
Author: allanjude
Date: Tue Jul 24 04:38:11 2018
New Revision: 336660
URL: https://svnweb.freebsd.org/changeset/base/336660

Log:
  ZFS: Reserve DMU_BACKUP_FEATURE flags for Native Encryption and ZSTD

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Jul 
23 23:04:43 2018(r336659)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Tue Jul 
24 04:38:11 2018(r336660)
@@ -94,6 +94,8 @@ typedef enum drr_headertype {
 /* flag #21 is reserved for a Delphix feature */
 #defineDMU_BACKUP_FEATURE_COMPRESSED   (1 << 22)
 /* flag #23 is reserved for the large dnode feature */
+/* flag #24 is reserved for the raw send (encryption) feature */
+/* flag #25 is reserved for the ZSTD compression feature */
 
 /*
  * Mask of all supported backup features
___
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: r336451 - in head/sys/dev/mlx5: . mlx5_core mlx5_en

2018-07-19 Thread Allan Jude
On 2018-07-19 18:55, Ian Lepore wrote:
> On Wed, 2018-07-18 at 10:12 +, Hans Petter Selasky wrote:
>> Author: hselasky
>> Date: Wed Jul 18 10:12:53 2018
>> New Revision: 336451
>> URL: https://svnweb.freebsd.org/changeset/base/336451
>>
>> Log:
>>   Update version information for the mlx5 and mlx5en(4) modules.
>>   
>>   While at it bump some copyright dates.
>>   
>>   MFC after: 1 week
>>   Sponsored by:  Mellanox Technologies
> 
> After this recent set of commits, the sparc64, powerpc64, and armv4
> LINT kernels are failing to build. The problems are all some combo of
> missing fcmpset functions, or missing 64-bit atomic functions. I'm not
> sure this driver is useful on any of those platforms, but I guess it
> has always built fine in the past.
> 
> -- Ian
> 

I think you have the wrong commit. This commit only changes some static
strings, and copyright comments.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r335963 - in head: etc share/mk tools/build/mk tools/build/options

2018-07-04 Thread Allan Jude
On 2018-07-04 19:44, Ed Maste wrote:
> On 4 July 2018 at 13:18, Sean Bruno  wrote:
>> Author: sbruno
>> Date: Wed Jul  4 17:18:35 2018
>> New Revision: 335963
>> URL: https://svnweb.freebsd.org/changeset/base/335963
>>
>> Log:
>>   WITHOUT_SERVICESDB:
>>
>>   Add src.conf knob to disable the installation of /var/db/services.db
>>
>>   Default to leaving services.db in place, but allow the removal of the
>>   file and its creation with a src.conf knob.
>>
>>   This file ends up being 2MB in size.  For small systems this is a waste
>>   of space but its a tradeoff.
> 
> I'm happy to have this knob, but we ought to also see if we can reduce
> the size of services.db - it seems quite silly for it to be 2MB.
> 

I have somewhere a revival of bapt@'s old patch to use NetBSD's cdb to
make much smaller .db files.

Here is bapt@'s original work: https://people.freebsd.org/~bapt/cdbrw.diff

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r335883 - head/stand/common

2018-07-02 Thread Allan Jude
Author: allanjude
Date: Tue Jul  3 05:53:27 2018
New Revision: 335883
URL: https://svnweb.freebsd.org/changeset/base/335883

Log:
  stand/common/disk.c: dev->d_offset still needs to be set to 0
  
  With r335868, I thought this was no longer necessary. I was wrong.
  
  Reported by:  ian
  Sponsored by: Klara Systems

Modified:
  head/stand/common/disk.c

Modified: head/stand/common/disk.c
==
--- head/stand/common/disk.cTue Jul  3 04:02:40 2018(r335882)
+++ head/stand/common/disk.cTue Jul  3 05:53:27 2018(r335883)
@@ -244,6 +244,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
partdev.d_slice = -1;
partdev.d_partition = -1;
 
+   dev->d_offset = 0;
table = NULL;
slice = dev->d_slice;
partition = dev->d_partition;
___
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: r335868 - head/stand/common

2018-07-02 Thread Allan Jude
Author: allanjude
Date: Mon Jul  2 18:19:08 2018
New Revision: 335868
URL: https://svnweb.freebsd.org/changeset/base/335868

Log:
  stand/common/disk.c: Read partition table relative to the start of the disk
  
  If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh,
  when disk_open() is called on a GELI encrypted partition, attempts to read
  the partition table fail, as they pass through the decryption process which
  turns the already plaintext data into jibberish.
  
  When reading the partition table, always pass a slice and partition setting
  of -1, and an offset of 0. Setting the slice to -1 prevents a false
  positive when checking the slice against the cache of GELI encrypted
  slices.
  
  Reviewed by:  imp, ian
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15847

Modified:
  head/stand/common/disk.c

Modified: head/stand/common/disk.c
==
--- head/stand/common/disk.cMon Jul  2 17:54:33 2018(r335867)
+++ head/stand/common/disk.cMon Jul  2 18:19:08 2018(r335868)
@@ -219,20 +219,13 @@ disk_ioctl(struct disk_devdesc *dev, u_long cmd, void 
 int
 disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize)
 {
+   struct disk_devdesc partdev;
struct open_disk *od;
struct ptable *table;
struct ptable_entry part;
int rc, slice, partition;
 
rc = 0;
-   /*
-* While we are reading disk metadata, make sure we do it relative
-* to the start of the disk
-*/
-   dev->d_offset = 0;
-   table = NULL;
-   slice = dev->d_slice;
-   partition = dev->d_partition;
od = (struct open_disk *)malloc(sizeof(struct open_disk));
if (od == NULL) {
DEBUG("no memory");
@@ -242,11 +235,24 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
od->entrysize = 0;
od->mediasize = mediasize;
od->sectorsize = sectorsize;
+   /*
+* While we are reading disk metadata, make sure we do it relative
+* to the start of the disk
+*/
+   memcpy(, dev, sizeof(partdev));
+   partdev.d_offset = 0;
+   partdev.d_slice = -1;
+   partdev.d_partition = -1;
+
+   table = NULL;
+   slice = dev->d_slice;
+   partition = dev->d_partition;
+
DEBUG("%s unit %d, slice %d, partition %d => %p",
disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, 
od);
 
/* Determine disk layout. */
-   od->table = ptable_open(dev, mediasize / sectorsize, sectorsize,
+   od->table = ptable_open(, mediasize / sectorsize, sectorsize,
ptblread);
if (od->table == NULL) {
DEBUG("Can't read partition table");
___
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: r335276 - in head/stand/i386: gptboot zfsboot

2018-06-19 Thread Allan Jude
On 2018-06-17 07:32, Eugene Grosbein wrote:
> 17.06.2018 10:18, Allan Jude wrote:
> 
>> Author: allanjude
>> Date: Sun Jun 17 03:18:56 2018
>> New Revision: 335276
>> URL: https://svnweb.freebsd.org/changeset/base/335276
>>
>> Log:
>>   gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
>>   
>>   Normally the serial console is not enabled until /boot.config is read and
>>   we know how the serial console should be configured.  Initialize the
>>   consoles early in 'dual' mode (serial & keyboard) with a default serial
>>   rate of 115200. Then serial is re-initialized once the disk is decrypted
>>   and the /boot.config file can be read.
>>   
>>   This allows the GELIBoot passphrase to be provided via the serial console.
>>   
>>   PR:221526
>>   Requested by:  many
>>   Reviewed by:   imp
>>   Sponsored by:  Klara Systems
>>   Differential Revision: https://reviews.freebsd.org/D15862
> 
> I had several cases when booting FreeBSD/amd64 with motherboard having no 
> serial ports
> hang hard early at boot unless I rebuilt boot media configuring it to NOT try 
> accessing
> missing serial ports. I even could reproduce that with VirtualBox machine 
> configured
> with no serial ports (not same as existing bug inactive serial port).
> 
> Should there be some way to disable this serial ports configuration at 
> compile time?
> 
> 
> 

I think what we'll do it compile it both ways, and use the non-serial
one by default, because it is safer. Then you can just use
'gptboot-serial' if you want serial support.

This will likely make Warner a bit sad, since we are just finally
getting around to reducing the number of different bootcode files.

-- 
Allan Jude
___
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: r335276 - in head/stand/i386: gptboot zfsboot

2018-06-19 Thread Allan Jude
On 2018-06-19 16:30, O. Hartmann wrote:
> Am Sun, 17 Jun 2018 03:18:57 + (UTC)
> Allan Jude  schrieb:
> 
>> Author: allanjude
>> Date: Sun Jun 17 03:18:56 2018
>> New Revision: 335276
>> URL: https://svnweb.freebsd.org/changeset/base/335276
> 
>> Log:
>>   gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
> 
>>   Normally the serial console is not enabled until /boot.config is read and
>>   we know how the serial console should be configured.  Initialize the
>>   consoles early in 'dual' mode (serial & keyboard) with a default serial
>>   rate of 115200. Then serial is re-initialized once the disk is decrypted
>>   and the /boot.config file can be read.
> 
>>   This allows the GELIBoot passphrase to be provided via the serial console.
> 
>>   PR:221526
>>   Requested by:  many
>>   Reviewed by:   imp
>>   Sponsored by:  Klara Systems
>>   Differential Revision: https://reviews.freebsd.org/D15862
> 
>> Modified:
>>   head/stand/i386/gptboot/gptboot.c
>>   head/stand/i386/zfsboot/zfsboot.c
> 
> 
> This commit breaks booting off GPT partition (using NanoBSD, as Iposted 
> mistakenly to
> commit r335254, see there).
> Having CURRENT applied to a SD card for usage on a PCEngines APU 2C4, the 
> boot process
> dies immediately showing "Booting from harddisk". r335275 boots well.
> 
> 

I have reverted this commit in r335398.

As I mentioned in that commit, it will likely come back as an optional
feature in the near future.


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r335398 - in head/stand/i386: gptboot zfsboot

2018-06-19 Thread Allan Jude
Author: allanjude
Date: Wed Jun 20 00:14:54 2018
New Revision: 335398
URL: https://svnweb.freebsd.org/changeset/base/335398

Log:
  Revert r335276
  
  This was causing issues for people booting.
  I will likely bring this back as an optional feature, similar to
  boot0sio, like gptboot-serial or something.
  
  PR:   221526
  Reported by:  O. Hartmann , Thomas Laus 


Modified:
  head/stand/i386/gptboot/gptboot.c
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/i386/gptboot/gptboot.c
==
--- head/stand/i386/gptboot/gptboot.c   Wed Jun 20 00:13:09 2018
(r335397)
+++ head/stand/i386/gptboot/gptboot.c   Wed Jun 20 00:14:54 2018
(r335398)
@@ -285,16 +285,6 @@ main(void)
bootinfo.bi_memsizes_valid++;
bootinfo.bi_bios_dev = dsk.drive;
 
-   /*
-* Initialize the serial console early with a modern default of 115200.
-* Later, we'll read PATH_DOTCONFIG and reconfigure serial according
-* to the configuration provided.
-*/
-   opts = OPT_SET(RBX_DUAL);
-   ioctrl = (IO_SERIAL|IO_KEYBOARD);
-   if (sio_init(115200) != 0)
-   ioctrl &= ~IO_SERIAL;
-
 #ifdef LOADER_GELI_SUPPORT
geli_init();
 #endif

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Wed Jun 20 00:13:09 2018
(r335397)
+++ head/stand/i386/zfsboot/zfsboot.c   Wed Jun 20 00:14:54 2018
(r335398)
@@ -693,16 +693,6 @@ main(void)
 }
 setheap(heap_next, heap_end);
 
-/*
- * Initialize the serial console early with a modern default of 115200.
- * Later, we'll read PATH_DOTCONFIG and reconfigure serial according
- * to the configuration provided.
- */
-opts = OPT_SET(RBX_DUAL);
-ioctrl = (IO_SERIAL|IO_KEYBOARD);
-if (sio_init(115200) != 0)
-   ioctrl &= ~IO_SERIAL;
-
 dsk = malloc(sizeof(struct dsk));
 dsk->drive = *(uint8_t *)PTOV(ARGS);
 dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD;
___
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: r335298 - head/stand/common

2018-06-17 Thread Allan Jude
Author: allanjude
Date: Sun Jun 17 19:31:35 2018
New Revision: 335298
URL: https://svnweb.freebsd.org/changeset/base/335298

Log:
  stand/common/disk.c: Update debug printf
  
  This was missed in r330809 because it is compiled out by default
  
  Sponsored by: Klara Systems

Modified:
  head/stand/common/disk.c

Modified: head/stand/common/disk.c
==
--- head/stand/common/disk.cSun Jun 17 19:24:40 2018(r335297)
+++ head/stand/common/disk.cSun Jun 17 19:31:35 2018(r335298)
@@ -243,7 +243,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize
od->mediasize = mediasize;
od->sectorsize = sectorsize;
DEBUG("%s unit %d, slice %d, partition %d => %p",
-   disk_fmtdev(dev), dev->d_unit, dev->d_slice, dev->d_partition, od);
+   disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, 
od);
 
/* Determine disk layout. */
od->table = ptable_open(dev, mediasize / sectorsize, sectorsize,
___
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: r335279 - head/tools/boot

2018-06-16 Thread Allan Jude
Author: allanjude
Date: Sun Jun 17 05:55:31 2018
New Revision: 335279
URL: https://svnweb.freebsd.org/changeset/base/335279

Log:
  rootgen.sh: complete all profiles except GELI+MBR (not supported)
  
  This extends the test suite to generate images for every combination of:
  amd64: mbr/gpt geli/nogeli ufs/zfs legacy/uefi/both
  
  Except for mbr+geli, which is not currently possible.
  
  Reviewed by:  imp (previous version)
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15846

Modified:
  head/tools/boot/install-boot.sh
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/install-boot.sh
==
--- head/tools/boot/install-boot.sh Sun Jun 17 05:14:50 2018
(r335278)
+++ head/tools/boot/install-boot.sh Sun Jun 17 05:55:31 2018
(r335279)
@@ -27,7 +27,7 @@ find-part() {
 gpart show $dev | tail +2 | awk '$4 == "'$part'" { print $3; }'
 }
 
-boot_nogeli_gpt_zfs_legacy() {
+boot_nogeli_gpt_ufs_legacy() {
 dev=$1
 dst=$2
 
@@ -35,20 +35,34 @@ boot_nogeli_gpt_zfs_legacy() {
 if [ -z "$idx" ] ; then
die "No freebsd-boot partition found"
 fi
-doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
-exit 0
+doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
 }
 
-boot_nogeli_gpt_ufs_legacy() {
+boot_nogeli_gpt_ufs_uefi() {
 dev=$1
 dst=$2
 
+idx=$(find-part $dev "efi")
+if [ -z "$idx" ] ; then
+   die "No ESP partition found"
+fi
+doit gpart bootcode -p ${efi2} -i $idx $dev
+}
+
+boot_nogeli_gpt_ufs_both() {
+boot_nogeli_gpt_ufs_legacy $1 $2 $3
+boot_nogeli_gpt_ufs_uefi $1 $2 $3
+}
+
+boot_nogeli_gpt_zfs_legacy() {
+dev=$1
+dst=$2
+
 idx=$(find-part $dev "freebsd-boot")
 if [ -z "$idx" ] ; then
die "No freebsd-boot partition found"
 fi
-doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
-exit 0
+doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
 }
 
 boot_nogeli_gpt_zfs_uefi() {
@@ -57,64 +71,132 @@ boot_nogeli_gpt_zfs_uefi() {
 
 idx=$(find-part $dev "efi")
 if [ -z "$idx" ] ; then
-   die "No efi ESP partition found"
+   die "No ESP partition found"
 fi
 doit gpart bootcode -p ${efi2} -i $idx $dev
-exit 0
 }
 
 boot_nogeli_gpt_zfs_both() {
+boot_nogeli_gpt_zfs_legacy $1 $2 $3
+boot_nogeli_gpt_zfs_uefi $1 $2 $3
+}
+
+boot_nogeli_mbr_ufs_legacy() {
 dev=$1
 dst=$2
 
-# XXX: Should this be copy/pasted, or should it call both _uefi and _legacy
-idx=$(find-part $dev "efi")
-if [ -z "$idx" ] ; then
-   die "No efi ESP partition found"
+doit gpart bootcode -b ${mbr0} ${dev}
+s=$(find-part $dev "freebsd")
+if [ -z "$s" ] ; then
+   die "No freebsd slice found"
 fi
-doit gpart bootcode -p ${efi2} -i $idx $dev
+doit gpart bootcode -p ${mbr2} ${dev}s${s}
+}
 
-idx=$(find-part $dev "freebsd-boot")
-if [ -z "$idx" ] ; then
-   die "No freebsd-boot partition found"
+boot_nogeli_mbr_ufs_uefi() {
+dev=$1
+dst=$2
+
+s=$(find-part ${dev} "!239")
+if [ -z "$s" ] ; then
+   die "No ESP slice found"
 fi
-doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
-exit 0
+doit gpart bootcode -p ${efi2} -i ${s} ${dev}
 }
 
+boot_nogeli_mbr_ufs_both() {
+boot_nogeli_mbr_ufs_legacy $1 $2 $3
+boot_nogeli_mbr_ufs_uefi $1 $2 $3
+}
+
 boot_nogeli_mbr_zfs_legacy() {
 dev=$1
 dst=$2
 
 # search to find the BSD slice
-s=$(findpart $dev "freebsd-zfs")
+s=$(find-part $dev "freebsd")
 if [ -z "$s" ] ; then
+   die "No BSD slice found"
+fi
+idx=$(find-part ${dev}s${s} "freebsd-zfs")
+if [ -z "$idx" ] ; then
die "No freebsd-zfs slice found"
 fi
 # search to find the freebsd-zfs partition within the slice
 # Or just assume it is 'a' because it has to be since it fails otherwise
+doit gpart bootcode -b ${dst}/boot/mbr ${dev}
 dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1
-doit gpart bootcode -b /tmp/zfsboo1 ${dev}s${s}# Put boot1 into the 
start of part
+doit gpart bootcode -b /tmp/zfsboot1 ${dev}s${s}   # Put boot1 into the 
start of part
 sysctl kern.geom.debugflags=0x10   # Put boot2 into ZFS boot slot
-doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s} iseek=1 seek=1024
+doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s}a skip=1 seek=1024
 sysctl kern.geom.debugflags=0x0
-
-exit 0
 }
 
-boot_nogeli_mbr_ufs_legacy() {
+boot_nogeli_mbr_zfs_uefi() {
 dev=$1
 dst=$2
 
-doit gpart bootcode -b ${mbr0} ${dev}
-s=$(findpart $dev "freebsd-ufs")
+s=$(find-part $dev "!239")
 if [ -z "$s" ] ; then
-   die "No freebsd-ufs slice found"
+   die "No ESP slice found"
 fi
-doit gpart bootcode -p ${mbr2} ${dev}s${s}
-exit 0
+doit gpart bootcode -p ${efi2} -i ${s} ${dev}
 }
 

svn commit: r335276 - in head/stand/i386: gptboot zfsboot

2018-06-16 Thread Allan Jude
Author: allanjude
Date: Sun Jun 17 03:18:56 2018
New Revision: 335276
URL: https://svnweb.freebsd.org/changeset/base/335276

Log:
  gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
  
  Normally the serial console is not enabled until /boot.config is read and
  we know how the serial console should be configured.  Initialize the
  consoles early in 'dual' mode (serial & keyboard) with a default serial
  rate of 115200. Then serial is re-initialized once the disk is decrypted
  and the /boot.config file can be read.
  
  This allows the GELIBoot passphrase to be provided via the serial console.
  
  PR:   221526
  Requested by: many
  Reviewed by:  imp
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15862

Modified:
  head/stand/i386/gptboot/gptboot.c
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/i386/gptboot/gptboot.c
==
--- head/stand/i386/gptboot/gptboot.c   Sun Jun 17 03:10:25 2018
(r335275)
+++ head/stand/i386/gptboot/gptboot.c   Sun Jun 17 03:18:56 2018
(r335276)
@@ -285,6 +285,16 @@ main(void)
bootinfo.bi_memsizes_valid++;
bootinfo.bi_bios_dev = dsk.drive;
 
+   /*
+* Initialize the serial console early with a modern default of 115200.
+* Later, we'll read PATH_DOTCONFIG and reconfigure serial according
+* to the configuration provided.
+*/
+   opts = OPT_SET(RBX_DUAL);
+   ioctrl = (IO_SERIAL|IO_KEYBOARD);
+   if (sio_init(115200) != 0)
+   ioctrl &= ~IO_SERIAL;
+
 #ifdef LOADER_GELI_SUPPORT
geli_init();
 #endif

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Sun Jun 17 03:10:25 2018
(r335275)
+++ head/stand/i386/zfsboot/zfsboot.c   Sun Jun 17 03:18:56 2018
(r335276)
@@ -693,6 +693,16 @@ main(void)
 }
 setheap(heap_next, heap_end);
 
+/*
+ * Initialize the serial console early with a modern default of 115200.
+ * Later, we'll read PATH_DOTCONFIG and reconfigure serial according
+ * to the configuration provided.
+ */
+opts = OPT_SET(RBX_DUAL);
+ioctrl = (IO_SERIAL|IO_KEYBOARD);
+if (sio_init(115200) != 0)
+   ioctrl &= ~IO_SERIAL;
+
 dsk = malloc(sizeof(struct dsk));
 dsk->drive = *(uint8_t *)PTOV(ARGS);
 dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD;
___
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: r335259 - head/tools/boot

2018-06-16 Thread Allan Jude
Author: allanjude
Date: Sat Jun 16 17:45:44 2018
New Revision: 335259
URL: https://svnweb.freebsd.org/changeset/base/335259

Log:
  rootgen.sh: Don't copy various bits of the bootcode from the running system
  
  We want to use the versions of the bootcode we just built, rather than
  ones from whatever happens to be in /boot on the test machine
  
  These were incorrectly added by me in r334888

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Sat Jun 16 17:11:23 2018(r335258)
+++ head/tools/boot/rootgen.sh  Sat Jun 16 17:45:44 2018(r335259)
@@ -389,16 +389,8 @@ DESTDIR=${OBJDIR}/boot-tree
 rm -rf ${DESTDIR}
 mkdir -p ${DESTDIR}/boot/defaults
 mkdir -p ${DESTDIR}/boot/kernel
-cp /boot/boot0 ${DESTDIR}/boot
-cp /boot/boot0sio ${DESTDIR}/boot
-cp /boot/pmbr ${DESTDIR}/boot
-cp /boot/boot ${DESTDIR}/boot
 # XXX boot1 exists only on sparc64
 cp /boot/boot1 ${DESTDIR}/boot
-cp /boot/boot1.efifat ${DESTDIR}/boot
-cp /boot/gptboot ${DESTDIR}/boot
-cp /boot/gptzfsboot ${DESTDIR}/boot
-cp /boot/loader ${DESTDIR}/boot
 cp /boot/kernel/kernel ${DESTDIR}/boot/kernel
 echo -h -D -S115200 > ${DESTDIR}/boot.config
 # XXX
___
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: r335254 - in head/stand/i386: libi386 zfsboot

2018-06-16 Thread Allan Jude
Author: allanjude
Date: Sat Jun 16 15:16:02 2018
New Revision: 335254
URL: https://svnweb.freebsd.org/changeset/base/335254

Log:
  Avoid reading past the end of the disk in zfsboot.c and biosdisk.c
  
  The GELI boot code rounds reads up to 4k, since the encrypted sectors are
  4k, and must be decrypted as a unit. With oddball sized disks (almost
  always virtual), this can lead to reading past the end of the disk.
  
  Reviewed by:  imp, tsoome
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15844

Modified:
  head/stand/i386/libi386/biosdisk.c
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/i386/libi386/biosdisk.c
==
--- head/stand/i386/libi386/biosdisk.c  Sat Jun 16 15:05:05 2018
(r335253)
+++ head/stand/i386/libi386/biosdisk.c  Sat Jun 16 15:16:02 2018
(r335254)
@@ -882,6 +882,12 @@ bd_read(struct disk_devdesc *dev, daddr_t dblk, int bl
}
}
 
+   if (alignlba + alignblks > BD(dev).bd_sectors) {
+   DEBUG("Shorted read at %llu from %d to %llu blocks",
+   alignlba, alignblks, BD(dev).bd_sectors - alignlba);
+   alignblks = BD(dev).bd_sectors - alignlba;
+   }
+
err = bd_io(dev, alignlba, alignblks, tmpbuf, 0);
if (err)
return (err);

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Sat Jun 16 15:05:05 2018
(r335253)
+++ head/stand/i386/zfsboot/zfsboot.c   Sat Jun 16 15:16:02 2018
(r335254)
@@ -209,6 +209,12 @@ vdev_read(void *xvdev, void *priv, off_t off, void *bu
alignnb = roundup2(nb * DEV_BSIZE + diff, DEV_GELIBOOT_BSIZE)
/ DEV_BSIZE;
 
+   if (dsk->size > 0 && alignlba + alignnb > dsk->size + 
dsk->start) {
+   printf("Shortening read at %lld from %d to %lld\n", 
alignlba,
+   alignnb, (dsk->size + dsk->start) - alignlba);
+   alignnb = (dsk->size + dsk->start) - alignlba;
+   }
+
if (drvread(dsk, dmadat->rdbuf, alignlba, alignnb))
return -1;
 #ifdef LOADER_GELI_SUPPORT
@@ -694,7 +700,7 @@ main(void)
 dsk->slice = *(uint8_t *)PTOV(ARGS + 1) + 1;
 dsk->part = 0;
 dsk->start = 0;
-dsk->size = 0;
+dsk->size = drvsize_ext(dsk);
 
 bootinfo.bi_version = BOOTINFO_VERSION;
 bootinfo.bi_size = sizeof(bootinfo);
@@ -745,7 +751,7 @@ main(void)
dsk->slice = 0;
dsk->part = 0;
dsk->start = 0;
-   dsk->size = 0;
+   dsk->size = drvsize_ext(dsk);
probe_drive(dsk);
 }
 
___
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: r335248 - head/stand/i386/libi386

2018-06-16 Thread Allan Jude
Author: allanjude
Date: Sat Jun 16 06:23:07 2018
New Revision: 335248
URL: https://svnweb.freebsd.org/changeset/base/335248

Log:
  biosdisk.c: fix type in debug printf
  
  Sponsored by: Klara Systems

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==
--- head/stand/i386/libi386/biosdisk.c  Sat Jun 16 05:58:33 2018
(r335247)
+++ head/stand/i386/libi386/biosdisk.c  Sat Jun 16 06:23:07 2018
(r335248)
@@ -635,7 +635,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s
 #endif
break;
 case F_WRITE :
-   DEBUG("write %d from %d to %p", blks, dblk, buf);
+   DEBUG("write %d from %lld to %p", blks, dblk, buf);
 
if (blks && bd_write(dev, dblk, blks, buf)) {
DEBUG("write error");
___
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: r335247 - head/stand/i386/libi386

2018-06-16 Thread Allan Jude
Author: allanjude
Date: Sat Jun 16 05:58:33 2018
New Revision: 335247
URL: https://svnweb.freebsd.org/changeset/base/335247

Log:
  biosdisk.c: add missing \n to error message
  
  Sponsored by: Klara Systems

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==
--- head/stand/i386/libi386/biosdisk.c  Sat Jun 16 04:50:40 2018
(r335246)
+++ head/stand/i386/libi386/biosdisk.c  Sat Jun 16 05:58:33 2018
(r335247)
@@ -619,7 +619,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s
if (blks && (rc = bd_read(dev, dblk, blks, buf))) {
/* Filter out floppy controller errors */
if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) {
-   printf("read %d from %lld to %p, error: 0x%x", blks, dblk,
+   printf("read %d from %lld to %p, error: 0x%x\n", blks, dblk,
buf, rc);
}
return (EIO);
___
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: r335246 - head/stand/i386/libi386

2018-06-15 Thread Allan Jude
Author: allanjude
Date: Sat Jun 16 04:50:40 2018
New Revision: 335246
URL: https://svnweb.freebsd.org/changeset/base/335246

Log:
  biosdisk.c remove redundant variable
  
  `rdev` and `disk` serve the same purpose, read the partition table without
  the `d_offset` or `d_slice` set, so the read is relative to the start of
  the disk. Reuse the already initialized `disk` instead of making another
  copy later.
  
  Sponsored by: Klara Systems

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==
--- head/stand/i386/libi386/biosdisk.c  Sat Jun 16 02:50:29 2018
(r335245)
+++ head/stand/i386/libi386/biosdisk.c  Sat Jun 16 04:50:40 2018
(r335246)
@@ -379,7 +379,7 @@ bd_print(int verbose)
 static int
 bd_open(struct open_file *f, ...)
 {
-   struct disk_devdesc *dev, rdev;
+   struct disk_devdesc *dev;
struct disk_devdesc disk;
int err, g_err;
va_list ap;
@@ -445,11 +445,8 @@ bd_open(struct open_file *f, ...)
dskp.part = dev->d_partition;
dskp.start = dev->d_offset;
 
-   memcpy(, dev, sizeof(rdev));
-   /* to read the GPT table, we need to read the first sector */
-   rdev.d_offset = 0;
/* We need the LBA of the end of the partition */
-   table = ptable_open(, BD(dev).bd_sectors,
+   table = ptable_open(, BD(dev).bd_sectors,
BD(dev).bd_sectorsize, ptblread);
if (table == NULL) {
DEBUG("Can't read partition table");
___
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: r335245 - head/stand/i386/libi386

2018-06-15 Thread Allan Jude
Author: allanjude
Date: Sat Jun 16 02:50:29 2018
New Revision: 335245
URL: https://svnweb.freebsd.org/changeset/base/335245

Log:
  Correct logic error in biosdisk.c:bd_realstrategy()
  
  The wrong condition is used when evaluating the return of disk_ioctl()
  This results in reaching the 'We should not get here' branch in most casts
  
  Reviewed by:  imp
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15839

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==
--- head/stand/i386/libi386/biosdisk.c  Sat Jun 16 00:35:19 2018
(r335244)
+++ head/stand/i386/libi386/biosdisk.c  Sat Jun 16 02:50:29 2018
(r335245)
@@ -594,8 +594,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s
*rsize = 0;
 
 /* Get disk blocks, this value is either for whole disk or for partition */
-if (disk_ioctl(dev, DIOCGMEDIASIZE, _blocks)) {
-   /* DIOCGMEDIASIZE does return bytes. */
+if (disk_ioctl(dev, DIOCGMEDIASIZE, _blocks) == 0) {
+   /* DIOCGMEDIASIZE returns bytes. */
 disk_blocks /= BD(dev).bd_sectorsize;
 } else {
/* We should not get here. Just try to 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"


Re: svn commit: r334514 - head/usr.bin/top

2018-06-13 Thread Allan Jude
On 2018-06-01 23:25, Eitan Adler wrote:
> Author: eadler
> Date: Sat Jun  2 03:25:15 2018
> New Revision: 334514
> URL: https://svnweb.freebsd.org/changeset/base/334514
> 
> Log:
>   top(1): Use standard boolean rather than homegrown alternative
> 
> Deleted:
>   head/usr.bin/top/boolean.h
> Modified:
>   head/usr.bin/top/commands.c
>   head/usr.bin/top/display.c
>   head/usr.bin/top/machine.c
>   head/usr.bin/top/screen.c
>   head/usr.bin/top/top.1
>   head/usr.bin/top/top.c
> 
> Modified: head/usr.bin/top/machine.c
> ==
> --- head/usr.bin/top/machine.cSat Jun  2 02:06:48 2018
> (r334513)
> +++ head/usr.bin/top/machine.cSat Jun  2 03:25:15 2018
> (r334514)
> @@ -35,6 +35,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -308,7 +309,7 @@ machine_init(struct statics *statics)
>  {
>   int i, j, empty, pagesize;
>   uint64_t arc_size;
> - boolean_t carc_en;
> + bool carc_en;
>   size_t size;
>  
>   size = sizeof(smpmode);
> 

This broke compressed ARC display in top. The sysctl
vfs.zfs.compressed_arc_enabled is backed by a boolean_t (which is the
same size as an int), so trying to read it into a bool (1 byte) fails
and returns ENOMEM.

Fixed in r335099

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r335099 - head/usr.bin/top

2018-06-13 Thread Allan Jude
Author: allanjude
Date: Thu Jun 14 00:10:16 2018
New Revision: 335099
URL: https://svnweb.freebsd.org/changeset/base/335099

Log:
  Fix top(1) support for displaying ZFS Compressed ARC statistics
  
  Broken in r334514
  
  sysctlbyname("vfs.zfs.compressed_arc_enabled", ...) would return ENOMEM
  while trying to read the sysctl (a boolean_t) into a bool, which is too small.
  
  Reviewed by:  jhb (on irc)
  Sponsored by: Klara Systems

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Thu Jun 14 00:03:44 2018(r335098)
+++ head/usr.bin/top/machine.c  Thu Jun 14 00:10:16 2018(r335099)
@@ -304,7 +304,7 @@ machine_init(struct statics *statics)
 {
int i, j, empty, pagesize;
uint64_t arc_size;
-   bool carc_en;
+   int carc_en;
size_t size;
 
size = sizeof(smpmode);
___
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: r334887 - head/tools/boot

2018-06-09 Thread Allan Jude
Author: allanjude
Date: Sat Jun  9 17:47:56 2018
New Revision: 334887
URL: https://svnweb.freebsd.org/changeset/base/334887

Log:
  Change rootgen.sh to use the default ZFS boot environment name
  
  Reviewed by:  imp (maintainer)
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15699

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Sat Jun  9 17:40:31 2018(r334886)
+++ head/tools/boot/rootgen.sh  Sat Jun  9 17:47:56 2018(r334887)
@@ -96,7 +96,7 @@ mk_nogeli_gpt_zfs_legacy() {
 # install-boot will make this bootable
 zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2
 zpool set bootfs=${pool} ${pool}
-zfs create -o mountpoint=/ ${pool}/ROOT
+zfs create -po mountpoint=/ ${pool}/ROOT/default
 # NB: The online guides go nuts customizing /var and other mountpoints 
here, no need
 cpsys ${src} ${mntpt}
 df
@@ -109,9 +109,9 @@ EOF
 cp /boot/kernel/opensolaris.ko ${mntpt}/boot/kernel/opensolaris.ko
 ls -las ${mntpt}/boot
 # end tweaks
-zfs umount -f ${pool}/ROOT
-zfs set mountpoint=none ${pool}/ROOT
-zpool set bootfs=${pool}/ROOT ${pool}
+zfs umount -f ${pool}/ROOT/default
+zfs set mountpoint=none ${pool}/ROOT/default
+zpool set bootfs=${pool}/ROOT/default ${pool}
 zpool set autoexpand=on ${pool}
 zpool export ${pool}
 ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b 
${bios} -d ${src} ${md}
___
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: r334888 - head/tools/boot

2018-06-09 Thread Allan Jude
Author: allanjude
Date: Sat Jun  9 17:49:43 2018
New Revision: 334888
URL: https://svnweb.freebsd.org/changeset/base/334888

Log:
  Add ZFS+GPT EFI and LEGACY+EFI to rootgen.sh and installboot.sh
  
  Reviewed by:  imp (maintainer)
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D15700

Modified:
  head/tools/boot/install-boot.sh
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/install-boot.sh
==
--- head/tools/boot/install-boot.sh Sat Jun  9 17:47:56 2018
(r334887)
+++ head/tools/boot/install-boot.sh Sat Jun  9 17:49:43 2018
(r334888)
@@ -51,6 +51,37 @@ boot_nogeli_gpt_ufs_legacy() {
 exit 0
 }
 
+boot_nogeli_gpt_zfs_uefi() {
+dev=$1
+dst=$2
+
+idx=$(find-part $dev "efi")
+if [ -z "$idx" ] ; then
+   die "No efi ESP partition found"
+fi
+doit gpart bootcode -p ${efi2} -i $idx $dev
+exit 0
+}
+
+boot_nogeli_gpt_zfs_both() {
+dev=$1
+dst=$2
+
+# XXX: Should this be copy/pasted, or should it call both _uefi and _legacy
+idx=$(find-part $dev "efi")
+if [ -z "$idx" ] ; then
+   die "No efi ESP partition found"
+fi
+doit gpart bootcode -p ${efi2} -i $idx $dev
+
+idx=$(find-part $dev "freebsd-boot")
+if [ -z "$idx" ] ; then
+   die "No freebsd-boot partition found"
+fi
+doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
+exit 0
+}
+
 boot_nogeli_mbr_zfs_legacy() {
 dev=$1
 dst=$2
@@ -133,6 +164,10 @@ dev=$1
 gpt0=${DESTDIR}/boot/pmbr
 gpt2=${DESTDIR}/boot/gptboot
 gptzfs2=${DESTDIR}/boot/gptzfsboot
+
+# For gpt + EFI we install the ESP
+# XXX This should use newfs or makefs, but it deosn't yet
+efi2=${DESTDIR}/boot/boot1.efifat
 
 # For MBR, we have lots of choices, but select boot0
 mbr0=${DESTDIR}/boot/boot0

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Sat Jun  9 17:47:56 2018(r334887)
+++ head/tools/boot/rootgen.sh  Sat Jun  9 17:49:43 2018(r334888)
@@ -119,9 +119,84 @@ EOF
 }
 
 mk_nogeli_gpt_zfs_uefi() {
+src=$1
+img=$2
+mntpt=$3
+geli=$4
+scheme=$5
+fs=$6
+bios=$7
+pool=nogeli-gpt-zfs-uefi
+
+dd if=/dev/zero of=${img} count=1 seek=$((200 * 1024 * 1024 / 512))
+md=$(mdconfig -f ${img})
+gpart create -s gpt ${md}
+gpart add -t efi -s 800k -a 4k ${md}
+gpart add -t freebsd-zfs -l root $md
+# install-boot will make this bootable
+zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2
+zpool set bootfs=${pool} ${pool}
+zfs create -po mountpoint=/ ${pool}/ROOT/default
+# NB: The online guides go nuts customizing /var and other mountpoints 
here, no need
+cpsys ${src} ${mntpt}
+df
+# need to make a couple of tweaks
+cat > ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < $sh
-echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive 
file=${img},format=raw ${qser}" > $sh
+echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive 
file=${img},format=raw ${qser}" >> $sh
 }
 
 # arm
@@ -288,7 +363,7 @@ qemu_i386_both()
 sh=$2
 
 echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh
-echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive 
file=${img},format=raw ${qser}" > $sh
+echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive 
file=${img},format=raw ${qser}" >> $sh
 }
 
 # mips
@@ -314,8 +389,15 @@ DESTDIR=${OBJDIR}/boot-tree
 rm -rf ${DESTDIR}
 mkdir -p ${DESTDIR}/boot/defaults
 mkdir -p ${DESTDIR}/boot/kernel
+cp /boot/boot0 ${DESTDIR}/boot
+cp /boot/boot0sio ${DESTDIR}/boot
+cp /boot/pmbr ${DESTDIR}/boot
+cp /boot/boot ${DESTDIR}/boot
 # XXX boot1 exists only on sparc64
 cp /boot/boot1 ${DESTDIR}/boot
+cp /boot/boot1.efifat ${DESTDIR}/boot
+cp /boot/gptboot ${DESTDIR}/boot
+cp /boot/gptzfsboot ${DESTDIR}/boot
 cp /boot/loader ${DESTDIR}/boot
 cp /boot/kernel/kernel ${DESTDIR}/boot/kernel
 echo -h -D -S115200 > ${DESTDIR}/boot.config
___
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: r332559 - head/usr.sbin/mountd

2018-04-19 Thread Allan Jude

On 2018-04-16 8:02 PM, Rick Macklem wrote:

I wrote:

Julian Elischer wrote:

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

[stuff snipped]

+ngroups =3D XU_NGROUPS + 1;

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

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

16 is the limit specified in the RFCs for Sun RPC, so that is the "on the wire" 
limit.
I haven't looked at the code. It might make sense to handle more here and then
set the limit at 16 after getting rid of duplicates, but I have no idea if =
it matters?

rick

Correcting my own post. Now that I've looked at the code, this doesn't go on
the wire. It does go in the exports structure, which means that this structure
would have to be revised (along with the syscall and VOP calls and the kernel
code that uses it). These credentials are for the "maproot/mapall" export
option and revising the export structure seems like quite a bit of work for this
case. (Until revised XU_NGROUPS is the correct value to set it to, since there
is a "struct xucred" in the exports structure.)

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

rick



I second the request for FSID as an export option. It is important for 
having smooth failover between NFS servers.


--
Allan Jude
___
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: r332662 - head/usr.sbin/iostat

2018-04-17 Thread Allan Jude
Author: allanjude
Date: Wed Apr 18 02:25:03 2018
New Revision: 332662
URL: https://svnweb.freebsd.org/changeset/base/332662

Log:
  Make `iostat -xC` print CPU information on its own line
  
  Requested by: mahrens
  Reviewed by:  kenm (maintainer), mahrens
  MFC after:1 week
  Relnotes: yes
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D15076

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

Modified: head/usr.sbin/iostat/iostat.c
==
--- head/usr.sbin/iostat/iostat.c   Tue Apr 17 22:33:41 2018
(r332661)
+++ head/usr.sbin/iostat/iostat.c   Wed Apr 18 02:25:03 2018
(r332662)
@@ -802,11 +802,15 @@ devstats(int perf_select, long double etime, int havel
char *devicename;
 
if (xflag > 0) {
+   if (Cflag > 0) {
+   printf("  cpu\n");
+   printf(" us ni sy in id\n");
+   cpustats();
+   printf("\n");
+   }
printf("extended device statistics  ");
if (Tflag > 0)
printf("  tty ");
-   if (Cflag > 0)
-   printf("   cpu ");
printf("\n");
if (Iflag == 0) {
printf("device   r/s w/s kr/s kw/s "
@@ -817,8 +821,6 @@ devstats(int perf_select, long double etime, int havel
}
if (Tflag > 0)
printf("tin  tout ");
-   if (Cflag > 0)
-   printf("us ni sy in id ");
printf("\n");
}
 
@@ -922,8 +924,6 @@ devstats(int perf_select, long double etime, int havel
printf("%4.0Lf%5.0Lf",
cur.tk_nin / etime,
cur.tk_nout / etime);
-   if (Cflag > 0)
-   cpustats();
}
printf("\n");
}
___
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: r315449 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-04-10 Thread Allan Jude
On 2018-02-25 22:56, Allan Jude wrote:
> On 2017-03-17 08:34, Steven Hartland wrote:
>> Author: smh
>> Date: Fri Mar 17 12:34:57 2017
>> New Revision: 315449
>> URL: https://svnweb.freebsd.org/changeset/base/315449
>>
>> Log:
>>   Reduce ARC fragmentation threshold
>>   
>>   As ZFS can request up to SPA_MAXBLOCKSIZE memory block e.g. during zfs 
>> recv,
>>   update the threshold at which we start agressive reclamation to use
>>   SPA_MAXBLOCKSIZE (16M) instead of the lower zfs_max_recordsize which
>>   defaults to 1M.
>>   
>>   PR:194513
>>   Reviewed by:   avg, mav
>>   MFC after: 1 month
>>   Sponsored by:  Multiplay
>>   Differential Revision: https://reviews.freebsd.org/D10012
>>
>> Modified:
>>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
>>
>> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
>> ==
>> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.cFri Mar 
>> 17 12:34:56 2017(r315448)
>> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.cFri Mar 
>> 17 12:34:57 2017(r315449)
>> @@ -3978,7 +3978,7 @@ arc_available_memory(void)
>>   * Start aggressive reclamation if too little sequential KVA left.
>>   */
>>  if (lowest > 0) {
>> -n = (vmem_size(heap_arena, VMEM_MAXFREE) < zfs_max_recordsize) ?
>> +n = (vmem_size(heap_arena, VMEM_MAXFREE) < SPA_MAXBLOCKSIZE) ?
>>  -((int64_t)vmem_size(heap_arena, VMEM_ALLOC) >> 4) :
>>  INT64_MAX;
>>  if (n < lowest) {
>>
> 
> I have some users reporting excessive ARC shrinking in 11.1 vs 11.0 due
> to this change.
> 
> Memory seems quite fragmented, and this change makes it much more
> sensitive to that, but the problem seems to be that is can get to
> aggressive.
> 
> The most recent case, the machine has 128GB of ram, and no other major
> processes running, just ZFS zvols being served over iSCIS by ctld.
> 
> arc_max set to 85GB, rather conservative. After running for a few days,
> fragmentation seems to trip this line, when there are no 16mb contiguous
> blocks, and it shrinks the ARC by 1/16th of memory, but this does not
> result in a 16mb contiguous chunk, so it shrinks the ARC by another
> 1/16th, and again until it hits arc_min. Apparently eventually the ARC
> does regrow, but then crashes again later.
> 
> You can see the ARC oscillating between arc_max and arc_min, with some
> long periods pinned at arc_min: https://imgur.com/a/emztF
> 
> 
> [root@ZFS-AF ~]# vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=0;
> cache=0; used=0 } {u = $2 * $4; c = $2 * $5; t = u + c; cache += c; used
> += u; total += t; name=$1; gsub(" ", "_", name); print t, name, u, c}
> END { print total, "TOTAL", used, cache } ' | sort -n | perl -a -p -e
> 'while (($j, $_) = each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; print
> $_, " "} print "\n"' | column -t | tail

TOTAL  NAME   USED Cache

> 1,723,367,424zio_data_buf_49152 1,722,875,904491,520
> 1,827,057,664zio_buf_4096   1,826,848,768208,896
> 2,289,459,200zio_data_buf_40960 2,289,090,560368,640
> 3,642,736,640zio_data_buf_81920 3,642,408,960327,680
> 6,713,180,160zio_data_buf_98304 6,712,688,640491,520
> 9,388,195,840zio_buf_8192   9,388,064,768131,072
> 11,170,152,448   zio_data_buf_11468811,168,890,880   1,261,568
> 29,607,329,792   zio_data_buf_13107229,606,674,432   655,360
> 32,944,750,592   zio_buf_65536  32,943,833,088   917,504
> 114,235,296,752  TOTAL  111,787,212,900  2,448,083,852
> 
> 
> [root@ZFS-AF ~]# vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=0;
> cache=0; used=0 } {u = $2 * $4; c = $2 * $5; t = u + c; cache += c; used
> += u; total += t; name=$1; gsub(" ", "_", name); print t, name, u, c}
> END { print total, "TOTAL", used, cache } ' | sort -n +3 | perl -a -p -e
> 'while (($j, $_) = each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; print
> $_, " "} print "\n"' | column -t | tail

Sorted by cache (waste)

TOTAL  NAME   USED Cache

> 71,565,312   cblk15 071,565,312
> 72,220,672   cblk16 072,220,672
> 72,351,744   cblk18 131,072  72,220,672
> 72,744,960  

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

2018-04-10 Thread Allan Jude
On 2018-04-10 09:56, Mark Johnston wrote:
> Author: markj
> Date: Tue Apr 10 13:56:06 2018
> New Revision: 332365
> URL: https://svnweb.freebsd.org/changeset/base/332365
> 
> Log:
>   Set zfs_arc_free_target to v_free_target.
>   
>   Page daemon output is now regulated by a PID controller with a setpoint
>   of v_free_target. Moreover, the page daemon now wakes up regularly
>   rather than waiting for a wakeup from another thread. This means that
>   the free page count is unlikely to drop below the old
>   zfs_arc_free_target value, and as a result the ARC was not readily
>   freeing pages under memory pressure. Address the immediate problem by
>   updating zfs_arc_free_target to match the page daemon's new behaviour.
>   
>   Reported and tested by: truckman
>   Discussed with: jeff
>   X-MFC with: r329882
>   Differential Revision:  https://reviews.freebsd.org/D14994
> 

On a somewhat unrelated note, can we rename this sysctl and change to be
counted in bytes? When users are tuning ZFS, every other ZFS value is in
bytes, not pages.

Maybe keep the currently variable as it is, in pages, and adjust it by
dividing the user set value by the page size.

The current name is great, but I wouldn't want anyone to end up setting
it to 4096x the value they actually want if we just changed it out from
under them.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r332070 - in head/sys/geom: . label raid

2018-04-05 Thread Allan Jude
On 2018-04-05 21:20, Conrad Meyer wrote:
> On Thu, Apr 5, 2018 at 6:08 PM, Allan Jude <allanj...@freebsd.org> wrote:
>> On 2018-04-05 09:56, Sean Bruno wrote:
>>> Author: sbruno
>>> Date: Thu Apr  5 13:56:40 2018
>>> New Revision: 332070
>>> URL: https://svnweb.freebsd.org/changeset/base/332070
>>>
>>> Log:
>>>   Squash error from geom by sizing ident strings to DISK_IDENT_SIZE.
>>>
>>> ...
>> I might be missing something here, but it seems like you didn't actually
>> change the side of
>> ...
>> struct md_s
> 
> The md side can be as small as it likes.  It's the caller who needs to
> provide the large buffer, for other providers of the GEOM::ident
> attribute.
> 
>> And I don't see where the destination buffer went from 24 bytes to a
>> larger value.
> 
> Check the change in md_intel.c.
> 
> Best,
> Conrad
> 

Right, but md_intel.c is for intel BIOS raid.

I don't see the change that increased the size of the buffer in the
caller from 24 bytes to something more useful?

Or was it md_intel tasting the md(4) device?

-- 
Allan Jude
___
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: r332070 - in head/sys/geom: . label raid

2018-04-05 Thread Allan Jude
On 2018-04-05 09:56, Sean Bruno wrote:
> Author: sbruno
> Date: Thu Apr  5 13:56:40 2018
> New Revision: 332070
> URL: https://svnweb.freebsd.org/changeset/base/332070
> 
> Log:
>   Squash error from geom by sizing ident strings to DISK_IDENT_SIZE.
>   
>   Display attribute in future error strings and differentiate g_handleattr()
>   error messages for ease of debugging in the future.
>   
>   "g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT"
>   
>   Reported by:swills
>   Reviewed by:imp cem avg
>   Sponsored by:   Limelight Networks
>   Differential Revision:  https://reviews.freebsd.org/D14962
> 
> Modified:
>   head/sys/geom/geom_subr.c
>   head/sys/geom/label/g_label_disk_ident.c
>   head/sys/geom/raid/md_ddf.c
>   head/sys/geom/raid/md_intel.c
> 
I might be missing something here, but it seems like you didn't actually
change the side of

struct md_s {
...
 char ident[32];
...
}

And I don't see where the destination buffer went from 24 bytes to a
larger value.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


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

2018-02-25 Thread Allan Jude
how quickly the ARC will shrink?

What kind of tools do we have to look at why memory is so fragmented
that ZFS feels the need to tank the ARC?



I know this block and the FMR_ZIO_FRAG reason have been removed from
-CURRENT as part of the NUMA work, but I am worried about addressing
this issue for the upcoming 11.2-RELEASE.



-- 
Allan Jude
___
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: r329814 - head/sys/cam

2018-02-21 Thread Allan Jude
On 2018-02-22 01:07, O. Hartmann wrote:
> On Thu, 22 Feb 2018 05:43:50 + (UTC)
> Warner Losh <i...@freebsd.org> wrote:
> 
>> Author: imp
>> Date: Thu Feb 22 05:43:50 2018
>> New Revision: 329814
>> URL: https://svnweb.freebsd.org/changeset/base/329814
>>
>> Log:
>>   Note when we tick.
>>   
>>   To help implement a policy of 'queue all trims until next I/O sched
>>   tick' policy to help coalesce them, note when we tick so we can do
>>   something special on the first call after the tick to get more work.
>>   
>>   Sponsored by: Netflix
>>
>> Modified:
>>   head/sys/cam/cam_iosched.c
>>
>> Modified: head/sys/cam/cam_iosched.c
>> ==
>> --- head/sys/cam/cam_iosched.c   Thu Feb 22 05:43:45 2018
>> (r329813) +++ head/sys/cam/cam_iosched.c Thu Feb 22 05:43:50
>> 2018 (r329814) @@ -60,6 +60,19 @@ static MALLOC_DEFINE(M_CAMSCHED,
>> "CAM I/O Scheduler", "CAM I/O Scheduler buffers");
>>  
>>  /*
>> + * Trim or similar currently pending completion. Should only be set for
>> + * those drivers wishing only one Trim active at a time.
>> + */
>> +#define CAM_IOSCHED_FLAG_TRIM_ACTIVE(1ul << 0)
>> +/* Callout active, and needs to be torn down */
>> +#define CAM_IOSCHED_FLAG_CALLOUT_ACTIVE (1ul << 1)
>> +/* Timer has just ticked */
>> +#define CAM_IOSCHED_FLAG_TICK   (1ul << 2)
>> +
>> +/* Periph drivers set these flags to indicate work */
>> +#define CAM_IOSCHED_FLAG_WORK_FLAGS ((0xu) << 16)
>> +
>> +/*
>>   * Default I/O scheduler for FreeBSD. This implementation is just a
>> thin-vineer
>>   * over the bioq_* interface, with notions of separate calls for normal I/O
>> and
>>   * for trims.
>> @@ -574,6 +587,7 @@ cam_iosched_ticker(void *arg)
>>  cam_iosched_limiter_tick(>write_stats);
>>  cam_iosched_limiter_tick(>trim_stats);
>>  
>> +isc->flags |= CAM_IOSCHED_FLAGS_TICK;
>>  cam_iosched_schedule(isc, isc->periph);
>>  
>>  /*
>> @@ -701,17 +715,6 @@ cam_iosched_cl_maybe_steer(struct control_loop *clp)
>>  }
>>  #endif
>>  
>> -/*
>> - * Trim or similar currently pending completion. Should only be set for
>> - * those drivers wishing only one Trim active at a time.
>> - */
>> -#define CAM_IOSCHED_FLAG_TRIM_ACTIVE(1ul << 0)
>> -/* Callout active, and needs to be torn down */
>> -#define CAM_IOSCHED_FLAG_CALLOUT_ACTIVE (1ul << 1)
>> -
>> -/* Periph drivers set these flags to indicate work */
>> -#define CAM_IOSCHED_FLAG_WORK_FLAGS ((0xu) << 16)
>> -
>>  #ifdef CAM_IOSCHED_DYNAMIC
>>  static void
>>  cam_iosched_io_metric_update(struct cam_iosched_softc *isc,
>> @@ -1322,6 +1325,10 @@ struct bio *
>>  cam_iosched_next_bio(struct cam_iosched_softc *isc)
>>  {
>>  struct bio *bp;
>> +bool wastick;
>> +
>> +wastick = !!(isc->flags & CAM_IOSCHED_FLAGS_TICK);
>> +isc->flags &= ~CAM_IOSCHED_FLAGS_TICK;
>>  
>>  /*
>>   * See if we have a trim that can be scheduled. We can only send one
>> ___
>> 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"
> 
> A recent buildworld/buildkernel failed with this error just right now:
> 
> --- cam_iosched.o ---
> /usr/src/sys/cam/cam_iosched.c:593:16: error: use of undeclared identifier
> 'CAM_IOSCHED_FLAGS_TICK' isc->flags |= CAM_IOSCHED_FLAGS_TICK;
> 

Looks like a typo, FLAGS_TICK vs FLAG_TICK

-- 
Allan Jude
___
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: r329150 - head/etc/devd

2018-02-11 Thread Allan Jude
On 2018-02-12 00:28, Warner Losh wrote:
> 
> 
> On Sun, Feb 11, 2018 at 10:10 PM, Rodney W. Grimes
> <free...@pdx.rh.cn85.dnsmgr.net <mailto:free...@pdx.rh.cn85.dnsmgr.net>>
> wrote:
> 
> [ Charset UTF-8 unsupported, converting... ]
> > Author: imp
> > Date: Mon Feb 12 04:54:51 2018
> > New Revision: 329150
> > URL: https://svnweb.freebsd.org/changeset/base/329150
> <https://svnweb.freebsd.org/changeset/base/329150>
> >
> > Log:
> >   Install devmatch.conf, don't install usb.conf
> 
> Doesnt this break devd and anyone depending on it?
> 
> 
> I'm having problems understanding how it would break it?
>  
> 
> Does usb.conf need to go in OBSOLETEFILES now?
> 
> 
> Yes. It should...
>  
> 
> Relnotes y?
> 
> 
> Yes. It's hard to know where in the sequence of on-boarding a new
> function where to put it.
> 

Previously Release Engineering has said they'd rather you mark a few too
many things as Relnotes: Yes, than too few. In cases like this, it might
make sense to flag the entire series of commits, so a year from now re@
stands a better chance of writing a coherent paragraph about what the
change actually is, and how it impacts the user.

> Warner
>  
> 
> 
> > Modified:
> >   head/etc/devd/Makefile
> >
> > Modified: head/etc/devd/Makefile
> > 
> ==
> > --- head/etc/devd/Makefile    Mon Feb 12 04:52:25 2018        (r329149)
> > +++ head/etc/devd/Makefile    Mon Feb 12 04:54:51 2018        (r329150)
> > @@ -12,13 +12,14 @@ FILES+=   apple.conf
> >  .if ${MK_ACPI} != "no"
> >  FILES+=      asus.conf
> >  .endif
> > +FILES+=devmatch.conf
>           ^ missing tab
> 
> >  .if ${MK_HYPERV} != "no"
> >  FILES+=      hyperv.conf
> >  .endif
> >  .endif
> >
> >  .if ${MK_USB} != "no"
> > -FILES+=      uath.conf ulpt.conf usb.conf
> > +FILES+=      uath.conf ulpt.conf
> >  .endif
> >
> >  .if ${MK_ZFS} != "no"
> 
> --
> Rod Grimes                                               
>  rgri...@freebsd.org <mailto:rgri...@freebsd.org>
> 
> 


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r329126 - head/etc/devd

2018-02-11 Thread Allan Jude
On 2018-02-11 18:46, Rodney W. Grimes wrote:
> [ Charset ISO-8859-1 unsupported, converting... ]
>> On Sun, 2018-02-11 at 10:20 -0800, Conrad Meyer wrote:
>>> On Sun, Feb 11, 2018 at 8:35 AM, Ian Lepore <i...@freebsd.org> wrote:
>>>>
>>>> Author: ian
>>>> Date: Sun Feb 11 16:35:56 2018
>>>> New Revision: 329126
>>>> URL: https://svnweb.freebsd.org/changeset/base/329126
>>>>
>>>> Log:
>>>> ? Regenerate devd/usb.conf after the recent addition of several new
>>>> device IDs.
>>>>
>>>> Modified:
>>>> ? head/etc/devd/usb.conf
>>>
>>> If this file is machine generated and not an administrator
>>> configuration file, shouldn't it live in /usr/share instead of /etc,
>>> per hier(7)?
>>>
>>> Best,
>>> Conrad
>>>
>>
>> I wonder if that question would apply to all five files we put in
>> /etc/devd? ?It looks like they could be moved to /usr/share with
>> minimal fuss by adding that directory to the search list in
>> /etc/devd.conf.
> 
> Moving this to /usr creates a cyclic issue in that you then need
> /usr to be mounted before devd can start and devd's /etc/rc.d file
> says:
> # PROVIDE: devd
> # REQUIRE: NETWORKING
> # BEFORE: mountcritremote
> # KEYWORD: nojail
> 
> In the diskless and nfs shared /usr worlds devd wants to start
> before /usr is mounted.
> 
>> I'm agnostic about the value of moving them. ?Users can configure local
>> rules by modifying the existing devd.conf and files in devd/ and
>> dealing with mergemaster on updates, or by adding their own new files
>> in devd/.
> 

Maybe the correct place is /etc/defaults/devd/ then?

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r328839 - head/usr.sbin/bsdinstall/scripts

2018-02-04 Thread Allan Jude
Author: allanjude
Date: Sun Feb  4 12:16:36 2018
New Revision: 328839
URL: https://svnweb.freebsd.org/changeset/base/328839

Log:
  Add the ThinkPad X1 (sandybridge) to the bsdinstall blacklist
  
  MFC after:2 weeks
  Sponsored by: FOSDEM IllumOS Table

Modified:
  head/usr.sbin/bsdinstall/scripts/auto

Modified: head/usr.sbin/bsdinstall/scripts/auto
==
--- head/usr.sbin/bsdinstall/scripts/auto   Sun Feb  4 08:22:11 2018
(r328838)
+++ head/usr.sbin/bsdinstall/scripts/auto   Sun Feb  4 12:16:36 2018
(r328839)
@@ -182,7 +182,7 @@ if f_interactive; then
case "$sys_maker" in
"LENOVO")
case "$sys_version" in
-   "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad W520")
+   "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad 
W520"|"ThinkPad X1")
dialog_workaround "$msg_lenovo_fix"
retval=$?
f_dprintf "lenovofix_prompt=[%s]" "$retval"
___
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: r327940 - head/sys/contrib/zstd/lib/freebsd

2018-01-13 Thread Allan Jude
On 2018-01-13 14:54, Pedro Giffuni wrote:
> Hmm ...
> 
> 
> On 01/13/18 14:24, Conrad Meyer wrote:
>> This is not in contrib code --
>> https://lists.freebsd.org/pipermail/svn-src-all/2018-January/156505.html
>> .
> 
> Thanks, I read it late...
> 
> Shouldn't the local code be in usr.bin/zstd ?
> 
> Pedro.
> 

This .h file is only used for the kernel version of zstd, not the
userland version.

-- 
Allan Jude
___
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: r327934 - head/sys/contrib/zstd/lib/freebsd

2018-01-13 Thread Allan Jude
On 2018-01-13 14:23, Conrad Meyer wrote:
> On Sat, Jan 13, 2018 at 10:09 AM, Pedro F. Giffuni <p...@freebsd.org> wrote:
>> Author: pfg
>> Date: Sat Jan 13 18:09:09 2018
>> New Revision: 327934
>> URL: https://svnweb.freebsd.org/changeset/base/327934
>>
>> Log:
>>   zstd: Use memalloc(9) for calloc macro.
>>
>>   This is in contrib code but since we only have memalloc(9) in current we
>>   will not upstream this.
> 
> Fortunately, zstd_kfreebsd.h is not contrib code but local code.  We
> don't have to worry about upstreaming this change.  Please consider
> including review from Allan Jude, Warner, or myself on future zstd
> changes.  We've tried to be very careful not to modify contrib code.
> 
> For the record, though, I approve this change.
> 
> Best,
> Conrad
> 
>> Modified:
>>   head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h
> 

Looks good to me too

-- 
Allan Jude
___
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: r316980 - head/contrib/zstd/programs

2017-12-05 Thread Allan Jude
On 2017-12-05 20:17, Conrad Meyer wrote:
> Ping.  Please revert this change.  If you want zstd to behave this
> way, pursue it upstream first.
> 
> Thanks,
> Conrad
> 
> On Wed, Nov 15, 2017 at 7:38 PM, Conrad Meyer <c...@freebsd.org> wrote:
>> Please revert this change.
>>
>> First, it introduces the POLA-violating behavior that zstdcat deletes
>> its source files.  This is not how zcat/bzcat behaves.
>>
>> Second, it introduces a needless behavioral difference between FreeBSD
>> zstd and the rest of the world's zstd.  The zstd documentation we ship
>> continues to claim that zstd preserves source files by default, yet
>> this change makes that documentation exactly backwards.  While we can
>> change FreeBSD's documentation to accommodate the change, we can't
>> change Google results.
>>
>> Thanks,
>> Conrad
>>
>> On Sat, Apr 15, 2017 at 1:15 PM, Baptiste Daroussin <b...@freebsd.org> wrote:
>>> Author: bapt
>>> Date: Sat Apr 15 20:15:44 2017
>>> New Revision: 316980
>>> URL: https://svnweb.freebsd.org/changeset/base/316980
>>>
>>> Log:
>>>   Change some default to make zstd a dropin replacement for gzip,bzip etc
>>>   in most cases
>>>
>>>   Changes ares:
>>>   - quiet by default
>>>   - remove the source files one compression completion by default
>>>
>>> Modified:
>>>   head/contrib/zstd/programs/fileio.c
>>>   head/contrib/zstd/programs/zstdcli.c
>>>
>>> Modified: head/contrib/zstd/programs/fileio.c
>>> ==
>>> --- head/contrib/zstd/programs/fileio.c Sat Apr 15 20:06:24 2017
>>> (r316979)
>>> +++ head/contrib/zstd/programs/fileio.c Sat Apr 15 20:15:44 2017
>>> (r316980)
>>> @@ -138,7 +138,7 @@ static U32 g_dictIDFlag = 1;
>>>  void FIO_setDictIDFlag(unsigned dictIDFlag) { g_dictIDFlag = dictIDFlag; }
>>>  static U32 g_checksumFlag = 1;
>>>  void FIO_setChecksumFlag(unsigned checksumFlag) { g_checksumFlag = 
>>> checksumFlag; }
>>> -static U32 g_removeSrcFile = 0;
>>> +static U32 g_removeSrcFile = 1;
>>>  void FIO_setRemoveSrcFile(unsigned flag) { g_removeSrcFile = (flag>0); }
>>>  static U32 g_memLimit = 0;
>>>  void FIO_setMemLimit(unsigned memLimit) { g_memLimit = memLimit; }
>>>
>>> Modified: head/contrib/zstd/programs/zstdcli.c
>>> ==
>>> --- head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:06:24 2017
>>> (r316979)
>>> +++ head/contrib/zstd/programs/zstdcli.cSat Apr 15 20:15:44 2017    
>>> (r316980)
>>> @@ -61,7 +61,7 @@
>>>  #define MB *(1 <<20)
>>>  #define GB *(1U<<30)
>>>
>>> -#define DEFAULT_DISPLAY_LEVEL 2
>>> +#define DEFAULT_DISPLAY_LEVEL 1
>>>
>>>  static const char*g_defaultDictName = "dictionary";
>>>  static const unsigned g_defaultMaxDictSize = 110 KB;
>>>
> 

Upstream recommends we create an additional hardlink, called 'zz' (like
xz but zstd), to do such compatibility, and keep 'zstd' the same as zstd
on every other distro.

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r326507 - head/stand/i386/zfsboot

2017-12-03 Thread Allan Jude
Author: allanjude
Date: Mon Dec  4 02:42:00 2017
New Revision: 326507
URL: https://svnweb.freebsd.org/changeset/base/326507

Log:
  increase maximum size of zfsboot
  
  Previous to the switch from sys/boot to stand/ zfsboot (used for MBR) did
  not support GELI. Now that it is compiled with GELI, it is running out of
  space.
  
  zfsldr (which loads zfsboot) was modified to load 256kb in r304321

Modified:
  head/stand/i386/zfsboot/Makefile

Modified: head/stand/i386/zfsboot/Makefile
==
--- head/stand/i386/zfsboot/MakefileMon Dec  4 01:16:26 2017
(r326506)
+++ head/stand/i386/zfsboot/MakefileMon Dec  4 02:42:00 2017
(r326507)
@@ -62,10 +62,10 @@ zfsldr.out: zfsldr.o
 CLEANFILES+=   zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o
 
-# We currently allow 128k bytes for zfsboot - in practice it could be
+# We currently allow 256k bytes for zfsboot - in practice it could be
 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
 # 
-BOOT2SIZE= 131072
+BOOT2SIZE= 262144
 
 zfsboot2: zfsboot.ld
@set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
___
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: r326506 - in head/sys/contrib/zstd/lib: common compress

2017-12-03 Thread Allan Jude
Author: allanjude
Date: Mon Dec  4 01:16:26 2017
New Revision: 326506
URL: https://svnweb.freebsd.org/changeset/base/326506

Log:
  Use __has_builtin() to ensure clz and clzll builtins are available
  
  The existing check of the GCC version number is not sufficient
  
  This fixes the build on sparc64 in preparation for integrating ZSTD into
  the kernel for ZFS and Crash Dumps.

Modified:
  head/sys/contrib/zstd/lib/common/bitstream.h
  head/sys/contrib/zstd/lib/common/zstd_internal.h
  head/sys/contrib/zstd/lib/compress/zstd_compress.h

Modified: head/sys/contrib/zstd/lib/common/bitstream.h
==
--- head/sys/contrib/zstd/lib/common/bitstream.hMon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/common/bitstream.hMon Dec  4 01:16:26 
2017(r326506)
@@ -175,7 +175,7 @@ MEM_STATIC unsigned BIT_highbit32 (register U32 val)
 unsigned long r=0;
 _BitScanReverse ( , val );
 return (unsigned) r;
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */
+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && __has_builtin(__builtin_clz)  
 /* Use GCC Intrinsic */
 return 31 - __builtin_clz (val);
 #   else   /* Software version */
 static const unsigned DeBruijnClz[32] = { 0,  9,  1, 10, 13, 21,  2, 
29,

Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h
==
--- head/sys/contrib/zstd/lib/common/zstd_internal.hMon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/common/zstd_internal.hMon Dec  4 01:16:26 
2017(r326506)
@@ -327,7 +327,7 @@ MEM_STATIC U32 ZSTD_highbit32(U32 val)
 unsigned long r=0;
 _BitScanReverse(, val);
 return (unsigned)r;
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* GCC Intrinsic */
+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && __has_builtin(__builtin_clz)  
 /* GCC Intrinsic */
 return 31 - __builtin_clz(val);
 #   else   /* Software version */
 static const int DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 
14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 
4, 31 };

Modified: head/sys/contrib/zstd/lib/compress/zstd_compress.h
==
--- head/sys/contrib/zstd/lib/compress/zstd_compress.h  Mon Dec  4 01:14:17 
2017(r326505)
+++ head/sys/contrib/zstd/lib/compress/zstd_compress.h  Mon Dec  4 01:16:26 
2017(r326506)
@@ -203,7 +203,7 @@ static unsigned ZSTD_NbCommonBytes (register size_t va
 unsigned long r = 0;
 _BitScanReverse64( , val );
 return (unsigned)(r>>3);
-#   elif defined(__GNUC__) && (__GNUC__ >= 4)
+#   elif defined(__GNUC__) && (__GNUC__ >= 4) && 
__has_builtin(__builtin_clzll)
 return (__builtin_clzll(val) >> 3);
 #   else
 unsigned r;
@@ -218,7 +218,7 @@ static unsigned ZSTD_NbCommonBytes (register size_t va
 unsigned long r = 0;
 _BitScanReverse( , (unsigned long)val );
 return (unsigned)(r>>3);
-#   elif defined(__GNUC__) && (__GNUC__ >= 3)
+#   elif defined(__GNUC__) && (__GNUC__ >= 3) && 
__has_builtin(__builtin_clz)
 return (__builtin_clz((U32)val) >> 3);
 #   else
 unsigned r;
___
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"


  1   2   3   4   >