]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFV r322236: 8126 ztest assertion failed in dbuf_dirty due to dn_nlevels changing
Andriy Gapon [Tue, 8 Aug 2017 11:14:40 +0000 (11:14 +0000)]
MFV r322236: 8126 ztest assertion failed in dbuf_dirty due to dn_nlevels changing

illumos/illumos-gate@dcb6872c565819ac88acbc2ece999ef241c8b982
https://github.com/illumos/illumos-gate/commit/dcb6872c565819ac88acbc2ece999ef241c8b982

https://www.illumos.org/issues/8126
  The sync thread is concurrently modifying dn_phys->dn_nlevels
  while dbuf_dirty() is trying to assert something about it, without
  holding the necessary lock. We need to move this assertion further down
  in the function, after we have acquired the dn_struct_rwlock.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks

6 years ago8126 ztest assertion failed in dbuf_dirty due to dn_nlevels changing
Andriy Gapon [Tue, 8 Aug 2017 11:13:27 +0000 (11:13 +0000)]
8126 ztest assertion failed in dbuf_dirty due to dn_nlevels changing

illumos/illumos-gate@dcb6872c565819ac88acbc2ece999ef241c8b982
https://github.com/illumos/illumos-gate/commit/dcb6872c565819ac88acbc2ece999ef241c8b982

https://www.illumos.org/issues/8126
  The sync thread is concurrently modifying dn_phys->dn_nlevels
  while dbuf_dirty() is trying to assert something about it, without
  holding the necessary lock. We need to move this assertion further down
  in the function, after we have acquired the dn_struct_rwlock.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

6 years ago8067 zdb should be able to dump literal embedded block pointer
Andriy Gapon [Tue, 8 Aug 2017 11:10:37 +0000 (11:10 +0000)]
8067 zdb should be able to dump literal embedded block pointer

illumos/illumos-gate@4923c69fddc0887da5604a262585af3efd82ee20
https://github.com/illumos/illumos-gate/commit/4923c69fddc0887da5604a262585af3efd82ee20

https://www.illumos.org/issues/8067
  Add an option to zdb to print a literal embedded block pointer supplied on the
  command line:
  zdb -E [-A] word0:word1:...:word15

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

6 years agozfs: no need for __DECONST after abd constification in r322233
Andriy Gapon [Tue, 8 Aug 2017 11:07:34 +0000 (11:07 +0000)]
zfs: no need for __DECONST after abd constification in r322233

Note that vdev_label_write_pad2() is FreeBSD specific.

MFC after: 2 weeks
X-MFC after: r322233

6 years agoMFV r322232: 8426 mark immutable buffer arguments as such in abd.h
Andriy Gapon [Tue, 8 Aug 2017 10:59:18 +0000 (10:59 +0000)]
MFV r322232: 8426 mark immutable buffer arguments as such in abd.h

illumos/illumos-gate@9b195260e22529ac0e2580faaf89402420589c1c
https://github.com/illumos/illumos-gate/commit/9b195260e22529ac0e2580faaf89402420589c1c

https://www.illumos.org/issues/8426
  abd_copy_from_buf and abd_cmp_buf do not modify their void *buf arguments, so
  qualify them with const.
  abd_copy_from_buf_off and abd_cmp_buf_off already had that type for the
  corresponding arguments.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 2 weeks

6 years ago8426 mark immutable buffer arguments as such in abd.h
Andriy Gapon [Tue, 8 Aug 2017 10:58:01 +0000 (10:58 +0000)]
8426 mark immutable buffer arguments as such in abd.h

illumos/illumos-gate@9b195260e22529ac0e2580faaf89402420589c1c
https://github.com/illumos/illumos-gate/commit/9b195260e22529ac0e2580faaf89402420589c1c

https://www.illumos.org/issues/8426
  abd_copy_from_buf and abd_cmp_buf do not modify their void *buf arguments, so
  qualify them with const.
  abd_copy_from_buf_off and abd_cmp_buf_off already had that type for the
  corresponding arguments.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

6 years ago8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()
Andriy Gapon [Tue, 8 Aug 2017 10:55:42 +0000 (10:55 +0000)]
8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()

illumos/illumos-gate@ba6e7e6505150388de6dc6a88741164118a421bf
https://github.com/illumos/illumos-gate/commit/ba6e7e6505150388de6dc6a88741164118a421bf

https://www.illumos.org/issues/8430
  we should close dirfd if fdopendir() fails.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Sowrabha Gopal <sowrabha.gopal@delphix.com>

6 years agoMFV r322229: 7600 zfs rollback should pass target snapshot to kernel
Andriy Gapon [Tue, 8 Aug 2017 10:52:01 +0000 (10:52 +0000)]
MFV r322229: 7600 zfs rollback should pass target snapshot to kernel

illumos/illumos-gate@77b171372ed21642e04c873ef1e87fe2365520df
https://github.com/illumos/illumos-gate/commit/77b171372ed21642e04c873ef1e87fe2365520df

https://www.illumos.org/issues/7600
  At present, the kernel side code seems to blindly rollback to whatever happens
  to be the latest snapshot at the time when the rollback task is processed.
  The expected target's name should be passed to the kernel driver and the sync
  task should validate that the target exists and that it is the latest snapshot
  indeed.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 3 weeks

6 years ago7600 zfs rollback should pass target snapshot to kernel
Andriy Gapon [Tue, 8 Aug 2017 10:49:56 +0000 (10:49 +0000)]
7600 zfs rollback should pass target snapshot to kernel

illumos/illumos-gate@77b171372ed21642e04c873ef1e87fe2365520df
https://github.com/illumos/illumos-gate/commit/77b171372ed21642e04c873ef1e87fe2365520df

https://www.illumos.org/issues/7600
  At present, the kernel side code seems to blindly rollback to whatever happens
  to be the latest snapshot at the time when the rollback task is processed.
  The expected target's name should be passed to the kernel driver and the sync
  task should validate that the target exists and that it is the latest snapshot
  indeed.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

6 years agoMFV r322227: 8377 Panic in bookmark deletion
Andriy Gapon [Tue, 8 Aug 2017 10:48:52 +0000 (10:48 +0000)]
MFV r322227: 8377 Panic in bookmark deletion

illumos/illumos-gate@42418f9e73f0d007aa87675ecc206c26fc8e073e
https://github.com/illumos/illumos-gate/commit/42418f9e73f0d007aa87675ecc206c26fc8e073e

https://www.illumos.org/issues/8377
  The problem is that when dsl_bookmark_destroy_check() is executed from open
  context (the pre-check), it fills in dbda_success based on the existence of the
  bookmark.
  But the bookmark (or containing filesystem as in this case) can be destroyed
  before we get to syncing context. When we re-run dsl_bookmark_destroy_check()
  in syncing
  context, it will not add the deleted bookmark to dbda_success, intending for
  dsl_bookmark_destroy_sync() to not process it. But because the bookmark is
  still in dbda_success
  from the open-context call, we do try to destroy it.
  The fix is that dsl_bookmark_destroy_check() should not modify dbda_success
  when called from open context.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks

6 years ago8377 Panic in bookmark deletion
Andriy Gapon [Tue, 8 Aug 2017 10:47:56 +0000 (10:47 +0000)]
8377 Panic in bookmark deletion

illumos/illumos-gate@42418f9e73f0d007aa87675ecc206c26fc8e073e
https://github.com/illumos/illumos-gate/commit/42418f9e73f0d007aa87675ecc206c26fc8e073e

https://www.illumos.org/issues/8377
  The problem is that when dsl_bookmark_destroy_check() is executed from open
  context (the pre-check), it fills in dbda_success based on the existence of the
  bookmark.
  But the bookmark (or containing filesystem as in this case) can be destroyed
  before we get to syncing context. When we re-run dsl_bookmark_destroy_check()
  in syncing
  context, it will not add the deleted bookmark to dbda_success, intending for
  dsl_bookmark_destroy_sync() to not process it. But because the bookmark is
  still in dbda_success
  from the open-context call, we do try to destroy it.
  The fix is that dsl_bookmark_destroy_check() should not modify dbda_success
  when called from open context.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

6 years agoMFV r322223: 8378 crash due to bp in-memory modification of nopwrite block
Andriy Gapon [Tue, 8 Aug 2017 10:46:51 +0000 (10:46 +0000)]
MFV r322223: 8378 crash due to bp in-memory modification of nopwrite block

illumos/illumos-gate@b7edcb940884114e61382937505433c4c38c0278
https://github.com/illumos/illumos-gate/commit/b7edcb940884114e61382937505433c4c38c0278

https://www.illumos.org/issues/8378
  The problem is that zfs_get_data() supplies a stale zgd_bp to dmu_sync(), which
  we then nopwrite against.
  zfs_get_data() doesn't hold any DMU-related locks, so after it copies db_blkptr
  to zgd_bp, dbuf_write_ready()
  could change db_blkptr, and dbuf_write_done() could remove the dirty record.
  dmu_sync() then sees the stale
  BP and that the dbuf it not dirty, so it is eligible for nop-writing.
  The fix is for dmu_sync() to copy db_blkptr to zgd_bp after acquiring the
  db_mtx. We could still see a stale
  db_blkptr, but if it is stale then the dirty record will still exist and thus
  we won't attempt to nopwrite.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks

6 years ago8378 crash due to bp in-memory modification of nopwrite block
Andriy Gapon [Tue, 8 Aug 2017 10:44:48 +0000 (10:44 +0000)]
8378 crash due to bp in-memory modification of nopwrite block

illumos/illumos-gate@b7edcb940884114e61382937505433c4c38c0278
https://github.com/illumos/illumos-gate/commit/b7edcb940884114e61382937505433c4c38c0278

https://www.illumos.org/issues/8378
  The problem is that zfs_get_data() supplies a stale zgd_bp to dmu_sync(), which
  we then nopwrite against.
  zfs_get_data() doesn't hold any DMU-related locks, so after it copies db_blkptr
  to zgd_bp, dbuf_write_ready()
  could change db_blkptr, and dbuf_write_done() could remove the dirty record.
  dmu_sync() then sees the stale
  BP and that the dbuf it not dirty, so it is eligible for nop-writing.
  The fix is for dmu_sync() to copy db_blkptr to zgd_bp after acquiring the
  db_mtx. We could still see a stale
  db_blkptr, but if it is stale then the dirty record will still exist and thus
  we won't attempt to nopwrite.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

6 years agoMFV r322221: 7910 l2arc_write_buffers() may write beyond target_sz
Andriy Gapon [Tue, 8 Aug 2017 10:43:41 +0000 (10:43 +0000)]
MFV r322221: 7910 l2arc_write_buffers() may write beyond target_sz

FreeBD note: the essence of this change was committed to FreeBSD in
r314274.  This commit catches up with differences between what was
committed to FreeBSD and what was committed to OpenZFS, mainly more
logical variable names.

illumos/illumos-gate@16a7e5ac116c85d965007a5f201104b564e82210
https://github.com/illumos/illumos-gate/commit/16a7e5ac116c85d965007a5f201104b564e82210

https://www.illumos.org/issues/7910
  It seems that the change in issue #6950 resurrected the problem that was
  earlier fixed by the change in issue #5219.
  Please also see the following FreeBSD bug report:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216178

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 2 weeks

6 years ago7910 l2arc_write_buffers() may write beyond target_sz
Andriy Gapon [Tue, 8 Aug 2017 10:37:03 +0000 (10:37 +0000)]
7910 l2arc_write_buffers() may write beyond target_sz

illumos/illumos-gate@16a7e5ac116c85d965007a5f201104b564e82210
https://github.com/illumos/illumos-gate/commit/16a7e5ac116c85d965007a5f201104b564e82210

https://www.illumos.org/issues/7910
  It seems that the change in issue #6950 resurrected the problem that was
  earlier fixed by the change in issue #5219.
  Please also see the following FreeBSD bug report: https://bugs.freebsd.org/
  bugzilla/show_bug.cgi?id=216178

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

6 years ago8416 abd.h is not C++ friendly
Andriy Gapon [Tue, 8 Aug 2017 10:31:42 +0000 (10:31 +0000)]
8416 abd.h is not C++ friendly

illumos/illumos-gate@5e2a074725cb7c16ea1c6554da11ab4d6b4e7aee
https://github.com/illumos/illumos-gate/commit/5e2a074725cb7c16ea1c6554da11ab4d6b4e7aee

https://www.illumos.org/issues/8416
  A C++ compiler fails to compile abd_is_linear(), which is an inline function
  defined in abd.h, with the following error:
       error: cannot initialize return object of type 'boolean_t' with an
       rvalue of type 'bool'
  That happens because a bool can not be converted to an enum in C++.
  That's a problem because abd.h can be visible through other header files that a
  C++ program that works with ZFS can include.

Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

6 years agoMFV r322217: 8418 zfs_prop_get_table() call in zfs_validate_name() is a no-op
Andriy Gapon [Tue, 8 Aug 2017 10:30:49 +0000 (10:30 +0000)]
MFV r322217: 8418 zfs_prop_get_table() call in zfs_validate_name() is a no-op

illumos/illumos-gate@e09ba01dcda5e24964b8632718777b39166d86e4
https://github.com/illumos/illumos-gate/commit/e09ba01dcda5e24964b8632718777b39166d86e4

https://www.illumos.org/issues/8418
  The following line in zfs_validate_name() is just a no-op and it
  should be removed:
      108    (void) zfs_prop_get_table();

Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>

MFC after: 2 weeks

6 years ago8418 zfs_prop_get_table() call in zfs_validate_name() is a no-op
Andriy Gapon [Tue, 8 Aug 2017 10:28:01 +0000 (10:28 +0000)]
8418 zfs_prop_get_table() call in zfs_validate_name() is a no-op

illumos/illumos-gate@e09ba01dcda5e24964b8632718777b39166d86e4
https://github.com/illumos/illumos-gate/commit/e09ba01dcda5e24964b8632718777b39166d86e4

https://www.illumos.org/issues/8418
  The following line in zfs_validate_name() is just a no-op and it should be
  removed:
  108    (void) zfs_prop_get_table();

Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>

6 years agoMake test scripts under tests/... non-executable
Enji Cooper [Tue, 8 Aug 2017 04:59:16 +0000 (04:59 +0000)]
Make test scripts under tests/... non-executable

Executable bits should be set at install time instead of in the repo.
Setting executable bits on files triggers false positives with Phabricator.

MFC after: 2 months

6 years agoAdd round_jiffies_up(), local_clock() and __setup_timer() to the LinuxKPI.
Mark Johnston [Tue, 8 Aug 2017 04:34:02 +0000 (04:34 +0000)]
Add round_jiffies_up(), local_clock() and __setup_timer() to the LinuxKPI.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11871

6 years agoAdd macros for defining attribute groups and for WO and RW attributes.
Mark Johnston [Tue, 8 Aug 2017 04:30:22 +0000 (04:30 +0000)]
Add macros for defining attribute groups and for WO and RW attributes.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11872

6 years agoregex(3): Handle invalid {} constructs consistently and adjust tests
Kyle Evans [Tue, 8 Aug 2017 04:10:46 +0000 (04:10 +0000)]
regex(3): Handle invalid {} constructs consistently and adjust tests

Currently, regex(3) exhibits the following wrong behavior as demonstrated
with sed:

 - echo "a{1,2,3}b" | sed -r "s/{/_/"     (1)
 - echo "a{1,2,3}b" | sed "s/\}/_/"       (2)
 - echo "a{1,2,3}b" | sed -r "s/{}/_/"    (3)

Cases (1) and (3) should throw errors but they actually succeed, and (2)
throws an error when it should match the literal '}'. The correct behavior
was decided by comparing to the behavior with the equivalent BRE (1)(3) or
ERE (2) and consulting POSIX, along with some reasonable evaluation.

Tests were also adjusted/added accordingly.

PR: 166861
Reviewed by: emaste, ngie, pfg
Approved by: emaste (mentor)
MFC after: never
Differential Revision: https://reviews.freebsd.org/D10315

6 years agopgrep naively appends the delimiter to all PIDs including the last
Lawrence Stewart [Tue, 8 Aug 2017 00:31:10 +0000 (00:31 +0000)]
pgrep naively appends the delimiter to all PIDs including the last
e.g. "pgrep -d, getty" outputs "1399,1386,1309,1308,1307,1306,1305,1302,"
Ensure the list is correctly delimited by suppressing the emission of the
delimiter after the final PID.

Reviewed by: imp, kib
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D8537

6 years ago- If available, use TRIM instead of ERASE for implementing BIO_DELETE.
Marius Strobl [Mon, 7 Aug 2017 23:33:05 +0000 (23:33 +0000)]
- If available, use TRIM instead of ERASE for implementing BIO_DELETE.
  This also involves adding a quirk table as TRIM is broken for some
  Kingston eMMC devices, though. Compared to ERASE (declared "legacy"
  in the eMMC specification v5.1), TRIM has the advantage of operating
  on write sectors rather than on erase sectors, which typically are
  of a much larger size. Thus, employing TRIM, we don't need to fiddle
  with coalescing BIO_DELETE requests that are also of (write) sector
  units into erase sectors, which might not even add up in all cases.
- For some SanDisk iNAND devices, the CMD38 argument, e. g. ERASE,
  TRIM etc., has to be specified via EXT_CSD[113], which now is also
  handled via a quirk.
- My initial understanding was that for eMMC partitions, the granularity
  should be used as erase sector size, e. g. 128 KB for boot partitions.
  However, rereading the relevant parts of the eMMC specification v5.1,
  this isn't actually correct. So drop the code which used partition
  granularities for delmaxsize and stripesize. For the most part, this
  change is a NOP, though, because a) for ERASE, mmcsd_delete() used
  the erase sector size unconditionally for all partitions anyway and
  b) g_disk_limit() doesn't actually take the stripesize into account.
- Take some more advantage of mmcsd_errmsg() in mmcsd(4) for making
  error codes human readable.

6 years agoEliminate useless adjustments of aliased device.
Warner Losh [Mon, 7 Aug 2017 22:42:46 +0000 (22:42 +0000)]
Eliminate useless adjustments of aliased device.

No need to set any fields in the cloned device. devfs uses symlinks,
so the adev entries returned won't be presented to the drivers. Since
we don't save copies, nothing else will see them. This code came from
the old compat code, and it appears to be obsolete or never needed.

Submitted by: kib@
Differential Review: https://reviews.freebsd.org/D11919

6 years agoRevert the parts of r322097 related to /etc/wall_cmos_clock handling as
Marius Strobl [Mon, 7 Aug 2017 21:38:10 +0000 (21:38 +0000)]
Revert the parts of r322097 related to /etc/wall_cmos_clock handling as
the previous behavior actually is required for setting up configurations
in which the RTC is using UTC but the timezone is not. Still, besides
uniform error handling, that file should get the same treatment in the
non-interactive variants supported by tzsetup(8).

6 years agoUPDATING: clarify what the RCMDS knob controls
Ed Maste [Mon, 7 Aug 2017 21:29:55 +0000 (21:29 +0000)]
UPDATING: clarify what the RCMDS knob controls

6 years agoIn debug mode, print the differences between the superblock and
Warner Losh [Mon, 7 Aug 2017 21:23:59 +0000 (21:23 +0000)]
In debug mode, print the differences between the superblock and
alternate superblock when the values disagree and we're going to
reject it.

Differential Revision: https://reviews.freebsd.org/D11589

6 years agoMake it possible to ignore superblock mismatch. This will not fix such
Warner Losh [Mon, 7 Aug 2017 21:23:54 +0000 (21:23 +0000)]
Make it possible to ignore superblock mismatch. This will not fix such
a mismatch, but will allow fsck to continue when the last alternate
superblock gets corrupted somehow.

Also, remove searching for alternate super blocks. It should have been
removed two years ago with r276737 by imp@. Leave minor vestiges in
place in case someone wants to solve the hard problem of knowing where
altnernate superblocks live without access to data formerly stored in
disklabels.

Differential Revision: https://reviews.freebsd.org/D11589

6 years agoAdd nvd alias to nda ndoes.
Warner Losh [Mon, 7 Aug 2017 21:12:43 +0000 (21:12 +0000)]
Add nvd alias to nda ndoes.

All ndaX and ndaXpY nodes will appear as nvdX and nvdXpY as well
(through symlinks in devfs via the normal disk aliasing mechanism in
GEOM).

Differential Revision: https://reviews.freebsd.org/D11873

6 years agoExpose API to allow disks to ask for alias names in devfs.
Warner Losh [Mon, 7 Aug 2017 21:12:38 +0000 (21:12 +0000)]
Expose API to allow disks to ask for alias names in devfs.

Implement disk_add_alias to allow aliases to be added to disks. All
disk have a primary name (say "foo") can also have secondary names
(say "bar") such that all instances of "foo" also have a "bar"
alias. So if you have foo0, foo0p1, foo1, foo1s1 and foo1s1a nodes
created by the foo driver and gpart, device nodes bar0, bar0p1, bar1,
bar1s1 and bar1s1a will appear as symlinks back to the original nodes.
This generalizes to multiple aliases. However, since the unit number
follows the primary name, multiple device drivers can't create the
same aliases unless those drives coorinate the unit number space (eg
you couldn't add an alias 'disk' to both 'da' and 'ada' because it's
possible to have da0 and ada0, because 'disk0' is ambiguous).

Differential Revision: https://reviews.freebsd.org/D11873

6 years agoAdd alias support to gpart.
Warner Losh [Mon, 7 Aug 2017 21:12:33 +0000 (21:12 +0000)]
Add alias support to gpart.

When we're creating new providers for each of the partitions, add
aliases to the geom before we create the provider so when geom_dev
tastes the provider, the aliases are in place so the proper /dev
entries are created. So foo5p6 gets created as an alias for bar5p6
when foo is an alias for bar in the geom we're partitioning with
g_part. This also copies aliases from the container geom (eg disk) to
the label geom (the disk with GPT partitioning) so that aliases nest
properly.

Differential Revision: https://reviews.freebsd.org/D11873

6 years agoAdd aliasing concept to geom.
Warner Losh [Mon, 7 Aug 2017 21:12:28 +0000 (21:12 +0000)]
Add aliasing concept to geom.

Add an alias name list to geoms. Use them in geom_dev to create
aliases. Previously, geom_dev would create an device node for the name
of the geom. Now, additional nodes are created pointing back to the
primary node with make_dev_alias_p. Aliases must be in place on the
geom before any tasting occurs.

Differential Revision: https://reviews.freebsd.org/D11873

6 years agogjournal is broken in handling its flush_queue. If we have 10 bio's
Kirk McKusick [Mon, 7 Aug 2017 19:40:03 +0000 (19:40 +0000)]
gjournal is broken in handling its flush_queue. If we have 10 bio's
in the flush_queue:
         1 2 3 4 5 6 7 8 9 10
and another 10 bio's go into the flush queue after only the first five
bio's are removed from the flush queue, the queue should look like:
         6 7 8 9 10 11 12 13 14 15 16 17 18 19 20,
but because of the bug we end up with
         6 11 12 13 14  15 16 17 18 19 20 7 8 9 10.
So the sequence of the bio's is damaged in the flush queue (and
therefore in the journal on disk !). This error can be triggered by
ffs_snapshot() when a block is read with readblock() and gjournal finds
this block in the broken flush queue before it goes to the correct
active queue.

The fix is to place all new blocks at the end of the queue.

Submitted by: Dr. Andreas Longwitz <longwitz@incore.de>
Discussed with: kib
MFC after: 1 week

6 years agosysctl kern.geom.journal.cache.limit shows negative value for FreeBSD/amd64
Kirk McKusick [Mon, 7 Aug 2017 19:18:27 +0000 (19:18 +0000)]
sysctl kern.geom.journal.cache.limit shows negative value for FreeBSD/amd64
system having over 4GB RAM. That's due to:

1) the limit being u_int instead of u_long like vm.kmem_size (the limit is
   half of vm.kmem_size by default for amd64);
2) sysctl handler g_journal_cache_limit_sysctl() using u_int instead of u_long.

The fix is to replace u_int with u_long for the kern.geom.journal.cache.limit
sysctl variable.

PR: 198500
Submitted by: Dr. Andreas Longwitz <longwitz@incore.de>
Reported by: Eugene Grosbein
Discussed with: kib
MFC after: 1 week

6 years agoRespect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
Kyle Evans [Mon, 7 Aug 2017 18:01:27 +0000 (18:01 +0000)]
Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)

Instead of using a non-configurable ".BAK" suffix, respect the
SIMPLE_BACKUP_SUFFIX environment variable also used by patch(1). This
simplifies cleanup operations in some patch/indent workflows.

Reviewed by: cem (earlier version), emaste, pstef
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D10921

6 years agoAvoid DI recursion when reclaim_pv_chunk() is called from
Konstantin Belousov [Mon, 7 Aug 2017 17:29:54 +0000 (17:29 +0000)]
Avoid DI recursion when reclaim_pv_chunk() is called from
pmap_advise() or pmap_remove().

Reported and tested by: pho (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoExplain why delayed invalidation is not required in pmap_protect() and
Konstantin Belousov [Mon, 7 Aug 2017 17:23:10 +0000 (17:23 +0000)]
Explain why delayed invalidation is not required in pmap_protect() and
pmap_remove_pages().

Submitted by: alc
MFC after: 1 week

6 years agoFollow-up to r321684 (Don't use libc++ when cross-building for gcc
Dimitry Andric [Mon, 7 Aug 2017 16:23:53 +0000 (16:23 +0000)]
Follow-up to r321684 (Don't use libc++ when cross-building for gcc
arches), and handle two more cases where libc++ includes could be
incorrectly enabled, in case the host compiler is clang 5.0.0, and the
target (cross) compiler is gcc 4.2.1.

Noted by: bdrewery
MFC after: 3 days
X-MFC-With: 321684

6 years agoFix hrtimer_active() in case of cancellation.
Alexander Motin [Mon, 7 Aug 2017 14:34:05 +0000 (14:34 +0000)]
Fix hrtimer_active() in case of cancellation.

While there, switch to FreeBSD internal callout active status.

Reviewed by: markj, hselasky
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11900

6 years agoo Replace __riscv__ with __riscv
Ruslan Bukin [Mon, 7 Aug 2017 14:09:57 +0000 (14:09 +0000)]
o Replace __riscv__ with __riscv
o Replace __riscv64 with (__riscv && __riscv_xlen == 64)

This is required to support new GCC 7.1 compiler.
This is compatible with current GCC 6.1 compiler.

RISC-V is extensible ISA and the idea here is to have built-in define
per each extension, so together with __riscv we will have some subset
of these as well (depending on -march string passed to compiler):

__riscv_compressed
__riscv_atomic
__riscv_mul
__riscv_div
__riscv_muldiv
__riscv_fdiv
__riscv_fsqrt
__riscv_float_abi_soft
__riscv_float_abi_single
__riscv_float_abi_double
__riscv_cmodel_medlow
__riscv_cmodel_medany
__riscv_cmodel_pic
__riscv_xlen

Reviewed by: ngie
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11901

6 years agocxgbe(4): Add the T6 and T5 Unified Wire configuration files to the
Navdeep Parhar [Mon, 7 Aug 2017 14:04:19 +0000 (14:04 +0000)]
cxgbe(4): Add the T6 and T5 Unified Wire configuration files to the
kernel, just like for T4, when the driver is compiled into the kernel.

Reported by: mav@
MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoEnhance top(1) to filter on multiple usernames
Pietro Cerutti [Mon, 7 Aug 2017 08:45:08 +0000 (08:45 +0000)]
Enhance top(1) to filter on multiple usernames

Reviewed by: cognet, bapt
Approved by: cognet
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11840

6 years agorfcomm_pppd.8: fix a typo (SPD -> SDP).
Andriy Voskoboinyk [Sun, 6 Aug 2017 21:54:43 +0000 (21:54 +0000)]
rfcomm_pppd.8: fix a typo (SPD -> SDP).

MFC after: 3 days

6 years agocxgbe(4): Avoid a NULL dereference that would occur during module unload
Navdeep Parhar [Sun, 6 Aug 2017 19:45:59 +0000 (19:45 +0000)]
cxgbe(4): Avoid a NULL dereference that would occur during module unload
if there were problems earlier during attach.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoRemove trivial comments. Remove and-ing with UINT_MAX for minor(),
Konstantin Belousov [Sun, 6 Aug 2017 12:27:20 +0000 (12:27 +0000)]
Remove trivial comments.  Remove and-ing with UINT_MAX for minor(),
cast to int already does the required truncation of significant bits.

Requested and reviewed by: bde
Sponsored by: The FreeBSD Foundation

6 years agoRemove dead target introduced in r178828.
Cy Schubert [Sun, 6 Aug 2017 06:35:40 +0000 (06:35 +0000)]
Remove dead target introduced in r178828.

MFC after: 1 week

6 years agokrb5_err.h is generated from a .et file in kerberos5/lib/libkrb5.
Cy Schubert [Sun, 6 Aug 2017 06:31:47 +0000 (06:31 +0000)]
krb5_err.h is generated from a .et file in kerberos5/lib/libkrb5.
As kerberos5/lib/krb5 include files are already referenced it makes
no sense to generate it again here.

MFC after: 1 month

6 years agoMark each cpu in the appropriate cpuset_domain set. This allows devices to
Andrew Turner [Sat, 5 Aug 2017 20:57:34 +0000 (20:57 +0000)]
Mark each cpu in the appropriate cpuset_domain set. This allows devices to
handle cases where they can only run on a single domain.

To allow all devices access to this set we need to move reading the domain
earlier in the boot as it was previously handled in the CPU driver, however
this is too late for the GICv3 ITS driver.

Sponsored by: DARPA, AFRL

6 years agoAdd myself to the calendar.freebsd.
Andriy Voskoboinyk [Sat, 5 Aug 2017 19:57:45 +0000 (19:57 +0000)]
Add myself to the calendar.freebsd.

Reported by: mckusick

6 years agoDon't check result of chflags in f_flag_cleanup()
Enji Cooper [Sat, 5 Aug 2017 16:58:02 +0000 (16:58 +0000)]
Don't check result of chflags in f_flag_cleanup()

This will prevent false positives from occurring if the test is run on
ZFS since ZFS doesn't support fflags throbbing like UFS.

PR: 221189
MFC after: 4 days
MFC with: r321949

6 years ago- Move creation and unlinking of /etc/wall_cmos_clock from the handling
Marius Strobl [Sat, 5 Aug 2017 12:59:03 +0000 (12:59 +0000)]
- Move creation and unlinking of /etc/wall_cmos_clock from the handling
  of the initial UTC dialog to install_zoneinfo() so that file gets the
  necessary treatment also when that dialog is skipped via "-s", when
  selecting UTC from the time zone menu or on the command-line instead
  etc.
- Make the initial UTC dialog actually work by giving the relevant files
  the necessary treatment and then exit when choosing "Yes" there instead
  of moving on to the time zone menu regardless.
- Since r301131, /etc/localtime is also installed when selecting UTC in
  interactive configurations (which previously meant only via the time
  zone menu, though). Thus, the code added in r230298 which treats a
  NULL zone file name as UTC and removes /etc/localtime in that case can
  go again.
- Consistently refer to "could not delete" (as chosen by the oldest such
  code in here) when unlink(2) fails instead of a to mixture of "delete"
  and "unlink" in error messages.

6 years agoadd myself to calendar.freebsd
Christoph Moench-Tegeder [Sat, 5 Aug 2017 10:03:47 +0000 (10:03 +0000)]
add myself to calendar.freebsd

Reported by: mckusick

6 years agoProvide more detailed specification for major(), minor() and makedev().
Konstantin Belousov [Sat, 5 Aug 2017 07:52:15 +0000 (07:52 +0000)]
Provide more detailed specification for major(), minor() and makedev().

Remove some statements which are no longer correct after ino64, and
clarify other.

The rewording is not in fact specific to ino64 and improvements are
useful on the stable branches.

Noted and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoDetect hypervisors early. We used to set lower hz on hypervisors by default
Jung-uk Kim [Sat, 5 Aug 2017 06:56:46 +0000 (06:56 +0000)]
Detect hypervisors early.  We used to set lower hz on hypervisors by default
but it was broken since r273800 (and r278522, its MFC to stable/10) because
identify_cpu() is called too late, i.e., after init_param1().

MFC after: 3 days

6 years agoloadpoolfile() implements a -R (NORESOLVE) option which is not listed
Cy Schubert [Sat, 5 Aug 2017 06:46:06 +0000 (06:46 +0000)]
loadpoolfile() implements a -R (NORESOLVE) option which is not listed
in usage(). This commit trues up usage() with loadpoolfile().

6 years agolibefi/time.c cstyle cleanup
Toomas Soome [Sat, 5 Aug 2017 05:20:03 +0000 (05:20 +0000)]
libefi/time.c cstyle cleanup

libefi/time.c is mix of different styles, this update does cleanup.
Also fix 0 versus NULL, and zero the tv structure for case we get error
from UEFI firmware.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D11861

6 years agoFix matchcing of NATed ICMP queries (resolving NATed MTU discovery).
Cy Schubert [Sat, 5 Aug 2017 00:28:42 +0000 (00:28 +0000)]
Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery).

MFC after: 1 month

6 years agoSelectively print "hwaddr" from ifconfig(8).
Matt Joras [Fri, 4 Aug 2017 21:06:47 +0000 (21:06 +0000)]
Selectively print "hwaddr" from ifconfig(8).

ifconfig(8) printing the hwaddr is only really useful if it differs from
the link layer address.

Reported by: jhb
Reviewed by: rpokala
Approved by: rstone (mentor)
Differential Revision: https://reviews.freebsd.org/D11777

6 years agoFix off by one in calculation of the number of buckets for the pc
Konstantin Belousov [Fri, 4 Aug 2017 18:02:54 +0000 (18:02 +0000)]
Fix off by one in calculation of the number of buckets for the pc
addresses.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11864

6 years agoMove EFI fmtdev functionality to libefi
Warner Losh [Fri, 4 Aug 2017 16:33:36 +0000 (16:33 +0000)]
Move EFI fmtdev functionality to libefi

This patch moves code necessary for the fmtdev functionality from
loader to libefi, allowing other applications to make use of it

Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11862

6 years agocxgbe(4): Allow the TOE timer tunables to be set with microsecond
Navdeep Parhar [Fri, 4 Aug 2017 15:57:10 +0000 (15:57 +0000)]
cxgbe(4): Allow the TOE timer tunables to be set with microsecond
precision.  These timers are already displayed in microseconds in the
sysctl MIB.  Add variables to track these tunables while here.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoIntroduce the flopenat(3) function.
Mariusz Zaborski [Fri, 4 Aug 2017 14:24:24 +0000 (14:24 +0000)]
Introduce the flopenat(3) function.

Reviewed by: des, emaste
Differential Revision: https://reviews.freebsd.org/D11690

6 years agoStart to teach the GICv3 driver about NUMA. On ThunderX we may have
Andrew Turner [Fri, 4 Aug 2017 13:08:45 +0000 (13:08 +0000)]
Start to teach the GICv3 driver about NUMA. On ThunderX we may have
multiple ITS devices, however we only want a single ITS device to be
configured on each CPU. To fix this only enable ITS when the node matches
the CPUs node.

Sponsored by: DARPA, AFRL

6 years agoUpgrade to OpenSSH 7.5p1.
Dag-Erling Smørgrav [Fri, 4 Aug 2017 12:57:24 +0000 (12:57 +0000)]
Upgrade to OpenSSH 7.5p1.

6 years agoRead the numa-node-id property from each CPU node. This will initially be
Andrew Turner [Fri, 4 Aug 2017 10:33:22 +0000 (10:33 +0000)]
Read the numa-node-id property from each CPU node. This will initially be
used to support the dual package ThunderX where we need to send MSI/MSI-X
interrupts to the same package as the device the interrupt came from.

Sponsored by: DARPA, AFRL

6 years agoRelax visibility for some termios symbols.
Konstantin Belousov [Fri, 4 Aug 2017 09:45:40 +0000 (09:45 +0000)]
Relax visibility for some termios symbols.

They are defined by XSI or newer SUS.
This is a follow-up to r318780.

Reported by: jbeich
Obtained from: DragonflyBSD commit e08b3836c962
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoDocument usb verbosity levels
Brad Davis [Fri, 4 Aug 2017 08:56:31 +0000 (08:56 +0000)]
Document usb verbosity levels

Submitted by: Tom Jones <jones@sdf.org>
Approved by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11850

6 years agoIn case readers are misled by expressions that combine multiplication and
Alan Cox [Fri, 4 Aug 2017 04:23:23 +0000 (04:23 +0000)]
In case readers are misled by expressions that combine multiplication and
division, add parentheses to make the precedence explicit.

Submitted by: Doug Moore <dougm@rice.edu>
Requested by: imp
Reviewed by: imp
MFC after: 1 week
X-MFC after: r321840
Differential Revision: https://reviews.freebsd.org/D11815

6 years agoAdd EFI utility functions to libefi
Warner Losh [Fri, 4 Aug 2017 04:20:11 +0000 (04:20 +0000)]
Add EFI utility functions to libefi

This patch adds additional EFI utility functions to convert errno
values to EFI_STATUS errors, as well as EFI times to UNIX times.

Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11858

6 years agoMove EFI ZFS functions to libefi
Warner Losh [Fri, 4 Aug 2017 04:20:06 +0000 (04:20 +0000)]
Move EFI ZFS functions to libefi

This patch moves some EFI ZFS functions from loader to libefi,
allowing them to be used by anything that links against libefi.

Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11855

6 years agoAdd definitions and utilities for EFI drivers
Warner Losh [Fri, 4 Aug 2017 04:16:41 +0000 (04:16 +0000)]
Add definitions and utilities for EFI drivers

This patch adds definitions and utility code for creating EFI drivers
using the EFI_DRIVER_BINDING_PROTOCOL.

Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D11852

6 years agoAdd stpcpy and stpncpy to libstand
Warner Losh [Fri, 4 Aug 2017 03:48:17 +0000 (03:48 +0000)]
Add stpcpy and stpncpy to libstand

This adds the stpcpy and stpncpy functions to libstand.

Differential Revision: https://reviews.freebsd.org/D11844

6 years agoMake nvd vs nda choice boot-time rather than build-time
Warner Losh [Fri, 4 Aug 2017 03:40:01 +0000 (03:40 +0000)]
Make nvd vs nda choice boot-time rather than build-time

Introduce hw.nvme.use_nvd tunable. This tunable allows both nvd and
nda to be installed in the kernel, while allowing only one of them to
create devices. This is an all-or-nothing setting, and you can't
change it after boot-time. However, it will allow easier A/B testing.

Differential Revision: https://reviews.freebsd.org/D11825

6 years agoAdd myself.
Alan Cox [Fri, 4 Aug 2017 03:20:01 +0000 (03:20 +0000)]
Add myself.

6 years agocxgbe(4): Always use the first and not the last virtual interface
Navdeep Parhar [Fri, 4 Aug 2017 01:28:06 +0000 (01:28 +0000)]
cxgbe(4): Always use the first and not the last virtual interface
associated with a port in begin_synchronized_op.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoFix procstat --libxo -L.
Mark Johnston [Thu, 3 Aug 2017 22:41:34 +0000 (22:41 +0000)]
Fix procstat --libxo -L.

- Use the title role for column headers.
- Fix a typo in a field name (lpwid -> lwpid).
- Place the fields of different threads in separate containers.

6 years agox86: Tag some intrinsics with __pure2
Conrad Meyer [Thu, 3 Aug 2017 22:28:30 +0000 (22:28 +0000)]
x86: Tag some intrinsics with __pure2

Some C wrappers for x86 instructions do not touch global memory and only act
on their arguments; they can be marked __pure2, aka __const__.  Without this
annotation, Clang 3.9.1 is not intelligent enough on its own to grok that
these functions are __const__.

Submitted by: Anton Rang <anton.rang AT isilon.com>
Sponsored by: Dell EMC Isilon

6 years agoRemove deprecation notice for ruptime/rwho/rwhod.
Jeremie Le Hen [Thu, 3 Aug 2017 21:37:57 +0000 (21:37 +0000)]
Remove deprecation notice for ruptime/rwho/rwhod.

PR: 220953
Reported by: peter

6 years agoBump the maximum file name length in pseudofs filesystems to 48.
Mark Johnston [Thu, 3 Aug 2017 21:35:53 +0000 (21:35 +0000)]
Bump the maximum file name length in pseudofs filesystems to 48.

The previous limit of 24 was somewhat restrictive, and with this change
ceil(log2(sizeof(struct pfs_node))) is the same as before in both the ILP32
and LP64 models, so the malloc zone used for allocations of struct pfs_node
is the same as before.

Approved by: des

6 years agorwho/ruptime/rwhod shouldn't be gated by RCMDS.
Jeremie Le Hen [Thu, 3 Aug 2017 21:30:12 +0000 (21:30 +0000)]
rwho/ruptime/rwhod shouldn't be gated by RCMDS.

PR: 220953
Reported by: peter@
Differential Revision: https://reviews.freebsd.org/D11743

6 years agoAdd subsystem vendor and device ID fields to struct pci_dev.
Mark Johnston [Thu, 3 Aug 2017 21:14:46 +0000 (21:14 +0000)]
Add subsystem vendor and device ID fields to struct pci_dev.

MFC after: 1 week

6 years agoarm: Add a GENERIC-NODEBUG kernel config
Emmanuel Vadot [Thu, 3 Aug 2017 19:01:46 +0000 (19:01 +0000)]
arm: Add a GENERIC-NODEBUG kernel config

Like amd64 or arm64 provide a GENERIC-NODEBUG configuration file that
remove WITNESS and INVARIANTS etc ...

6 years agoAdd missing header file to SRCS.
Ian Lepore [Thu, 3 Aug 2017 18:49:15 +0000 (18:49 +0000)]
Add missing header file to SRCS.

Reported by: manu@

6 years agoSwitch to iicdev_readfrom/writeto() to do xfers with proper bus ownership.
Ian Lepore [Thu, 3 Aug 2017 18:43:54 +0000 (18:43 +0000)]
Switch to iicdev_readfrom/writeto() to do xfers with proper bus ownership.

Tested by: manu@

6 years agoRemove special-case logic for running tests on host machines
Enji Cooper [Thu, 3 Aug 2017 17:53:14 +0000 (17:53 +0000)]
Remove special-case logic for running tests on host machines

I'm not sure what process sjg@ was using, but using CHECKDIR=${.OBJDIR} with
"make check" on ^/head is the correct thing to do. This unbreaks "make check"
for me (unsandboxed, not using CHECKDIR=${.OBJDIR}).

While here, fix a whitespace nit with LIBADD.

MFC after: 1 week

6 years agoUpdate from libxo-0.8.1 to 0.8.4:
Phil Shafer [Thu, 3 Aug 2017 15:47:42 +0000 (15:47 +0000)]
Update from libxo-0.8.1 to 0.8.4:
  0.8.4:
    - void anchor width optimization when we have a custom formatter (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221130)
    - make "{[:/18}" do the right thing (also allows "{[:/%s}", wide ? 40 : 10)
    - Can't skip anchor formatting in non-display styles
    - add test case for {[:/18}
    - add upload-xohtml-files to 'make upload'
  0.8.3:
    - xohtml: Add "-w" option to pull support files from gh_pages
    - Add "upload-xohtml-files" target to publish support files in gh_pages/
    - add HISTORY/AUTHORS section to man pages
  0.8.2:
    - xohtml: Add div.units as standard CSS text
    - Don't treat values as format strings; they are not
    - add "-p" to "mkdir -p build" in setup.sh
    - add test case for {U:%%} (from df.c)
    - detect end-of-string in '%' and '' escaping
    - make xo_simple_field, for common simple cases
    - xohtml: nuke "n" in "echo" commands
    - rename "format" to "fmt" for consistency; same for "str" to "value"

Submitted by: phil

6 years agoImport libxo 0.8.4
Phil Shafer [Thu, 3 Aug 2017 15:43:14 +0000 (15:43 +0000)]
Import libxo 0.8.4

6 years agoOracle T10000 tape drives use PRML encoding.
Kenneth D. Merry [Thu, 3 Aug 2017 15:04:54 +0000 (15:04 +0000)]
Oracle T10000 tape drives use PRML encoding.

Source:   Oracle T10000 SCSI reference guide.
MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoAdd an ahci driver for imx6.
Ian Lepore [Thu, 3 Aug 2017 14:43:41 +0000 (14:43 +0000)]
Add an ahci driver for imx6.

This was submitted by Rogiel Sulzbach (thank you!) but has a few last-minute
changes by me, mostly where the code interfaces to my still-utterly-deficient
imx6_ccm clocks implementation.  So blame me for any mistakes.

Submitted by: Rogiel Sulzbach <rogiel@rogiel.com>
Differential Revision: https://reviews.freebsd.org/D11177

6 years agocxgbe(4): Initial import of the "collect" component of Chelsio unified
Navdeep Parhar [Thu, 3 Aug 2017 14:43:30 +0000 (14:43 +0000)]
cxgbe(4): Initial import of the "collect" component of Chelsio unified
debug (cudbg) code, hooked up to the main driver via an ioctl.

The ioctl can be used to collect the chip's internal state in a
compressed dump file.  These dumps can be decoded with the "view"
component of cudbg.

Obtained from: Chelsio Communications
MFC after: 2 months
Sponsored by: Chelsio Communications

6 years agoDocument -w flag is an extension to POSIX.
Sevan Janiyan [Thu, 3 Aug 2017 14:35:02 +0000 (14:35 +0000)]
Document -w flag is an extension to POSIX.

PR: 201937
Submitted by: <fullermd AT over-yonder DOT net>
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D11842

6 years agoRevert r321969
Enji Cooper [Thu, 3 Aug 2017 13:50:46 +0000 (13:50 +0000)]
Revert r321969

My change had good intentions, but the implementation was incorrect:
- printf was returning the number of characters in the format string
  plus the NUL, but failed in two regards implementation wise:
-- the pathological case, printf(""), wasn't being handled properly since
   the pointer is always incremented, so the value returned would be
   off-by-one.
-- printf(3) reports the number of characters printed post-conversion via
   vfprintf, etc.
- putchar(3) should return the character printed or EOF, not the number
  of characters output to the screen.

My goal in making the change (again) was to increase parity, but as bde
pointed out these are freestanding functions, so they don't have to
conform to libc/POSIX. I argued that the functions should be named
differently since the implementation is different enough to warrant it
and to allow boot2 code to be usable when linked against sys/boot and
libstand and other libraries in base. I have no interest in pushing
this change forward more though, as the original concern I had behind
the change with zfsboottest was resolved in r321849 and r321852. The
next person that updates the toolchain gets to deal with the
inconsistency if it's flagged by a newer compiler.

MFC after: 1 month
Reported by: ed, markj

6 years agoAdd myself to the calendar.freebsd.
Luiz Otavio O Souza [Thu, 3 Aug 2017 13:26:51 +0000 (13:26 +0000)]
Add myself to the calendar.freebsd.

Reported by: mckusick

6 years agoVendor import of OpenSSH 7.5p1.
Dag-Erling Smørgrav [Thu, 3 Aug 2017 10:10:20 +0000 (10:10 +0000)]
Vendor import of OpenSSH 7.5p1.

6 years agoChange reject message type when destroying cm_id in ibore.
Hans Petter Selasky [Thu, 3 Aug 2017 09:31:10 +0000 (09:31 +0000)]
Change reject message type when destroying cm_id in ibore.

This patch fixes an interopability issue between FreeBSD and non-FreeBSD
systems when the connection establishment is aborted. Refer to the
initial commit in Linux, drivers/infiniband/core/cm.c,
for a more detailed description.

Obtained from: Linux
MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoTicks are 32-bit in FreeBSD.
Hans Petter Selasky [Thu, 3 Aug 2017 09:18:25 +0000 (09:18 +0000)]
Ticks are 32-bit in FreeBSD.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoResolve locking issue for non-sleepable context in the mlx5core.
Hans Petter Selasky [Thu, 3 Aug 2017 09:14:43 +0000 (09:14 +0000)]
Resolve locking issue for non-sleepable context in the mlx5core.

Code inspection reveals the busdma unload and free functions
do not write to the belonging dma tag and does not need to be
serialized. This allows mlx5_fwp_free() to be called from
software interrupt context.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoUsing GFP_ATOMIC with firmware commands is not supported after busdma was
Hans Petter Selasky [Thu, 3 Aug 2017 09:11:51 +0000 (09:11 +0000)]
Using GFP_ATOMIC with firmware commands is not supported after busdma was
introduced in the mlx5core, because busdma might sleep when loading memory
into DMA.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoAdd myself to the calendar.
Hans Petter Selasky [Thu, 3 Aug 2017 08:03:22 +0000 (08:03 +0000)]
Add myself to the calendar.

Requested by: mckusick