dragonfly.git
11 hours agokernel: Staticize some variables in platform/pc64. master
Sascha Wildner [Sun, 25 Oct 2020 00:03:51 +0000 (02:03 +0200)]
kernel: Staticize some variables in platform/pc64.

Also, remove some unused variables and move some extern declarations
to header files.

2 days agosbin/hammer2: Don't use 1 byte size for 0 radix bits
Tomohiro Kusumi [Thu, 22 Oct 2020 18:03:08 +0000 (03:03 +0900)]
sbin/hammer2: Don't use 1 byte size for 0 radix bits

Same as 893aa36e0111c1418f260bd8d1092b7f22ea010e for userspace code.

2 days agosbin/hammer2: Improve "printinode"
Tomohiro Kusumi [Wed, 21 Oct 2020 17:15:01 +0000 (02:15 +0900)]
sbin/hammer2: Improve "printinode"

Inmemory inode only has meta part of ondisk inode (no blockrefs),
so remove unused code which won't be implemented.

2 days agolibexec/dma: sync with upstream
Daniel Fojt [Fri, 23 Oct 2020 06:10:16 +0000 (08:10 +0200)]
libexec/dma: sync with upstream

- avoid double free in reallocf()
- fix use-after-free in deliver()
- more meaningful reporting of server greeting errors
- minor code cleanup

2 days agorc.d: Fix indent.
Sascha Wildner [Fri, 23 Oct 2020 07:12:28 +0000 (09:12 +0200)]
rc.d: Fix indent.

2 days agokernel: Fix two more -Wcast-qual warnings reported by clang.
Sascha Wildner [Thu, 22 Oct 2020 17:56:14 +0000 (19:56 +0200)]
kernel: Fix two more -Wcast-qual warnings reported by clang.

Use __DECONST() in another case that I had fixed in cebef8bba30e3313d8f2
with a (void *) cast.

2 days agosystat(1): Remove dead code.
Sascha Wildner [Thu, 22 Oct 2020 13:23:19 +0000 (15:23 +0200)]
systat(1): Remove dead code.

It was inactivated by c8cad1a46f5d4e9ee689c3da2c3909245b783200 but
forgotten to be removed.

3 days agohammer2(8): Oops, unbreak build.
Sascha Wildner [Wed, 21 Oct 2020 18:57:06 +0000 (20:57 +0200)]
hammer2(8): Oops, unbreak build.

3 days agohammer2(8): Point out dead code a bit clearer.
Sascha Wildner [Wed, 21 Oct 2020 18:54:42 +0000 (20:54 +0200)]
hammer2(8): Point out dead code a bit clearer.

4 days agosys/vfs/ext2fs: Enable VFCF_MPSAFE
Tomohiro Kusumi [Tue, 20 Oct 2020 16:18:11 +0000 (01:18 +0900)]
sys/vfs/ext2fs: Enable VFCF_MPSAFE

4 days agosys/vfs/hammer2: Don't use 1 byte size for 0 radix bits
Tomohiro Kusumi [Mon, 19 Oct 2020 16:04:07 +0000 (01:04 +0900)]
sys/vfs/hammer2: Don't use 1 byte size for 0 radix bits

Not using 1 byte size for 0 radix bits is part of ondisk spec.
This may not be expected to happen in these cases, but other ones
always consider 0 radix or assert radix != 0.

--
 * WARNING! A radix of 0 (such as when data_off is all 0's) is a special
 *     case which means no data associated with the blockref, and
 *     not the '1 byte' it would otherwise calculate to.

4 days agohostname(1): Remove unneeded extra parentheses.
Sascha Wildner [Wed, 21 Oct 2020 02:45:36 +0000 (04:45 +0200)]
hostname(1): Remove unneeded extra parentheses.

4 days agodefaults/compilers.conf: Clean up old CCVERs and add one for clang10.
Sascha Wildner [Tue, 20 Oct 2020 15:41:34 +0000 (17:41 +0200)]
defaults/compilers.conf: Clean up old CCVERs and add one for clang10.

With devel/llvm10 installed, this builds world and kernel like
described in compilers.conf(5)'s EXAMPLES section.

Note that it is only build-tested. I haven't ever tried running a
clang compiled world/kernel.

4 days agoboot/boot2 (legacy): Add -fno-addrsig for clang compilation.
Sascha Wildner [Tue, 20 Oct 2020 14:07:43 +0000 (16:07 +0200)]
boot/boot2 (legacy): Add -fno-addrsig for clang compilation.

We need this because in this case, the assembler used is binutil's,
which does not understand .addrsig/.addrsig_sym.

4 days agogcc: Add clang's -Wno-c++11-narrowing where we have gcc's -Wno-narrowing.
Sascha Wildner [Sat, 17 Oct 2020 08:16:22 +0000 (10:16 +0200)]
gcc: Add clang's -Wno-c++11-narrowing where we have gcc's -Wno-narrowing.

This fixes some clang buildworld issues.

Not sure why it errors without this flag even though no -Werror is set.

5 days ago<sys/exislock.h>: Add include guard and adjust includes.
Sascha Wildner [Tue, 20 Oct 2020 10:48:57 +0000 (12:48 +0200)]
<sys/exislock.h>: Add include guard and adjust includes.

5 days agoAdjust permissions of various files.
Sascha Wildner [Mon, 19 Oct 2020 16:29:49 +0000 (18:29 +0200)]
Adjust permissions of various files.

6 days agoperiodic: add daily check for kernel vs. userland consistency
Daniel Fojt [Sun, 18 Oct 2020 15:22:19 +0000 (17:22 +0200)]
periodic: add daily check for kernel vs. userland consistency

- import new daily periodic script 510.status-world-kernel
- extend default periodic.conf
- update manpage periodic.conf.5

Taken from: FreeBSD
Reviewed by: Sascha Wildner

6 days agosys/vfs/hammer2: Remove obsolete comments on blockset/blockref
Tomohiro Kusumi [Sun, 18 Oct 2020 15:15:35 +0000 (00:15 +0900)]
sys/vfs/hammer2: Remove obsolete comments on blockset/blockref

Apparently blockrefs are sorted with possible holes.
1897c66ea31ca9d7b3fb03ba08889054bf36ef04 in 2013 changed how blockrefs
within inode's blockset or indirect block are created/deleted.

Inode has "ncopies" field, but redundancy isn't implemented.

"blockrefs in a set can shortcut multiple levels of indirections"
seems to have only existed in this comment.

7 days agosys/vfs/hammer2: Remove unused local variable in hammer2_chain_dirent_test()
Tomohiro Kusumi [Sat, 17 Oct 2020 16:15:07 +0000 (01:15 +0900)]
sys/vfs/hammer2: Remove unused local variable in hammer2_chain_dirent_test()

7 days agosys/vfs/hammer2: Move voldata functions to hammer2_vfsops.c
Tomohiro Kusumi [Sat, 17 Oct 2020 16:12:23 +0000 (01:12 +0900)]
sys/vfs/hammer2: Move voldata functions to hammer2_vfsops.c

These should be in hammer2_vfsops.c, not much to do with chain
functions.

8 days agosys/vfs/hammer2: Remove unused hammer2_chain_[rw]data()
Tomohiro Kusumi [Fri, 16 Oct 2020 15:23:14 +0000 (00:23 +0900)]
sys/vfs/hammer2: Remove unused hammer2_chain_[rw]data()

HAMMER2 code directly access chain->data without these wrappers,
except for two places using hammer2_chain_rdata().

8 days agosys/vfs/hammer2: Remove unused hammer2_chain_wait()
Tomohiro Kusumi [Thu, 15 Oct 2020 17:12:24 +0000 (02:12 +0900)]
sys/vfs/hammer2: Remove unused hammer2_chain_wait()

This should have been removed along with other chain functions
in 278ab2b27e913575840951f625eb2d8620aafa34 in 2014 when cluster
functions replaced them.

8 days agoboot/boot2 (legacy): Remove an unneeded Makefile rule.
Sascha Wildner [Fri, 16 Oct 2020 13:19:58 +0000 (15:19 +0200)]
boot/boot2 (legacy): Remove an unneeded Makefile rule.

This is covered by our suffix-transformation rules in sys.mk.

8 days agoUpgrade libedit. 2/2
Daniel Fojt [Thu, 15 Oct 2020 17:06:23 +0000 (19:06 +0200)]
Upgrade libedit. 2/2

Update README.{DELETED,DRAGONFLY}.

9 days agoUpgrade libedit. 1/2
Daniel Fojt [Thu, 15 Oct 2020 16:42:16 +0000 (18:42 +0200)]
Upgrade libedit. 1/2

Merge branch 'vendor/LIBEDIT' into master.

9 days agovendor/libedit: upgrade from 2019-03-24 to 2019-12-31 vendor/LIBEDIT
Daniel Fojt [Wed, 14 Oct 2020 19:42:25 +0000 (21:42 +0200)]
vendor/libedit: upgrade from 2019-03-24 to 2019-12-31

Most significant changes:

- avoid screwed terminal when going back in history [1]
- fix undefined terminal behavior in terminal_move_to_line() [2]
- avoid uninitialized memory access in hist_get() [3]
- fix segfault from re_fastputc() in certain situations [4]

[1] http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=52359
[2] http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54329
[3] http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54399
[4] http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54654

9 days agoetc/regdomain.xml: sync with FreeBSD
Daniel Fojt [Fri, 16 Oct 2020 05:19:38 +0000 (07:19 +0200)]
etc/regdomain.xml: sync with FreeBSD

9 days agoUpdate the pciconf(8) database.
Sascha Wildner [Thu, 15 Oct 2020 18:51:10 +0000 (20:51 +0200)]
Update the pciconf(8) database.

October 11, 2020 snapshot from https://pci-ids.ucw.cz

9 days agoSync zoneinfo database with tzdata2020b from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 15 Oct 2020 18:48:25 +0000 (20:48 +0200)]
Sync zoneinfo database with tzdata2020b from ftp://ftp.iana.org/tz/releases

* Revised predictions for Morocco's changes starting in 2023.

* Canada's Yukon changes to -07 on 2020-11-01, not 2020-03-08.

* Macquarie Island has stayed in sync with Tasmania since 2011.

* Casey, Antarctica is at +08 in winter and +11 in summer.

* Various other fixes and corrections in past timestamps.

For a detailed list of changes, see share/zoneinfo/NEWS.

10 days agosys/vfs/hammer2: Redo 428dc73dec68fbb23a2d18e7a7ef1048287709a6
Tomohiro Kusumi [Wed, 14 Oct 2020 17:56:07 +0000 (02:56 +0900)]
sys/vfs/hammer2: Redo 428dc73dec68fbb23a2d18e7a7ef1048287709a6

Should detect invalid blockrefs other than empty if any,
and keep the behavior unchanged.

10 days agosys/vfs/hammer2: Simplify chain allocation in hammer2_chain_alloc()
Tomohiro Kusumi [Wed, 14 Oct 2020 15:30:20 +0000 (00:30 +0900)]
sys/vfs/hammer2: Simplify chain allocation in hammer2_chain_alloc()

This initially had different behavior depending on blockref type,
but today all it does is allocate a chain, so just test invalid empty
blockref case for empty blockref slot and then allocate.

10 days agosys/vfs/hammer2: Cleanup invalid blockref type switch cases
Tomohiro Kusumi [Wed, 14 Oct 2020 15:19:20 +0000 (00:19 +0900)]
sys/vfs/hammer2: Cleanup invalid blockref type switch cases

10 days agosys/vfs/hammer2: Remove unused chain size variable in hammer2_chain_rename()
Tomohiro Kusumi [Tue, 13 Oct 2020 15:50:46 +0000 (00:50 +0900)]
sys/vfs/hammer2: Remove unused chain size variable in hammer2_chain_rename()

This local variable is unused.
It used to be in around a4dc31e022f821212e65d95b025bca4d77c73ca6 in 2013.
Also remove obsolete comment.

10 days agomt(1): Change c_code to u_long because it has to hold an ioctl command.
Sascha Wildner [Wed, 14 Oct 2020 14:25:41 +0000 (16:25 +0200)]
mt(1): Change c_code to u_long because it has to hold an ioctl command.

Forgotten porting to x86_64.

10 days agokernel: Remove unused memmove() and memset() from libkern.
Sascha Wildner [Sun, 11 Oct 2020 21:49:47 +0000 (23:49 +0200)]
kernel: Remove unused memmove() and memset() from libkern.

10 days agodf(1): Remove an unused function.
Sascha Wildner [Wed, 14 Oct 2020 14:22:23 +0000 (16:22 +0200)]
df(1): Remove an unused function.

11 days agodrm: fix a bug in ttm_bo_add_to_lru()
François Tigeot [Wed, 14 Oct 2020 08:54:21 +0000 (10:54 +0200)]
drm: fix a bug in ttm_bo_add_to_lru()

11 days agoipcrm(1): semctl() needs no argument for IPC_RMID.
Sascha Wildner [Tue, 13 Oct 2020 20:47:48 +0000 (22:47 +0200)]
ipcrm(1): semctl() needs no argument for IPC_RMID.

11 days agonewfs_hammer2 - Cleanup slight code mess
Matthew Dillon [Tue, 13 Oct 2020 17:23:56 +0000 (10:23 -0700)]
newfs_hammer2 - Cleanup slight code mess

* Cleanup the use of NLabels in the strlen() tests.

* Require -L labels to not be 0-length, and change the string length
  limit from 64 to 63.  64 should work just fine since we store the
  length field, but its easier to debug with termination.

Reported-by: kHacks
12 days agokernel - Remove unintended debug kprintf() from vfs_mount.c
Matthew Dillon [Tue, 13 Oct 2020 06:38:31 +0000 (23:38 -0700)]
kernel - Remove unintended debug kprintf() from vfs_mount.c

* Remove unintended debug kprintf()

12 days agokernel - Initial commit for Existential structural tracking
Matthew Dillon [Mon, 12 Oct 2020 22:57:46 +0000 (15:57 -0700)]
kernel - Initial commit for Existential structural tracking

* Initial commit for exislock (existance-lock) support, based on
  cpu tick interlocks.  Requires a bit more work.

  (see also previous commit 'Add missing sys/exislock.h' which wasn't
  actually missing at the time).

  This is a type-safe critical section plus a cache-friendly soft-lock
  type for system data structures that allows interlocking against structural
  existance and usability.

  The critical path has no atomic operations or cache ping-ponging.  Cache
  ping-ponging occurs at most once per pseudo_tick (once every 2 real
  ticks) to reset the timeout field.

* Implements a global 'pseudo_ticks' counter.  This counter is only able
  to count when all cpus are armed.  All cpus are armed on every 1->0
  transition of their mycpu->gd_exislockcnt field.  This, while the
  interlock is held, the global pseudo_ticks counter will increment
  by at most one, then stall.

  The cpus are disarmed when this increment occurs on even ticks
  and rearmed (if gd_exislockcnt is 0) on odd ticks.  This the global
  pseudo_ticks counter increments at roughly hz / 2 under most conditions.

  This means that even when the per-cpu type-safe critical section is
  under very heavy load, cycling constantly, the global pseudo_ticks
  still tends to increment on a regular basis becaues there are a lot
  of 1->0 transitions occurring on each cpu.  Importantly, the cpus do
  not need to be synchronized in order for pseudo_ticks to increment.

* This codebase will be used to implement type-safe storage and
  lockless hash-table based caches.  It works like this:

  - You use exis_hold() and exis_drop() around the type-safe
    code sections.

    While held, the global pseudo_ticks variable is guaranteed to
    increment no more than once (due to a prior arming condition).

  - You access the hash table or other robust structural topology
    (with or without locks depending), then call exis_isusable() on
    the structure you get to determine if it is usable.  If TRUE is
    returned, the structure will remain type-safe and will not be
    repurposed for the duration of the exis_hold().

    You then proceed to use the structure as needed, with or without
    further locking depending on what you are doing.  For example,
    accessing stat information from a vnode structure could potentially
    proceed without further locking.

12 days agokernel - Add missing sys/exislock.h
Matthew Dillon [Mon, 12 Oct 2020 21:44:07 +0000 (14:44 -0700)]
kernel - Add missing sys/exislock.h

* Add missing sys/exislock.h

12 days agosys/vfs/hammer2: Remove redundant chain size calculation in hammer2_chain_create()
Tomohiro Kusumi [Mon, 12 Oct 2020 15:32:01 +0000 (00:32 +0900)]
sys/vfs/hammer2: Remove redundant chain size calculation in hammer2_chain_create()

hammer2_chain_alloc() sets ->bytes, so no need to recalculate.
hammer2_chain_alloc() was implemented differently when this was
written in 6934ae32a6b0216475b705fb6831ae2ca9da7672 in 2012.

Also remove obsolete comment from
b7add6753e221920947c96fab3314c39a2f67fe4 in 2015.

12 days agosys/vfs/hammer2: Cleanup static chain function prototypes
Tomohiro Kusumi [Sun, 11 Oct 2020 15:29:24 +0000 (00:29 +0900)]
sys/vfs/hammer2: Cleanup static chain function prototypes

12 days agosys/vfs/hammer2: Remove wrong comment on chain
Tomohiro Kusumi [Sun, 11 Oct 2020 15:12:27 +0000 (00:12 +0900)]
sys/vfs/hammer2: Remove wrong comment on chain

This union was removed in 10252dc74a966f1dbb2cb131b287e03d95807a15 in 2013.

12 days agoNote update to dhcpcd-9.3.1
Roy Marples [Mon, 12 Oct 2020 14:20:37 +0000 (15:20 +0100)]
Note update to dhcpcd-9.3.1

12 days agoMerge branch 'vendor/DHCPCD'
Roy Marples [Mon, 12 Oct 2020 14:19:09 +0000 (15:19 +0100)]
Merge branch 'vendor/DHCPCD'

12 days agoUpdate to dhcpcd-9.3.1 with the following changes: vendor/DHCPCD
Roy Marples [Mon, 12 Oct 2020 14:17:22 +0000 (15:17 +0100)]
Update to dhcpcd-9.3.1 with the following changes:
 * dhcpcd: carrier handling issue fixed from 9.3.0
 * dhcpcd: log if interface type is unsupported in debug
 * duid: memory leak fixed if UUID wanted but none available
 * privsep: fix receiving inet and no BPF running
 * privsep: allow gettimeofday for SECCOMP
 * privsep: fix stderr redirection again

13 days agoinstaller: Fix hammer2 install.
Sascha Wildner [Mon, 12 Oct 2020 08:17:38 +0000 (10:17 +0200)]
installer: Fix hammer2 install.

The -f option was removed from newfs_hammer2 in 7b2944d3f07cfec26f629f9e.

Reported-by: zrj
13 days agouname(1): implement -K and -U options
Daniel Fojt [Sun, 11 Oct 2020 13:48:00 +0000 (15:48 +0200)]
uname(1): implement -K and -U options

Add two new options to print version of the running kernel (-K) and
user environment (-U).

Taken from: FreeBSD
Disscussed with: Sascha Wildner, Pierre-Alain TORET

2 weeks agousr.sbin/fstyp: Test all HAMMER2 volume headers
Tomohiro Kusumi [Sat, 10 Oct 2020 17:30:16 +0000 (02:30 +0900)]
usr.sbin/fstyp: Test all HAMMER2 volume headers

2 weeks agousr.sbin/fstyp: Fix style
Tomohiro Kusumi [Sat, 10 Oct 2020 15:45:11 +0000 (00:45 +0900)]
usr.sbin/fstyp: Fix style

2 weeks agosys/vfs/hammer2: Add hammer2_inode_{data,inode}_count()
Tomohiro Kusumi [Fri, 9 Oct 2020 19:32:59 +0000 (04:32 +0900)]
sys/vfs/hammer2: Add hammer2_inode_{data,inode}_count()

Should hide chain details from vnops frontend.

2 weeks agosys/vfs/hammer2: Remove unused ITOV()
Tomohiro Kusumi [Fri, 9 Oct 2020 17:17:27 +0000 (02:17 +0900)]
sys/vfs/hammer2: Remove unused ITOV()

For inode to vnode, HAMMER2 (and most fs) just use ->vp.

2 weeks agoUpgrade file(1) and libmagic. 2/2
Daniel Fojt [Sat, 10 Oct 2020 08:26:53 +0000 (10:26 +0200)]
Upgrade file(1) and libmagic. 2/2

Update README.{DELETED,DRAGONFLY} and regenerate config.h.

2 weeks agoUpgrade file(1) and libmagic. 1/2
Daniel Fojt [Sat, 10 Oct 2020 08:24:20 +0000 (10:24 +0200)]
Upgrade file(1) and libmagic. 1/2

Merge branch 'vendor/FILE' into master.

2 weeks agovendor/file: upgrade from 5.38 to 5.39 vendor/FILE
Daniel Fojt [Fri, 9 Oct 2020 16:22:09 +0000 (18:22 +0200)]
vendor/file: upgrade from 5.38 to 5.39

Summary:

- add guid support
- avoid misbehaviour with hand-crafted magic file
- add missing DER types and document DER better in man page
- fix memory leaks

For details, see ChangeLog.

2 weeks agolibc: Sync wordexp(3) with FreeBSD.
Sascha Wildner [Fri, 9 Oct 2020 19:41:48 +0000 (21:41 +0200)]
libc: Sync wordexp(3) with FreeBSD.

I went and changed freebsd_wordexp() to wordexp2(), though.

Taken-from: FreeBSD

2 weeks agoSync ACPICA with Intel's version 20200925.
Sascha Wildner [Fri, 9 Oct 2020 18:15:21 +0000 (20:15 +0200)]
Sync ACPICA with Intel's version 20200925.

* Preserve memory opregion mappings.

* Support for SMBUS predefined names.

* Fix some issues in acpiexec(8), acpihelp(8), and iasl(8).

For detailed list, please see sys/contrib/dev/acpica/changes.txt.

2 weeks agodrm: Fix a locking issue in shmem_read_mapping_page()
François Tigeot [Thu, 8 Oct 2020 18:29:05 +0000 (20:29 +0200)]
drm: Fix a locking issue in shmem_read_mapping_page()

Reported-by: tuxillo
2 weeks agosys/vfs/hammer2: Make hammer2_dump_chain() a bit more verbose
Tomohiro Kusumi [Thu, 8 Oct 2020 17:46:13 +0000 (02:46 +0900)]
sys/vfs/hammer2: Make hammer2_dump_chain() a bit more verbose

using hammer2(8) "show" format.

2 weeks agosbin/fsck_hammer2: Support >1 paths
Tomohiro Kusumi [Thu, 8 Oct 2020 16:26:07 +0000 (01:26 +0900)]
sbin/fsck_hammer2: Support >1 paths

2 weeks agosbin/mount_hammer2: Correct description for -u option
Tomohiro Kusumi [Thu, 8 Oct 2020 15:32:15 +0000 (00:32 +0900)]
sbin/mount_hammer2: Correct description for -u option

This only does upgrading.

2 weeks agosys/vfs/hammer2: Fix broken mount_hammer2(8) -u option
Tomohiro Kusumi [Wed, 7 Oct 2020 16:42:57 +0000 (01:42 +0900)]
sys/vfs/hammer2: Fix broken mount_hammer2(8) -u option

It fails with EFAULT when copyin-ing NULL volume string.

2 weeks agosbin/hammer2: "Labels" -> "Label"
Tomohiro Kusumi [Wed, 7 Oct 2020 15:30:07 +0000 (00:30 +0900)]
sbin/hammer2: "Labels" -> "Label"

2 weeks agosbin/hammer2: Sync "info" output with "pfs-list"
Tomohiro Kusumi [Tue, 6 Oct 2020 16:16:16 +0000 (01:16 +0900)]
sbin/hammer2: Sync "info" output with "pfs-list"

These two retrieve the same info in different ways,
so show the same info instead of "info" just printing PFS label.

2 weeks agosbin/hammer2: Change "info" callback to take const void*
Tomohiro Kusumi [Tue, 6 Oct 2020 15:42:39 +0000 (00:42 +0900)]
sbin/hammer2: Change "info" callback to take const void*

2 weeks agosbin/hammer2: Cleanup "info" with cmd_callback typedef
Tomohiro Kusumi [Tue, 6 Oct 2020 15:12:17 +0000 (00:12 +0900)]
sbin/hammer2: Cleanup "info" with cmd_callback typedef

2 weeks agosys/vfs/hammer2: Remove *pip argument from hammer2_inode_repoint()
Tomohiro Kusumi [Mon, 5 Oct 2020 16:01:18 +0000 (01:01 +0900)]
sys/vfs/hammer2: Remove *pip argument from hammer2_inode_repoint()

Inode no longer has a pointer to its parent since
92e2ca6e34de0686c34f574929b423764f580f9d in 2016,
so no parent argument to repoint (which are NULL's anyway)
needed in hammer2_inode_repoint().

2 weeks agoUpdate for dhcpcd-9.3.0
Roy Marples [Mon, 5 Oct 2020 16:28:08 +0000 (17:28 +0100)]
Update for dhcpcd-9.3.0

2 weeks agoMerge branch 'vendor/DHCPCD'
Roy Marples [Mon, 5 Oct 2020 16:24:54 +0000 (17:24 +0100)]
Merge branch 'vendor/DHCPCD'

2 weeks agoUpdate to dhcpcd-9.3.0 with the following changes:
Roy Marples [Mon, 5 Oct 2020 16:22:25 +0000 (17:22 +0100)]
Update to dhcpcd-9.3.0 with the following changes:
 * dhcpcd: Backticks have been removed from quoting filenames
 * dhcpcd: Only manipulate stdin, stdout and stderr if they are valid
 * duid: Adjust option so the type can be specified
 * logerr: Don't leak logfile fd to scripts
 * privsep: Run the launcher process in the sandbox
 * privsep: getifaddrs now carries ifa_data for BSD
 * BSD: Use `ifi_link_state` as the single source of truth about carrier
 * BSD: Ignore vether(4) devices by default

2 weeks agosoreadable() should consider so_rerror
Roy Marples [Mon, 5 Oct 2020 08:59:35 +0000 (09:59 +0100)]
soreadable() should consider so_rerror

2 weeks agosbin/hammer2: Change hammer2_uuid_to_str() to take const pointer
Tomohiro Kusumi [Sun, 4 Oct 2020 21:01:12 +0000 (06:01 +0900)]
sbin/hammer2: Change hammer2_uuid_to_str() to take const pointer

2 weeks agosbin/hammer2: Add hammer2_pfssubtype_to_str()
Tomohiro Kusumi [Sun, 4 Oct 2020 17:04:48 +0000 (02:04 +0900)]
sbin/hammer2: Add hammer2_pfssubtype_to_str()

2 weeks agosbin/hammer2: Sort "pfs-list" by PFS label
Tomohiro Kusumi [Sun, 4 Oct 2020 15:42:06 +0000 (00:42 +0900)]
sbin/hammer2: Sort "pfs-list" by PFS label

2 weeks agosys/vfs/hammer2: Fix wrong comment in hammer2_recovery_scan()
Tomohiro Kusumi [Sat, 3 Oct 2020 19:52:20 +0000 (04:52 +0900)]
sys/vfs/hammer2: Fix wrong comment in hammer2_recovery_scan()

It no longer cares about PFS boundary since
e513e77e7d72a7b81fe5a8e60f5d9511e10af682 in 2015.

3 weeks agogcc: Allow our C++ headers to survive -Wsystem-headers (2).
Sascha Wildner [Sat, 3 Oct 2020 17:56:19 +0000 (19:56 +0200)]
gcc: Allow our C++ headers to survive -Wsystem-headers (2).

The previous commit (894c19b2d84fd28593ce799678d7d9f7d33936ef) wasn't
actually working because __LONG_LONG_SUPPORTED wasn't yet known.

Include <sys/cdefs.h> for it.

Reported-by: tuxillo
3 weeks agosbin/hammer2: Adjust "stat" output format
Tomohiro Kusumi [Sat, 3 Oct 2020 15:48:09 +0000 (00:48 +0900)]
sbin/hammer2: Adjust "stat" output format

3 weeks agosys/vfs/hammer2: Don't expose inode's kva via ioctl
Tomohiro Kusumi [Sat, 3 Oct 2020 16:05:06 +0000 (01:05 +0900)]
sys/vfs/hammer2: Don't expose inode's kva via ioctl

This was just for debugging, and apparently no longer used.

3 weeks agosys/vfs/hammer2: Adjust some kprintfs in vfsops
Tomohiro Kusumi [Sat, 3 Oct 2020 15:30:09 +0000 (00:30 +0900)]
sys/vfs/hammer2: Adjust some kprintfs in vfsops

3 weeks agosbin/hammer2: Sync "pfs-create" message format with "pfs-delete"
Tomohiro Kusumi [Fri, 2 Oct 2020 15:19:08 +0000 (00:19 +0900)]
sbin/hammer2: Sync "pfs-create" message format with "pfs-delete"

3 weeks agosbin/hammer2: Make "pfs-delete" error message handle ENOENT case
Tomohiro Kusumi [Thu, 1 Oct 2020 17:07:25 +0000 (02:07 +0900)]
sbin/hammer2: Make "pfs-delete" error message handle ENOENT case

If all attempts failed before ioctl(HAMMER2IOC_PFS_DELETE) without
valid used_fd, print not-found message rather than just FAILED.

3 weeks agosys/vfs/hammer2: Make ioctl(HAMMER2IOC_PFS_DELETE) return EBUSY if mounted
Tomohiro Kusumi [Thu, 1 Oct 2020 16:32:07 +0000 (01:32 +0900)]
sys/vfs/hammer2: Make ioctl(HAMMER2IOC_PFS_DELETE) return EBUSY if mounted

Don't let hammer2(8) "pfs-delete" delete a currently mounted PFS...

3 weeks agoFix typos in libfetch and ext2fs.
Sascha Wildner [Fri, 2 Oct 2020 05:37:20 +0000 (07:37 +0200)]
Fix typos in libfetch and ext2fs.

3 weeks agosbin/hammer2: Add missing PFS types for "pfs-list"
Tomohiro Kusumi [Wed, 30 Sep 2020 16:47:55 +0000 (01:47 +0900)]
sbin/hammer2: Add missing PFS types for "pfs-list"

Added missing ones, but these two shouldn't match.

3 weeks agosbin/fsck_hammer2: Fix whitespace in usage output
Tomohiro Kusumi [Wed, 30 Sep 2020 16:44:24 +0000 (01:44 +0900)]
sbin/fsck_hammer2: Fix whitespace in usage output

3 weeks agosbin/fsck_hammer2: Add -P option to print PFS information
Tomohiro Kusumi [Wed, 30 Sep 2020 16:34:08 +0000 (01:34 +0900)]
sbin/fsck_hammer2: Add -P option to print PFS information

This prints PFS info, in the same format as "pfs-list" in hammer2(8).

The problem with "pfs-list" is it requires HAMMER2 inode, but in order
to mount HAMMER2, PFS label is required. This option provides "pfs-list"
equivalent via block device.

3 weeks agosys/vfs/hammer2: Make corrupted volume header messages verbose
Tomohiro Kusumi [Tue, 29 Sep 2020 15:11:29 +0000 (00:11 +0900)]
sys/vfs/hammer2: Make corrupted volume header messages verbose

HAMMER2 can be mounted if at least 1 volume header is alive,
but make error messages verbose to indicate corrupted ones on mount.

3 weeks agorc: Add handler for allow_listen_override.
Antonio Huete Jimenez [Mon, 28 Sep 2020 22:57:39 +0000 (00:57 +0200)]
rc: Add handler for allow_listen_override.

  - This is a follow-up of commit 2ea2781e4d73ee6.
  - Allow setting allow_listen_override globally for all jails,
    by default it is disabled:

          jail_default_allow_listen_override    (default: disabled)

  - Adjust rc.conf(5) manpage too.

3 weeks agogcc: Allow our C++ headers to survive -Wsystem-headers.
Sascha Wildner [Mon, 28 Sep 2020 20:25:59 +0000 (22:25 +0200)]
gcc: Allow our C++ headers to survive -Wsystem-headers.

It was breaking on defining a macro that resolves to a defined()
directive, which is apparently an issue in C++ land. As a workaround,
define a C++ specific macro that is either 0 or 1 for long long
support and can be used without issues.

Stop filtering out -Wsystem-headers in CXXFLAGS. The remaining -W...
options that are filtered out are all C specific.

3 weeks agosys/vfs/hammer2: Return ENOENT if PFS label not found on mount
Tomohiro Kusumi [Mon, 28 Sep 2020 15:24:30 +0000 (00:24 +0900)]
sys/vfs/hammer2: Return ENOENT if PFS label not found on mount

and make sbin/mount_hammer2 handle ENOENT with an error message.

This can easily happen if newfs_hammer2'd with explcit label
specification (i.e. no default label created), and the reason isn't
obvious with just EINVAL.

3 weeks agosbin/fsck_msdosfs: Use %ju and cast to (uintmax_t) to avoid using PRI* macros
Tomohiro Kusumi [Mon, 28 Sep 2020 18:42:04 +0000 (03:42 +0900)]
sbin/fsck_msdosfs: Use %ju and cast to (uintmax_t) to avoid using PRI* macros

from freebsd/freebsd@51dd232dae465eb3cbe00596ba0583964e0c259f

3 weeks agosbin/mount_hammer2: Use MOPT_UPDATE
Tomohiro Kusumi [Sun, 27 Sep 2020 16:31:46 +0000 (01:31 +0900)]
sbin/mount_hammer2: Use MOPT_UPDATE

3 weeks agosbin/hammer2: Fix default value of vfs.hammer2.cluster_write
Tomohiro Kusumi [Sun, 27 Sep 2020 15:05:09 +0000 (00:05 +0900)]
sbin/hammer2: Fix default value of vfs.hammer2.cluster_write

4 weeks agoworld: Staticize various variables and also remove a couple of unused ones.
Sascha Wildner [Sun, 27 Sep 2020 10:46:47 +0000 (12:46 +0200)]
world: Staticize various variables and also remove a couple of unused ones.

4 weeks agosh(1): bring sh from freebsd
Krzysztof Piecuch [Fri, 11 Sep 2020 17:24:23 +0000 (17:24 +0000)]
sh(1): bring sh from freebsd

I used freebsd@19bed3ae2eb256a2c68dabbcb77eff2835d569de.

* Write absolute path in command -vV and type
* Keep ignored SIGINT/SIGQUIT after set in a background job
* print a newline when ^D quits sh
* Do not ignore INTOFF during a trap
* Fix description of the "\$" sequence for PS1
* Allow more scripts without #!
* Fix double INTON with vfork
* Assert INTOFF rather than applying it in ck*
* Remove remnants to compile out fc completely
* Fix a "may be unused" warning on mips-gcc
* remove duplicate el definition
* fix read builtin on 32-bit systems
* Improve performance of "read" built-in command when using a seekable
* Fix rare memory leak with SIGINT
* Do not use our custom completion function, it is not needed anymore
* Add set -o pipefail
* Send normal output from bind builtin to stdout
* Restore $((x)) error checking after fix for $((-9223372036854775808))
* Make sh(1) support \u in PS1.  This removes one fork/exec on
  interactive
* Send libedit "ferr" output to fd 2
* Fix an edge case when parsing large numbers which resulted in
  inconsistent
* Do not place exported but unset variables into the environment
* Make sh(1) collapse $HOME into "~" in PS1.
* Remove -c string from set builtin documentation
* Fix ${param?} default error message
* Use 126 and 127 exit status for failures opening a script
* Unify EXERROR and EXEXEC
* Use exitstatus instead of exerrno to pass EXEXEC status
* Fix formal overflow in pointer arithmetic
* Describe how to prevent *.core files from being created using ulimit.
* Don't treat % specially in CDPATH
* Don't use padvance() for MAIL/MAILPATH
* Split CNL syntax category to avoid a check on state[level].syntax
* Allow unquoted newlines in word in ${param+word} etc.
* Don't have [ match any [[:class:]]
* Allow overriding VTABSIZE at compile-time.
* Refactor job status printing, preparing for -o pipefail and similar
* Move various structs from jobs.h to jobs.c
* Fix a few speelling errors
* Don't leak wait* implementation details from jobs.c
* Markup and spelling fixes
* Fix mandoc -Tlint warnings in bin/
* General further adoption of SPDX licensing ID tags.
* Remove broken #ifdef NOHACK code (related to sh -c).
* Ignore error when cd writes the directory actually switched to.
* Enable interrupts before executing EXIT trap and doing final flush.
* Call fc -e editor with interrupts enabled.
* Make sure to process SIGINT if SETINTON re-enables processing.
* Allow defining nofork builtins from builtins.def and move always-safe
  ones there.
* Fix INTOFF leak when a redirection on a compound command fails.
* Keep output buffer across builtins.
* Ensure memout.bufsize matches allocated buffer, if it exists.
* Simplify output buffering.
* Fix '-' from quoted arithmetic in case/glob pattern range.
* Fix INTOFF leak after a builtin with different locale settings.
* Update TOUR and comments for some code changes, some of them old.
* Simplify handling of newlines in command substitution.
* Simplify setinteractive().
* Fix use after free when resetting an in-use alias.
* Fix unalias -a while an alias is currently in use.
* Reduce size of limits table.
* Remove an XXX comment: it is normal for builtins to use argptr.
* Remove global state from collate_range_cmp().
* Don't scan word twice in ${param=word}.
* Don't scan word twice in ${param#%##%%word}.
* Don't scan word twice in ${param+-word}.
* Remove unused function declaration for arith_lex_reset().
* Remove unused return value of subevalvar_misc().
* Get rid of global variable argbackq.
* Fix executing wrong command with ${unsetvar#$(cmdsubst)}$(cmdsubst).
* Fix crash if a -T trap is taken during command substitution.
* bin: normalize paths using SRCTOP-relative paths or :H when possible
* Remove empty Li
* Do not import IFS's value from the environment.
* Fix a clang warning.
* Path generation was not according to collate
* Back out non-collating [a-z] ranges.
* After removing collation for [a-z] ranges in r302512, do it here too.
* Improve descriptions in 'ulimit -a' output.
* Clarify the explanations for the hostname and FQDN entries.
* Match the descriptions of the \H and \h prompt string sequences to reality.
* Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.
* Handle empty hostname and $PWD when building prompt
* Write LINENO value to stack string directly.
* Merge the projects/release-pkg branch to head.
* Simplify code by removing variable bracketed_name.
* replace 0 with NULL for pointers.
* Fix use-after-free if a trap replaces itself.
* Fix copying uninitialized field 'special'.
* Fix handling of umtxp resource limit in sh(1)/ulimit(1), limits(1), add
* Avoid out-of-bounds access in setoptionbyindex() for 'set -o nolog'.
* Fix some dead stores.
* Remove a redundant STPUTC check.
* Don't trust that signal descriptions fit within 49 bytes.
* Fix set -v and multiline history after r295825.
* Don't hash alias name when there are no aliases.
* Optimize setprompt(0).
* Remove unnecessary flushouts while reading script.
* Rework code to remove '\0' from shell input.
* Don't allocate a redirtab if there are no redirections.
* Document 'cd -'.
* Constify internal representation in expand.c.
* Remove a global variable from cd.c.
* Use OLDPWD shell variable for 'cd -'.
* Clean a readonly local, even if the variable does not exist outside.
* Simplify some code related to positional parameters.
* Update associated state when restoring locals while leaving a function.
* Reduce size of options table.
* Ensure OPTIND=1 in subshell without forking does not affect outer env.
* Reduce size of builtins table.
* Remove redundant CTLQUOTEMARK checks.
* Reindent expandmeta().
* Perform pathname generation during the first expansion phases.
* Perform IFS splitting during the first expansion phases.
* Split subevalvar() in #/##/%/%% and =/? parts.
* sh/mknodes: Close files and check for errors when writing.
* Fix use-after-free when attempting to modify a read-only variable.
* Remove global state from nodes.c.
* Fix ""$@, which should not use the special case for "$@".
* Avoid copying argv for simple commands.
* Make struct arglist an array instead of a linked list.
* Allow empty << EOF markers.
* Fix read with escaped IFS characters at the end.
* Add set -o nolog.
* Fix out of bounds read when there is no ] after a [:class:].
* Don't create bad parse result when postponing a bad substitution error.
* Avoid negative character values from $'\Uffffffff' etc.
* Backslash-newline should not affect field splitting in read builtin.
* When setting option via long name, don't go via letter.
* libedit has supported multibyte encodings for a while.
* Fix some arithmetic undefined behaviour.

Taken-from: FreeBSD

4 weeks agogpt(8): device_path does not need to be global.
Sascha Wildner [Wed, 23 Sep 2020 13:49:20 +0000 (15:49 +0200)]
gpt(8): device_path does not need to be global.

4 weeks agosbin/hammer2: Fix calloc element size in get_hammer2_mounts()
Tomohiro Kusumi [Sat, 26 Sep 2020 15:04:10 +0000 (00:04 +0900)]
sbin/hammer2: Fix calloc element size in get_hammer2_mounts()