dragonfly.git
3 years agovkernel: Adjust vke(4) for the if_media.h changes (fixes vkernel build).
Sascha Wildner [Sat, 29 Aug 2020 12:40:18 +0000 (14:40 +0200)]
vkernel: Adjust vke(4) for the if_media.h changes (fixes vkernel build).

3 years ago<net/if_media.h>: Adjust ethernet media types some more.
Sascha Wildner [Sat, 29 Aug 2020 10:13:58 +0000 (12:13 +0200)]
<net/if_media.h>: Adjust ethernet media types some more.

* IFM_1000_FX was cleaned up long ago in FreeBSD (see r95702) and
  NetBSD.

* Add a useful comment from FreeBSD.

* Adjust some whitespace and indentation.

While here, clean up the ifmedia.4 manual page a bit and add a
IFM_10G_TWINAX description (from NetBSD).

3 years agox86_64/machdep.c: Fix two minor typos and indentation
Aaron LI [Sat, 29 Aug 2020 08:00:38 +0000 (16:00 +0800)]
x86_64/machdep.c: Fix two minor typos and indentation

3 years agokernel - Fix KVM implosion by enabling the IOAPIC
Matthew Dillon [Sat, 29 Aug 2020 01:32:43 +0000 (18:32 -0700)]
kernel - Fix KVM implosion by enabling the IOAPIC

* We were disabling the IOAPIC universally when running under a VM,
  because older VMs sometimes broke when it was enabled.

  However, this can actually implode the virtual machine by causing
  interrupt routing to go haywire.

  Add a case statement and always enable the IOAPIC on bare hardware
  and KVM guests.

* Change the default to also enable the IOAPIC on all other VMs.
  Cases can be added for specific disablement if necessary.

* Fixes Google Cloud Environment booting.

3 years agokernel - Be more verbose about disabling the IOAPIC
Matthew Dillon [Sat, 29 Aug 2020 01:27:46 +0000 (18:27 -0700)]
kernel - Be more verbose about disabling the IOAPIC

* Be more verbose when disabling the IOAPIC.

* We current disable auto-EOI on the lapic.  Add some code in
  case we enable in the future to ensure that it remains disabled
  for KVM guests.

3 years agokernel - Fix atomicy issue in APIC EOI and enable_icus
Matthew Dillon [Sat, 29 Aug 2020 01:23:50 +0000 (18:23 -0700)]
kernel - Fix atomicy issue in APIC EOI and enable_icus

* Change ICU_INTREN() and ICU_INTRDIS() to only modify the ICU
  whos bit is being changed, rather than always setting the mask
  for both ICUs.

* If masking a level IRQ on the APIC, make sure the EOI
  to the APIC is atomic with the masking operation.

* Make sure that ICU enablement is atomic with ICU masking
  operations.

* Does not fix any known bugs

3 years agosbin/hammer2: Introduce HAMMER2_SHOW_DEPTH to limit "show" depth
Tomohiro Kusumi [Fri, 28 Aug 2020 15:24:28 +0000 (00:24 +0900)]
sbin/hammer2: Introduce HAMMER2_SHOW_DEPTH to limit "show" depth

Useful to check HAMMER2 radix tree nodes not so deep in the tree.

3 years agosbin/hammer2: Drop extra indentation in "show" when -q
Tomohiro Kusumi [Fri, 28 Aug 2020 15:23:46 +0000 (00:23 +0900)]
sbin/hammer2: Drop extra indentation in "show" when -q

3 years agosbin/hammer2: Fix "show" and "volhdr" output format
Tomohiro Kusumi [Fri, 28 Aug 2020 15:39:59 +0000 (00:39 +0900)]
sbin/hammer2: Fix "show" and "volhdr" output format

3 years agolibc/getdate: Add getdate_err to the Symbol.map too.
Sascha Wildner [Fri, 28 Aug 2020 11:29:32 +0000 (13:29 +0200)]
libc/getdate: Add getdate_err to the Symbol.map too.

Seems lang/clisp picks up getdate().

Reported-by: zrj
3 years agokernel: Adjust wmesg.
Sascha Wildner [Fri, 28 Aug 2020 04:38:08 +0000 (06:38 +0200)]
kernel: Adjust wmesg.

Just like in vfs_rootmountalloc().

Pointed-out-by: aly
3 years ago<net/if_media.h>: IFM_HPNA_1 != IFM_10G_LR, renumber as needed.
Sascha Wildner [Thu, 27 Aug 2020 15:41:04 +0000 (17:41 +0200)]
<net/if_media.h>: IFM_HPNA_1 != IFM_10G_LR, renumber as needed.

Reported-by: zrj
3 years agosys/vfs/hammer2: Remove HAMMER2_MINIO* macros
Tomohiro Kusumi [Thu, 27 Aug 2020 15:08:07 +0000 (00:08 +0900)]
sys/vfs/hammer2: Remove HAMMER2_MINIO* macros

HAMMER2_MINIO* were added in 1a7cfe5ae3c897f704a358fd3e556a55e430dcb1
in 2013 to switch HAMMER2_MINIO* values with ifdefs when ondisk format
wasn't stable.

This is no longer needed, and using both HAMMER2_MINIO* and HAMMER2_LBUF*
should be avoided. Users of HAMMER2_MINIO* exist in several userspace
programs which walk through blockrefs from top to bottom.

3 years agoefibootmgr(8): Sync with FreeBSD.
Sascha Wildner [Thu, 27 Aug 2020 15:17:52 +0000 (17:17 +0200)]
efibootmgr(8): Sync with FreeBSD.

Adds the -f (--fw-ui) and -F (--no-fw-ui) options to enter (or not) the
firmware's user interface upon next boot.

Taken-from: FreeBSD

3 years agotmpfs - Improve assertions
Matthew Dillon [Thu, 27 Aug 2020 05:55:54 +0000 (22:55 -0700)]
tmpfs - Improve assertions

* Improve assertions to detect failed RB_INSERT() operations.

3 years agokernel - Deal with VOP_NRENAME races
Matthew Dillon [Thu, 27 Aug 2020 05:41:05 +0000 (22:41 -0700)]
kernel - Deal with VOP_NRENAME races

* VOP_NRENAME() as implemented by the kernel can race any number of
  ways, including deadlocking, allowing duplicate entries, and panicing
  tmpfs.  It typically requires a heavy test load to replicate this but
  a dsynth build triggered the issue at least once.

  Other recently reported tmpfs issues with log file handling might also
  be effected.

* A per-mount (semi-global) lock is now obtained whenever a directory
  is renamed.  This helps deal with numerous MP races that can cause
  lock order reversals.

  Loosely taken from netbsd and linux (mjg brought me up to speed on
  this).  Renaming directories is fraught with issues and this fix,
  while somewhat brutish, is fine.  Directories are very rarely renamed
  at a high rate.

* kern_rename() now proactively locks all four elements of a rename
  operation (source_dir, source_file, dest_dir, dest_file) instead of
  only two.

* The new locking function, cache_lock4_tondlocked(), takes no chances
  on lock order reversals and will use a (currently brute-force)
  non-blocking and lock cycling algorithm.  Probably needs some work.

* Fix a bug in cache_nlookup() related to reusing DESTROYED entries
  in the hash table.  This algorithm tried to reuse the entries while
  maintaining shared locks, since only the entries need to be manipulate
  to reuse them.  However, this resulted in lookup races which could
  cause duplicate entries.  The duplicate entries then triggered
  assertions in TMPFS.

* nlookup now tries a little harder and will retry if the parent of an
  element is flagged DESTROYED after its lock was released.  DESTROYED
  elements are not necessarily temporary events as an operation can wind
  up running in a deleted directory and must properly fail under those
  conditions.

* Use krateprintf() to reduce debug output related to rename race
  reporting.

* Revamp nfsrv_rename() as well (requires more testing).

* Allow nfs_namei() to be called in a loop for retry purposes if
  desired.  It now detects that the nd structure is initialized
  from a prior run and won't try to re-parse the mbuf (needs testing).

Reported-by: zrj, mjg
3 years agokernel - Document confusing physmap[1] initialization
Matthew Dillon [Wed, 26 Aug 2020 18:56:52 +0000 (11:56 -0700)]
kernel - Document confusing physmap[1] initialization

* Document confusing physmap[1] initialization

3 years agotmpfs - Enhance assertion (not a bug fix)
Matthew Dillon [Wed, 26 Aug 2020 17:47:50 +0000 (10:47 -0700)]
tmpfs - Enhance assertion (not a bug fix)

* Enhance a reported assertion to provide more information.

Reported-by: zrj
3 years agokernel - Remove tty-related debug message
Matthew Dillon [Wed, 26 Aug 2020 17:44:42 +0000 (10:44 -0700)]
kernel - Remove tty-related debug message

* Remove a debugging message that is no longer needed.  The kprintf was
  added to determine if a particular handled race could actually happen.
  Answer is: yes it can.

3 years agosys/vfs/hammer2: Remove comment on nonexistent MINALLOCSIZE
Tomohiro Kusumi [Wed, 26 Aug 2020 15:15:40 +0000 (00:15 +0900)]
sys/vfs/hammer2: Remove comment on nonexistent MINALLOCSIZE

Removed in 1a7cfe5ae3c897f704a358fd3e556a55e430dcb1 in 2013.

3 years agosbin/newfs_hammer2: Use ~HAMMER2_PBUFMASK64 to obtain pbuf offset
Tomohiro Kusumi [Wed, 26 Aug 2020 15:15:18 +0000 (00:15 +0900)]
sbin/newfs_hammer2: Use ~HAMMER2_PBUFMASK64 to obtain pbuf offset

HAMMER2 in practice uses ~HAMMER2_PBUFMASK64 for this purpose
rather than HAMMER2_OFF_MASK_HI which is only used here.
Also more readable considering use of PBUF macros in HAMMER2.

3 years agokernel/{a,b}list: Use __func__ in panic messages.
Sascha Wildner [Wed, 26 Aug 2020 09:54:37 +0000 (11:54 +0200)]
kernel/{a,b}list: Use __func__ in panic messages.

This fixes some mistakes too (*_radix_free -> *_leaf_free).

3 years agosys/vfs/hammer2: Fix whitespace to align indentation
Tomohiro Kusumi [Tue, 25 Aug 2020 17:16:15 +0000 (02:16 +0900)]
sys/vfs/hammer2: Fix whitespace to align indentation

3 years agosys/vfs/hammer2: Remove unused HAMMER2_AV* macros
Tomohiro Kusumi [Tue, 25 Aug 2020 17:10:19 +0000 (02:10 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_AV* macros

Appeared in 9061bde5ad5e46bcaee746ed03d598a75b38691f in 2013,
but never used.

The freemap layout when these were added is no longer compatible
with the current one, so these won't be used again either.

3 years agokernel/nata: Fix operator precedence issue.
Sascha Wildner [Tue, 25 Aug 2020 04:43:26 +0000 (06:43 +0200)]
kernel/nata: Fix operator precedence issue.

3 years agozoneinfo: Update /etc/localtime when upgrading timezones.
Sascha Wildner [Mon, 24 Aug 2020 19:04:04 +0000 (21:04 +0200)]
zoneinfo: Update /etc/localtime when upgrading timezones.

* Add tzsetup(8) to the bootstrap-tools.

* Install the backward file to retain obsolete timezones as links
  for backward compatibility. Remove all these timezones from
  Makefile_upgrade.inc again. Also extend mtree/BSD.usr.dist for
  this and remove the old 'dragonfly' file (which was only for UTC).

* After installing new timezones, run tzsetup -r to upgrade the user's
  chosen timezone. Allow this to fail for quickworlders. It will start
  working after the next full buildworld.

Taken-from: FreeBSD (with modifications)

3 years agosys/vfs/hammer2: Remove unused HAMMER2_OFF_NOPREF
Tomohiro Kusumi [Mon, 24 Aug 2020 16:20:11 +0000 (01:20 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_OFF_NOPREF

Appeared in 1a7cfe5ae3c897f704a358fd3e556a55e430dcb1 in 2013,
but never used.

3 years agosys/vfs/hammer2: Remove unused HAMMER2_OFF_BAD and HAMMER2_MAX_COPIES
Tomohiro Kusumi [Mon, 24 Aug 2020 16:14:36 +0000 (01:14 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_OFF_BAD and HAMMER2_MAX_COPIES

Appeared in 703720e4d599857d052f0a65f2840224ce36ec5a in 2012,
but never used.

3 years agosys/vfs/hammer2: Remove unused HAMMER2_SPECTHREADS
Tomohiro Kusumi [Sun, 23 Aug 2020 15:44:38 +0000 (00:44 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_SPECTHREADS

No longer used since 2085215738c03d949e60de63843cb91e84836eb9 in 2016.

3 years ago<sys/systm.h>: Fix muldivu64() comment.
Sascha Wildner [Sun, 23 Aug 2020 09:50:00 +0000 (11:50 +0200)]
<sys/systm.h>: Fix muldivu64() comment.

3 years agokernel/pmap: Remove code under !defined(PMAP_ADVANCED).
Sascha Wildner [Sat, 22 Aug 2020 18:03:16 +0000 (20:03 +0200)]
kernel/pmap: Remove code under !defined(PMAP_ADVANCED).

We've been running with PMAP_ADVANCED by default since February 27.
Remove the old, inactive code.

Approved-by: dillon
3 years agokernel - Remove global cwd statistics counters
Matthew Dillon [Fri, 21 Aug 2020 18:17:05 +0000 (11:17 -0700)]
kernel - Remove global cwd statistics counters

* These were only used for debugging purposes and interfere with
  MP operation.  Just remove them.

3 years agomake(1): Fix default search path back to just /usr/share/mk.
Sascha Wildner [Fri, 21 Aug 2020 17:36:48 +0000 (19:36 +0200)]
make(1): Fix default search path back to just /usr/share/mk.

This '...' hack was intended to fix pkgsrc problems at the time but
didn't work (see 2b01fcf91a45a96b and 3db89b525e9bf920). And it was
then left in in the hopes it might be useful for something.

However, in practice it can only lead to confusion when you're
building in another BSD's tree for testing purposes and make starts
looking for and using .mk files we don't have in the upper levels
of the foreign tree instead of properly reporting that it could not
find the file.

3 years agodhclient: teach the script about resolvconf(8)
Roy Marples [Thu, 20 Aug 2020 19:53:00 +0000 (20:53 +0100)]
dhclient: teach the script about resolvconf(8)

3 years agokate.4: Sort SEE ALSO.
Sascha Wildner [Thu, 20 Aug 2020 09:55:58 +0000 (11:55 +0200)]
kate.4: Sort SEE ALSO.

3 years agogames/sail: adjust to updated ncurses
Daniel Fojt [Wed, 19 Aug 2020 18:14:00 +0000 (20:14 +0200)]
games/sail: adjust to updated ncurses

Reported by: Rimvydas Jasinskas

3 years agogames/mille: adjust to updated ncurses
Daniel Fojt [Wed, 19 Aug 2020 18:12:11 +0000 (20:12 +0200)]
games/mille: adjust to updated ncurses

Reported by: Rimvydas Jasinskas

3 years agosys/vfs/hammer2: Remove unused tailq structs
Tomohiro Kusumi [Wed, 19 Aug 2020 15:12:33 +0000 (00:12 +0900)]
sys/vfs/hammer2: Remove unused tailq structs

No longer used since
da6f36f44bb9c76612e31b56cdfe4d787e53d61f in 2014 and
ecfe89b8868b30c9ddfa9c86cb4b0a20365a248d in 2018.

3 years agokernel - Remove machdep.hack_efifb_probe_early hack
Michael Neumann [Wed, 19 Aug 2020 14:11:34 +0000 (16:11 +0200)]
kernel - Remove machdep.hack_efifb_probe_early hack

* This hack was introduced as a temporary fix for bug #3167 (see commit c2a57f42).

* Since commit faeb2db "kernel - Hack the DMAP size" the temporary hack is no longer required.

* Tested on TUXEDO InfinityBook Pro 14v4 laptop where this bug initially occured.

3 years agokernel: recognize newer Intel I219 ethernet controllers
David Shao [Tue, 18 Aug 2020 11:18:36 +0000 (04:18 -0700)]
kernel: recognize newer Intel I219 ethernet controllers

Define additional Intel I219-LM and I219-V Ethernet PCI device numbers.

Taken from NetBSD current sys/dev/pci/pcidevs.h, verified on physical
hardware for I219-V11 0x0D4D.

Submitted via: https://bugs.dragonflybsd.org/issues/3244

3 years agoUpgrade ncurses. 2/2
Daniel Fojt [Fri, 14 Aug 2020 19:28:41 +0000 (21:28 +0200)]
Upgrade ncurses. 2/2

- update README.{DELETED,DRAGONFLY}
- adapt Makefiles
- regenerate header files
- import new generated include/comp_userdefs.c
- adjust Symbol.map

3 years agoUpgrade ncurses. 1/2
Daniel Fojt [Thu, 13 Aug 2020 16:27:16 +0000 (18:27 +0200)]
Upgrade ncurses. 1/2

Merge branch 'vendor/NCURSES' into master.

3 years agovendor/ncurses: upgrade from 6.0-20160305 to 6.2-20200212 vendor/NCURSES
Daniel Fojt [Wed, 12 Aug 2020 07:35:19 +0000 (09:35 +0200)]
vendor/ncurses: upgrade from 6.0-20160305 to 6.2-20200212

The TERMINAL structure in <term.h> is now opaque. Doing that allowed
making the structure larger, to hold the extended numeric data.
When configured for wide-characters (i.e. ncursesw), the TERMINAL
structure is extended and is named TERMTYPE2. When configured for
8-bit (narrow) characters, the TERMTYPE2 structure is not used.

For detailed description of all other changes, enhancements, bugfixes
and performance improvements, see:

https://invisible-island.net/ncurses/announce-6.1.html
https://invisible-island.net/ncurses/announce-6.2.html

3 years agoopenpam: Add back includes removed in 7196b98de8a8d.
Sascha Wildner [Tue, 18 Aug 2020 21:13:52 +0000 (23:13 +0200)]
openpam: Add back includes removed in 7196b98de8a8d.

I should have just added <security/openpam.h>.

3 years agoyacc(1): Add config.h and use it.
Sascha Wildner [Tue, 18 Aug 2020 19:07:17 +0000 (21:07 +0200)]
yacc(1): Add config.h and use it.

3 years ago__realpath.2: Fix typo.
Sascha Wildner [Tue, 18 Aug 2020 18:28:00 +0000 (20:28 +0200)]
__realpath.2: Fix typo.

3 years agokdump(8): fix indentation in mkioctls
Daniel Fojt [Tue, 18 Aug 2020 17:15:38 +0000 (19:15 +0200)]
kdump(8): fix indentation in mkioctls

3 years agosys/vfs/ext2fs: Don't do endian conversion twice
Tomohiro Kusumi [Tue, 18 Aug 2020 15:54:40 +0000 (00:54 +0900)]
sys/vfs/ext2fs: Don't do endian conversion twice

Doesn't affect anything on DragonFly.

from freebsd/freebsd@86fbc13431233b277bc8739539a18019ae53e88f

3 years agopthread - Respect RLIMIT_STACK for main thread's stack size
Michael Neumann [Mon, 17 Aug 2020 21:19:51 +0000 (23:19 +0200)]
pthread - Respect RLIMIT_STACK for main thread's stack size

Prior to this commit, the stack size of the main thread was fixed
at 4 MB which was too low for certain applications.

This commit fixes bootstrapping the lang/crystal compiler (see [1]).

Reviewed-by: dillon
Fixes-issue: #3234

[1]: https://github.com/crystal-lang/crystal/pull/9178

3 years agoFix the synopses of some libarchive and openpam manual pages.
Sascha Wildner [Mon, 17 Aug 2020 16:33:09 +0000 (18:33 +0200)]
Fix the synopses of some libarchive and openpam manual pages.

3 years ago<sys/elf_common.h>: Add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits.
Sascha Wildner [Sat, 15 Aug 2020 15:06:15 +0000 (17:06 +0200)]
<sys/elf_common.h>: Add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits.

Apparently some ports need those.

Reported-by: zrj
Taken-from:  FreeBSD (r348628)

3 years agobyacc: Add our local READMEs on master.
Sascha Wildner [Sat, 15 Aug 2020 06:22:03 +0000 (08:22 +0200)]
byacc: Add our local READMEs on master.

3 years agoMerge branch 'vendor/BYACC'
Sascha Wildner [Sat, 15 Aug 2020 06:21:09 +0000 (08:21 +0200)]
Merge branch 'vendor/BYACC'

3 years agovendor/BYACC: Remove our local READMEs from the vendor branch.
Sascha Wildner [Sat, 15 Aug 2020 06:20:45 +0000 (08:20 +0200)]
vendor/BYACC: Remove our local READMEs from the vendor branch.

3 years agolocaledef(1): Set yydebug only when YYDEBUG is set.
Sascha Wildner [Sat, 15 Aug 2020 06:10:52 +0000 (08:10 +0200)]
localedef(1): Set yydebug only when YYDEBUG is set.

3 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sat, 15 Aug 2020 05:50:07 +0000 (07:50 +0200)]
Update the pciconf(8) database.

August 13, 2020 snapshot from https://pci-ids.ucw.cz

3 years ago<sys/random.h>: Add missing __{BEGIN,END}_DECLS.
Sascha Wildner [Sat, 15 Aug 2020 05:48:09 +0000 (07:48 +0200)]
<sys/random.h>: Add missing __{BEGIN,END}_DECLS.

Reported-by: zrj
3 years agousr.sbin/fstyp: Fix incorrect pfs_type test in ondisk inode
Tomohiro Kusumi [Thu, 13 Aug 2020 19:10:04 +0000 (04:10 +0900)]
usr.sbin/fstyp: Fix incorrect pfs_type test in ondisk inode

Fix the same bug fixed in c2795ad60fbf0e88fa2f1c2dc29905d9c4f1bf92.

3 years agoEnable -fno-common for world, too.
Sascha Wildner [Thu, 13 Aug 2020 18:14:00 +0000 (20:14 +0200)]
Enable -fno-common for world, too.

3 years agoStop mixing the userland specific <bsd.sys.mk> into the module build.
Sascha Wildner [Thu, 13 Aug 2020 18:13:47 +0000 (20:13 +0200)]
Stop mixing the userland specific <bsd.sys.mk> into the module build.

I don't know why it was there initially because we inherited it this way.

The only changes on the compile line are eliminating a -std=gcc99
(our userland -std setting) which was overridden by the kernel's
own -std=c99 anyway, and a second copy of our kernel warning flags.
By extension, it also makes the build log shorter by some percent.

3 years agodma - Update documentation
Matthew Dillon [Thu, 13 Aug 2020 05:25:17 +0000 (22:25 -0700)]
dma - Update documentation

* Add some important missing information to the manual page.

Submitted-by: Doug Hardie
3 years agoifconfig(8): Fix typo.
Sascha Wildner [Thu, 13 Aug 2020 01:39:00 +0000 (03:39 +0200)]
ifconfig(8): Fix typo.

Spotted-by: zrj
3 years agokernel - Fix multiple issues with if_tap and if_tun cloning (2)
Matthew Dillon [Wed, 12 Aug 2020 22:37:07 +0000 (15:37 -0700)]
kernel - Fix multiple issues with if_tap and if_tun cloning (2)

* For tap and tun, detect whether created by ifconfig or
  open("/dev/tap"...) etc and set MANUALMAKE flag appropriately.

* When closing a tap or tun interface and MANUALMAKE is not set,
  destroy the device, softc, and interface via if_clone_destroy().
  This fixes another issue where the various bitmaps could get out
  of sync.

3 years agokernel - Fix multiple issues with if_tap and if_tun cloning
Matthew Dillon [Wed, 12 Aug 2020 20:47:43 +0000 (13:47 -0700)]
kernel - Fix multiple issues with if_tap and if_tun cloning

* tap and tun were being auto-destroyed when manually created via
  ifconfig blah create, and not being auto-destroyed when auto-created
  via open /dev/tap or open /dev/tun.  Reverse the flag so it works
  properly.

* The bitmap for the ifconfig based cloner and the bitmap maintained
  internally by if_tap and if_tun could get out of sync with each
  other due to if_clone_free_unit(ifp, ...) being issued after
  the ifc_destroy() (the ifp is garbage at that point).

* Remove a KASSERT() that can be triggered trivially from usermode
  (as root) in the interface cloning path.

Reported-by: zrj
3 years agosbin/hammer2: Fix -Wsometimes-uninitialized from 18f4f120fa
Tomohiro Kusumi [Wed, 12 Aug 2020 17:16:01 +0000 (02:16 +0900)]
sbin/hammer2: Fix -Wsometimes-uninitialized from 18f4f120fa

3 years agosys/vfs/hammer2: Remove misleading comment in readdir vop
Tomohiro Kusumi [Wed, 12 Aug 2020 15:51:28 +0000 (00:51 +0900)]
sys/vfs/hammer2: Remove misleading comment in readdir vop

since around c847e8387ad749d611d395742d337213aefef3b9 in 2015.

3 years agosbin/hammer2: Print iparent in "printinode" in hexadecimal
Tomohiro Kusumi [Wed, 12 Aug 2020 15:15:11 +0000 (00:15 +0900)]
sbin/hammer2: Print iparent in "printinode" in hexadecimal

3 years agokdump(8): Gather more ioctl names to resolve.
Sascha Wildner [Wed, 12 Aug 2020 14:45:56 +0000 (16:45 +0200)]
kdump(8): Gather more ioctl names to resolve.

3 years agosbin/hammer2: ec -> ecode for consistency
Tomohiro Kusumi [Tue, 11 Aug 2020 22:45:52 +0000 (07:45 +0900)]
sbin/hammer2: ec -> ecode for consistency

3 years agosbin/hammer2: Don't return 0 if "destroy*" failed
Tomohiro Kusumi [Tue, 11 Aug 2020 18:04:02 +0000 (03:04 +0900)]
sbin/hammer2: Don't return 0 if "destroy*" failed

3 years ago<sys/msgport.h>: For boolean_t, it is enough to include <sys/stdint.h>.
Sascha Wildner [Tue, 11 Aug 2020 22:14:47 +0000 (00:14 +0200)]
<sys/msgport.h>: For boolean_t, it is enough to include <sys/stdint.h>.

It was moved there from <sys/types.h> in 6b2b0a8b5c1c774a5c3cbb4c79bdc150.

3 years agokernel/iscsi: Remove iscsi's local definition of boolean_t.
Sascha Wildner [Tue, 11 Aug 2020 21:30:51 +0000 (23:30 +0200)]
kernel/iscsi: Remove iscsi's local definition of boolean_t.

It was locally defining boolean_t as int (4 bytes) for userland, but
boolean_t is _Bool (1 byte) in the kernel since quite some time.

This caused isc_opt_t's size being different in userland vs. kernel,
and ultimately caused the ioctl number of ISCSISETOPT, which includes
sizeof(isc_opt_t), to be different in userland vs. the kernel,
resulting in at first inexplicable ENOIOCTL issues when using
iscontrol(8).

Change all 'boolean_t' usage to 'bool' which is available for both
userland and kernel, defined as _Bool.

Thanks-to: Georg "megaT" Bege <georg@bege.email> for spotting the ioctl
           number difference & testing

3 years agosbin/hammer2: Cleanup "info"
Tomohiro Kusumi [Tue, 11 Aug 2020 16:12:14 +0000 (01:12 +0900)]
sbin/hammer2: Cleanup "info"

Only volume, inode, indirect blockref (out of 9 types) needed for this.

3 years agosbin/fsck_hammer2: Fix incorrect pfs_type test in ondisk inode
Tomohiro Kusumi [Tue, 11 Aug 2020 15:47:08 +0000 (00:47 +0900)]
sbin/fsck_hammer2: Fix incorrect pfs_type test in ondisk inode

"ipdata.meta.pfs_type & HAMMER2_PFSTYPE_SUPROOT" happened to have
the same result (except HAMMER2_PFSTYPE_DUMMY could also match).

3 years agoetc/Makefile: add a notice to "check-deprecated-files"
Daniel Fojt [Tue, 11 Aug 2020 08:53:20 +0000 (10:53 +0200)]
etc/Makefile: add a notice to "check-deprecated-files"

When checking dependencies for deprecated system libraries, kernel may
complain on "foreign" (non-DragonFly) ELF binaries, like:

"ELF interpreter /lib64/ld-linux-x86-64.so.2 not found"

Unfortunately, these complaints are printed directly to terminal, not
stdout or stderr, and there is no way to redirect it. So just print
a notice in advance, to avoid possible users' confusion.

Pointed out by: Pierre-Alain TORET
Discussed with: Sascha Wildner

3 years agosbin/hammer2: Don't return 0 if "bulkfree" failed
Tomohiro Kusumi [Mon, 10 Aug 2020 17:11:19 +0000 (02:11 +0900)]
sbin/hammer2: Don't return 0 if "bulkfree" failed

3 years agosbin/hammer2: Make "dumpchain" print strerror if not HAMMER2 inode
Tomohiro Kusumi [Mon, 10 Aug 2020 17:08:36 +0000 (02:08 +0900)]
sbin/hammer2: Make "dumpchain" print strerror if not HAMMER2 inode

3 years agosbin/hammer2: Minor cleanups
Tomohiro Kusumi [Mon, 10 Aug 2020 16:25:09 +0000 (01:25 +0900)]
sbin/hammer2: Minor cleanups

3 years agoUpgrade dialog(1). 2/2
Daniel Fojt [Sun, 9 Aug 2020 14:13:29 +0000 (16:13 +0200)]
Upgrade dialog(1). 2/2

- update README.{DELETED,DRAGONFLY}
- adapt libdialog/Makefile
- regenerate dlg_config.h

3 years agoUpgrade dialog(1). 1/2
Daniel Fojt [Mon, 10 Aug 2020 15:51:21 +0000 (17:51 +0200)]
Upgrade dialog(1). 1/2

Merge branch 'vendor/DIALOG' into master.

3 years agovendor/dialog: upgrade from 1.2-20150920 to 1.3-20200327
Daniel Fojt [Wed, 5 Aug 2020 06:08:20 +0000 (08:08 +0200)]
vendor/dialog: upgrade from 1.2-20150920 to 1.3-20200327

Summary of notable changes:

- add "--week-start" option for calendar widget
- modify editbox widget to add a trailing newline if the text has none
  to ensure the last line is not ignored
- use Gregorian algorithm for leap year
- fix a regression from 2015/05/13 changes for escaping; it is necessary
  to retain backslashes within quotes to make "\Z" escapes work
- change explicit checks for space character used for select or toggle
  to make this rebindable to "TOGGLE"
- improve performance with very long command-lines
- interpret $DIALOGOPTS before expanding "--file", etc., to allow
  the environment variable to turn on tracing in that process
- improve handling of SIGWINCH for several widgets
- add options --print-text-only, and --print-text-size for scripts that
  adjust the widget size according to how the captions are formatted
- when trimming blanks, treat unconverted tabs the same as spaces
- allow for underline- and reverse-video flags in the ".rc" file

For detailed list of all changes, bugfixes and improvements, see CHANGES.

3 years agoboot/efi: Fix boot1's compilation with -fno-common.
Sascha Wildner [Mon, 10 Aug 2020 14:19:43 +0000 (16:19 +0200)]
boot/efi: Fix boot1's compilation with -fno-common.

boot1 needs no local definitions of BS, IH, RS and ST because they are
defined in libefi that boot1 links to.

3 years agosbin/hammer2: Use calloc(3)
Tomohiro Kusumi [Mon, 10 Aug 2020 12:05:43 +0000 (21:05 +0900)]
sbin/hammer2: Use calloc(3)

3 years agosbin/hammer2: Use nitems()
Tomohiro Kusumi [Mon, 10 Aug 2020 10:15:09 +0000 (19:15 +0900)]
sbin/hammer2: Use nitems()

3 years agosbin/hammer2: Fix no extern declaration errors
Tomohiro Kusumi [Sun, 9 Aug 2020 15:45:09 +0000 (00:45 +0900)]
sbin/hammer2: Fix no extern declaration errors

3 years agoFix GETATTR_LITE() build breakage with 'pseudo-device gzip' in the config.
Sascha Wildner [Sun, 9 Aug 2020 13:48:43 +0000 (15:48 +0200)]
Fix GETATTR_LITE() build breakage with 'pseudo-device gzip' in the config.

3 years agoboot/efi: Switch from HandleProtocol() to OpenProtocol().
Sascha Wildner [Sun, 9 Aug 2020 10:06:53 +0000 (12:06 +0200)]
boot/efi: Switch from HandleProtocol() to OpenProtocol().

HandleProtocol() is deprecated.

Bring in and use FreeBSD's OpenProtocolByHandle() helper function (which
is like the UEFI Spec's example) and generally reduce differences with
FreeBSD a bit more.

Taken-from: FreeBSD

3 years agoboot/efi: Move the loader's efi_main() from libefi to the loader itself.
Sascha Wildner [Sun, 9 Aug 2020 08:48:06 +0000 (10:48 +0200)]
boot/efi: Move the loader's efi_main() from libefi to the loader itself.

It will allow boot1 (that has its own efi_main()) to use libefi.

While here, reduce differences with FreeBSD a bit more.

Taken-from: FreeBSD

3 years agoboot/efi: Make DevicePathNodeLength()'s result a size_t.
Sascha Wildner [Sun, 9 Aug 2020 07:49:25 +0000 (09:49 +0200)]
boot/efi: Make DevicePathNodeLength()'s result a size_t.

Taken-from: FreeBSD

3 years agosbin/fsck_hammer2: Add HAMMER2_USE_OPENSSL
Tomohiro Kusumi [Sat, 8 Aug 2020 19:59:59 +0000 (04:59 +0900)]
sbin/fsck_hammer2: Add HAMMER2_USE_OPENSSL

3 years ago<sys/sysid.h>: Include <sys/types.h> for self-sufficiency.
Sascha Wildner [Sat, 8 Aug 2020 20:07:59 +0000 (22:07 +0200)]
<sys/sysid.h>: Include <sys/types.h> for self-sufficiency.

3 years agosbin/fsck_hammer2: Use RB_GENERATE() for better userspace portability
Tomohiro Kusumi [Sat, 8 Aug 2020 18:43:39 +0000 (03:43 +0900)]
sbin/fsck_hammer2: Use RB_GENERATE() for better userspace portability

3 years agokernel - Refactor GETATTR_QUICK() -> GETATTR_LITE()
Matthew Dillon [Sat, 8 Aug 2020 04:39:28 +0000 (21:39 -0700)]
kernel - Refactor GETATTR_QUICK() -> GETATTR_LITE()

* Refactor GETATTR_QUICK() into GETATTR_LITE() and use struct
  vattr_lite instead of struct vattr.  The original GETATTR_QUICK()
  just used a struct vattr.

  This change ensures that users of this new VOP do not attempt to
  access attr fields that are not populated.

Suggested-by: mjg
3 years agousb.4: Add urndis(4) reference in SEE ALSO.
Sascha Wildner [Sat, 8 Aug 2020 10:48:58 +0000 (12:48 +0200)]
usb.4: Add urndis(4) reference in SEE ALSO.

3 years agokernel: Remove <machine/npx.h> from two headers that do not need it.
Sascha Wildner [Sat, 8 Aug 2020 07:46:57 +0000 (09:46 +0200)]
kernel: Remove <machine/npx.h> from two headers that do not need it.

3 years agoRemove unneded #includes in three header files.
Sascha Wildner [Sat, 8 Aug 2020 07:26:39 +0000 (09:26 +0200)]
Remove unneded #includes in three header files.

Namely, <sys/ckpt.h>, <sys/posix4.h> and <sys/sfbuf.h>. None of them
needed anything from the headers they were including.

3 years ago<machine/tss.h>: Oops, it should have been <sys/types.h>.
Sascha Wildner [Fri, 7 Aug 2020 18:38:44 +0000 (20:38 +0200)]
<machine/tss.h>: Oops, it should have been <sys/types.h>.

We want integer types too.

3 years agodrm: Add linux/irqhandler.h
François Tigeot [Fri, 7 Aug 2020 16:42:14 +0000 (18:42 +0200)]
drm: Add linux/irqhandler.h

3 years ago<machine/tss.h>: Include <sys/cdefs.h> for __packed.
Sascha Wildner [Fri, 7 Aug 2020 06:24:51 +0000 (08:24 +0200)]
<machine/tss.h>: Include <sys/cdefs.h> for __packed.

3 years ago<machine/segments.h>: Move the inclusion of <sys/tls.h> to the top.
Sascha Wildner [Fri, 7 Aug 2020 06:17:57 +0000 (08:17 +0200)]
<machine/segments.h>: Move the inclusion of <sys/tls.h> to the top.

Mainly to get at <sys/types.h> for u_int* and <sys/cdefs.h> for __packed.