dragonfly.git
2 years agoFix AUTHORS sections without .An in various manual pages.
Sascha Wildner [Tue, 15 Feb 2022 20:27:51 +0000 (21:27 +0100)]
Fix AUTHORS sections without .An in various manual pages.

2 years agosys/vfs/hammer2: Whitespace fixes
Tomohiro Kusumi [Tue, 15 Feb 2022 15:32:33 +0000 (00:32 +0900)]
sys/vfs/hammer2: Whitespace fixes

Also fix hammer2_unmount_helper() comment "Mount helper" -> "Unmount helper".

2 years agoRemove unneeded .Ns macros in various manual pages.
Sascha Wildner [Mon, 14 Feb 2022 20:58:14 +0000 (21:58 +0100)]
Remove unneeded .Ns macros in various manual pages.

2 years agopthread_{attr_,}setaffinity_np.3: Fix section number in .Dt
Sascha Wildner [Mon, 14 Feb 2022 19:20:56 +0000 (20:20 +0100)]
pthread_{attr_,}setaffinity_np.3: Fix section number in .Dt

2 years agosh.1: Remove unneeded .Pp
Sascha Wildner [Mon, 14 Feb 2022 19:20:05 +0000 (20:20 +0100)]
sh.1: Remove unneeded .Pp

2 years agoFix "macro neither callable nor escaped" mandoc warnings in the manpages.
Sascha Wildner [Mon, 14 Feb 2022 19:07:18 +0000 (20:07 +0100)]
Fix "macro neither callable nor escaped" mandoc warnings in the manpages.

Some of these were affecting the output.

2 years ago<sys/queue.h>: Add _FOREACH_FROM and _FOREACH_FROM_MUTABLE macros.
Sascha Wildner [Wed, 9 Feb 2022 21:36:27 +0000 (22:36 +0100)]
<sys/queue.h>: Add _FOREACH_FROM and _FOREACH_FROM_MUTABLE macros.

Useful for dports.

Taken-from:  FreeBSD
Reported-by: zrj
2 years agosys.mk: Use an absolute path for sysctl(8).
Sascha Wildner [Wed, 9 Feb 2022 21:35:45 +0000 (22:35 +0100)]
sys.mk: Use an absolute path for sysctl(8).

At least graphics/rayshade uses it in an environment where /sbin is
not in the $PATH.

Reported-by: zrj
2 years agosys/vfs/ext2fs: Improve extents verification logic (partial)
Tomohiro Kusumi [Wed, 9 Feb 2022 15:45:06 +0000 (00:45 +0900)]
sys/vfs/ext2fs: Improve extents verification logic (partial)

Sync with ext2fs/ext2_inode_cnv.c part of diff.
Other diff hunks are for ext4 extents which isn't supported yet.

taken from FreeBSD f1d5e2c862ef599efd1705b04d505d5415b77f82

2 years ago<machine/endian.h>: Provide __FLOAT_WORD_ORDER too
zrj [Wed, 9 Feb 2022 04:52:22 +0000 (04:52 +0000)]
<machine/endian.h>: Provide __FLOAT_WORD_ORDER too

 Allows some ports to make use of internal representations.

2 years agosys/vfs/ext2fs: Add more accurate check for root inode
Tomohiro Kusumi [Tue, 8 Feb 2022 15:46:33 +0000 (00:46 +0900)]
sys/vfs/ext2fs: Add more accurate check for root inode

Check that root inode has links and is directory.

taken from FreeBSD ced21728223016429242d1f7cd5e8a160c8a88cb

2 years agosys/vfs/ext2fs: Add more accurate directory entries check
Tomohiro Kusumi [Tue, 8 Feb 2022 15:20:08 +0000 (00:20 +0900)]
sys/vfs/ext2fs: Add more accurate directory entries check

Rename ext2_dirbadentry() to ext2_check_direntry(). Add directory
entry inode value check, and call ext2_check_direntry() in all cases.
The dirchk sysctl is removed.

taken from FreeBSD bb9f1ba4b55c1f566d59cc7c7d1d28dd37715984

2 years agosys/vfs/ext2fs: Remove unnecessary e2fs_first_dblock value check
Tomohiro Kusumi [Tue, 8 Feb 2022 15:32:14 +0000 (00:32 +0900)]
sys/vfs/ext2fs: Remove unnecessary e2fs_first_dblock value check

taken from FreeBSD 5034b44574c44d50bcb5fadec1d6aae152855bc0

2 years agosys/vfs/ext2fs: Fix a few common typos in source code comments
Tomohiro Kusumi [Mon, 7 Feb 2022 16:01:22 +0000 (01:01 +0900)]
sys/vfs/ext2fs: Fix a few common typos in source code comments

- s/quadradically/quadratically/

taken-from FreeBSD 8ea3ceda7644b7b93532d0c31b50ac5fa61e51a3

2 years agousr.sbin/makefs: Fix a few typos in source code comments
Tomohiro Kusumi [Mon, 7 Feb 2022 15:36:15 +0000 (00:36 +0900)]
usr.sbin/makefs: Fix a few typos in source code comments

- s/concearned/concerned/
- s/quadradically/quadratically/

taken-from FreeBSD 164fa411b9244ce3f4ae0d6f17a7f64f6b9ee941

2 years agosys/vfs/msdosfs: Plug the rest of undef behavior places
Tomohiro Kusumi [Fri, 4 Feb 2022 16:12:08 +0000 (01:12 +0900)]
sys/vfs/msdosfs: Plug the rest of undef behavior places

There are three more places in msdosfs_fat.c which might shift one
into the sign bit.  While there, fix formatting of KASSERTs.

taken-from FreeBSD 53fcc6c96090f03c35d5e3dd4c6d0e6652c4404c

2 years agosys/vfs/msdosfs: denode some style
Tomohiro Kusumi [Thu, 3 Feb 2022 15:34:16 +0000 (00:34 +0900)]
sys/vfs/msdosfs: denode some style

taken-from FreeBSD d51b0786a2f60c3d188cae812cc0a3e0ab1a9893

2 years agosys/vfs/msdosfs: Sanity check sector count from BPB
Tomohiro Kusumi [Wed, 2 Feb 2022 15:59:42 +0000 (00:59 +0900)]
sys/vfs/msdosfs: Sanity check sector count from BPB

taken-from FreeBSD ba2c98389b78b548aedac0be53121df909c3fe2f

2 years agosys/vfs/msdosfs: Do no allow lookup to return vdp except for dot lookups
Tomohiro Kusumi [Wed, 2 Feb 2022 15:10:09 +0000 (00:10 +0900)]
sys/vfs/msdosfs: Do no allow lookup to return vdp except for dot lookups

taken-from FreeBSD aec97963cd03f10e04083537ed449a84a5e42f87

2 years agosys/vfs/msdosfs: Handle a case when non-dot lookup returned dvp
Tomohiro Kusumi [Tue, 1 Feb 2022 16:49:57 +0000 (01:49 +0900)]
sys/vfs/msdosfs: Handle a case when non-dot lookup returned dvp

This means that filesystem is corrupted, there is a loop.

taken-from FreeBSD 1319c433f4e5d67f8ea6fd2369c604069f733c94

2 years agosys/vfs/msdosfs: Take inusemap inconsistency as an error, not invariants violation
Tomohiro Kusumi [Tue, 1 Feb 2022 16:23:17 +0000 (01:23 +0900)]
sys/vfs/msdosfs: Take inusemap inconsistency as an error, not invariants violation

In other words, stop silently accepting freeing free cluster in
non-debug kernels, but return the error to the caller.  Modify callers
to handle errors from usemap_free().

taken-from FreeBSD 2c9a1c22c323b069d1f4883170349545c94b7b8d

2 years agosys/vfs/msdosfs: mountmsdosfs() some style
Tomohiro Kusumi [Mon, 31 Jan 2022 15:23:08 +0000 (00:23 +0900)]
sys/vfs/msdosfs: mountmsdosfs() some style

taken-from FreeBSD 04fd468da0d0baea535da418b92df74101a9659d

2 years agokernel - Fix namecache issue that can slow systems down over time
Matthew Dillon [Sun, 30 Jan 2022 18:42:11 +0000 (10:42 -0800)]
kernel - Fix namecache issue that can slow systems down over time

* Fix a serious dead-record issue with the namecache.

  It is very common to create a blah.new file and then rename it over
  an existing file, say, blah.jpg, in order to atomically replace the
  existing file.  Such rename-over operations can cause up to
  (2 * maxvnodes) dead dead namecache records to build up on a
  single hash slot's list.

* Over time, this could result in over a million records on a single
  hash slot's list which is often scanned during namecache lookups,
  causing the kernel to turn into a sludge-pile.

  This was not a memory leak per-say, the kernel still cleans excess
  structures (above 2 * maxvnodes) up, but that just maintains the
  status-quo and leaves the system in a slow, poorly-responsive state.

* Fixed by proactively deleting matching dead entries during namecache
  lookups.  The 'live' record is typically at the beginning of the list.
  So to fix, the namecache lookup now scans the list for the hash slot
  backwards and attempts to dispose of dead records.

2 years agousr.sbin/makefs: Remove set but not used variables
Tomohiro Kusumi [Sun, 30 Jan 2022 15:07:01 +0000 (00:07 +0900)]
usr.sbin/makefs: Remove set but not used variables

These were leftovers from the port from NetBSD (where they are used).

taken-from FreeBSD 093cf790569775b80662926efea6d9d3464bde94

2 years agomsdosfs: clusterfree() is used only in error handling cases
Tomohiro Kusumi [Sun, 30 Jan 2022 14:30:07 +0000 (23:30 +0900)]
msdosfs: clusterfree() is used only in error handling cases

Change its return type to void, because its result is ignored in both
call sites.  Remove oldcnp argument as well, it is NULL always.

taken-from FreeBSD 65990b68a2cd89a08f0350e187df1968b16f4255

2 years agolibc: Add strerror_l() (taken from FreeBSD).
Sascha Wildner [Sun, 30 Jan 2022 01:18:39 +0000 (02:18 +0100)]
libc: Add strerror_l() (taken from FreeBSD).

Reported-by: zrj
2 years ago<sys/param.h>: Add missing whitespace.
Sascha Wildner [Sun, 30 Jan 2022 00:36:28 +0000 (01:36 +0100)]
<sys/param.h>: Add missing whitespace.

2 years agolibc: Fix building without YP.
Sascha Wildner [Sat, 29 Jan 2022 23:26:52 +0000 (00:26 +0100)]
libc: Fix building without YP.

2 years agolibc: Remove libc checks around manual pages from the Makefile.inc's.
Sascha Wildner [Sat, 29 Jan 2022 23:15:08 +0000 (00:15 +0100)]
libc: Remove libc checks around manual pages from the Makefile.inc's.

Handle this better by setting NOMAN for libc_rtld.

2 years agosys/vfs/hammer2: Add hammer2_ prefixed spin_[un]lock_update()
Tomohiro Kusumi [Thu, 27 Jan 2022 16:03:32 +0000 (01:03 +0900)]
sys/vfs/hammer2: Add hammer2_ prefixed spin_[un]lock_update()

like any other spin lock variants.

2 years agosys/vfs/hammer2: Use hammer2_ prefixed spin_init() for portability
Tomohiro Kusumi [Thu, 27 Jan 2022 16:02:36 +0000 (01:02 +0900)]
sys/vfs/hammer2: Use hammer2_ prefixed spin_init() for portability

2 years ago<sys/elf_common.h>: Use standard types, like the rest of the elf headers.
Sascha Wildner [Wed, 26 Jan 2022 10:48:17 +0000 (11:48 +0100)]
<sys/elf_common.h>: Use standard types, like the rest of the elf headers.

2 years agokernel - Fix sysv semaphore panic
Matthew Dillon [Tue, 25 Jan 2022 22:33:55 +0000 (14:33 -0800)]
kernel - Fix sysv semaphore panic

* Fix an exit race related to lingering sysv semaphores which can sometimes
  cause a kernel panic.

Reported-by: zrj
2 years agosys/vfs/hammer2: Add missing hammer2_spin_init() for chain core
Tomohiro Kusumi [Mon, 24 Jan 2022 16:10:10 +0000 (01:10 +0900)]
sys/vfs/hammer2: Add missing hammer2_spin_init() for chain core

This happened to be harmless, as all it does is zero initialize
some fields that are already zero.
Other spinlocks are explicitly initialized.

2 years agosys/vfs/hammer2: Remove wrong comments in hammer2_chain_core_init()
Tomohiro Kusumi [Sun, 23 Jan 2022 17:00:18 +0000 (02:00 +0900)]
sys/vfs/hammer2: Remove wrong comments in hammer2_chain_core_init()

No such arguments *trans, *nchain, *ochain since
da6f36f44bb9c76612e31b56cdfe4d787e53d61f in 2014 and
23c7c7dd4e59da5bdb6ffa7fe2074c5b7ffe5e4f in 2015.

2 years agokernel - Fix ktrace's handling of system call return values
Matthew Dillon [Mon, 24 Jan 2022 06:02:56 +0000 (22:02 -0800)]
kernel - Fix ktrace's handling of system call return values

* Distinguish between int and long returns, properly recording
  long returns (e.g. lseek(), mmap(), read(), write(), etc).
  kdump will then display the correct return value instead of a truncated
  return value for the affected system calls.

* Involves including a return value type width in the sysent and adjusting
  the generator to calculate it.

2 years agolibc - Increase opendir/readdir buffer size
Matthew Dillon [Mon, 24 Jan 2022 06:01:50 +0000 (22:01 -0800)]
libc - Increase opendir/readdir buffer size

* Increase the directory scan buffer size from 4096 bytes to 16384
  bytes, significantly reducing the number of discrete system calls
  which must be made when scanning very large directories.

2 years agotmpfs - Fix readdir() races
Matthew Dillon [Mon, 24 Jan 2022 05:55:44 +0000 (21:55 -0800)]
tmpfs - Fix readdir() races

* Fix multi-threaded deletion races against readdir().  These races
  can cause a directory scan in one thread to return EINVAL if the
  file representing the chaining cookie is deleted by another thread.

  Fix the issue by allowing tmpfs_dir_lookupbycookie() to return the
  nearest directory entry with a cookie >= the requested cookie.

* Use a better cookie value for EOF

* Allow readdir() to fail on "." or "..".  Instead just iterate to
  the next entry.  This can occur when a directory is deleted out
  from under a scan that has chdir()'d into it.

* tmpfs was previously rescanning all entries to locate a cookie,
  which is rather dumb given that we have a RB tree.  Do a proper
  iterative recursive search instead.

Reported-by: zrj, others
2 years agohammer2 - Fix excess chain structure allocations during bulkfree (2)
Matthew Dillon [Fri, 14 Jan 2022 20:55:36 +0000 (12:55 -0800)]
hammer2 - Fix excess chain structure allocations during bulkfree (2)

Try to fix this again.  The last attempt failed.  Basically the
problem is that when the depth-first traversal gets too deep, it
has to defer the node at that point by adding it to a list.

* Change the order to insert deferrals on the head instead of the
  tail in order to exhaust the most recently deferred sub-tree as
  quickly as possible (LIFO order).  We previously exhausted deferred
  sub-trees in FIFO order but this often resulted in multiple levels
  of the radix tree building up on the list, which could blow-up
  memory use.

* Once the list limit is reached (well, really 1/4 of the list limit),
  we previously continued to accumulate deferral as long as the
  relative depth was less then 3.  Unfortunately, the maximum radix
  tree table size of roughly 512 elements could cause the number
  of deferrals even after the limit was reached to be up to
  134 million chains (512 * 512 * 512).

  This is fixed by removing any depth test when the list limit is
  exhausted.

* This combination of fixes should prevent the number of deferrals
  from blowing out hammer2's kmalloc pool.  Theoretically the
  worst-case possible deferrals should now be 512 chains x max depth
  of radix tree.  A very reasonable number.

2 years agosysctl.3: Adjust for pageout daemon algo changes from last year.
Sascha Wildner [Thu, 20 Jan 2022 21:43:54 +0000 (22:43 +0100)]
sysctl.3: Adjust for pageout daemon algo changes from last year.

Taken-from: dillon's commit message

2 years agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 19 Jan 2022 15:13:12 +0000 (16:13 +0100)]
Update the pciconf(8) database.

January 13, 2022 snapshot from https://pci-ids.ucw.cz

2 years agovnconfig.8: Mention comment lines in the configuration file.
Sascha Wildner [Wed, 19 Jan 2022 05:51:20 +0000 (06:51 +0100)]
vnconfig.8: Mention comment lines in the configuration file.

2 years agobuild - Update pkg-static to version 04
Antonio Huete Jimenez [Mon, 17 Jan 2022 22:09:55 +0000 (23:09 +0100)]
build - Update pkg-static to version 04

  - Should fix a problem with the metadata versioning.

    pkg-static: repository meta has wrong version 2
    pkg-static: Repository Avalon load error: meta cannot be loaded
    Undefined error: 0

2 years agoAdd the auto-bound IPv6 address to the wildcard hash
YONETANI Tomokazu [Fri, 5 Nov 2021 00:37:39 +0000 (09:37 +0900)]
Add the auto-bound IPv6 address to the wildcard hash

Dragonfly-bug: https://bugs.dragonflybsd.org/issues/3294

2 years agohammer2 - Fix excess chain structure allocations during bulkfree
Matthew Dillon [Sat, 8 Jan 2022 00:41:35 +0000 (16:41 -0800)]
hammer2 - Fix excess chain structure allocations during bulkfree

* On H2 filesystems with a very large number of inodes, such as
  those used for backups or which contain many snapshots (e.g.
  tens of millions of inodes), the bulkfree process may attempt
  to track more hammer2_chain structures than the kmalloc subsystem
  allows.

* This issue might also have contributed to reported lockups during
  bulkfree (if the bulkfree wound up eating too much non-pagable kernel
  memory), though the more typical outcome is a kernel panic when
  the kmalloc limit is exceeded for the pool.

* During bulkfree, H2 must control recursion depth during the scan.
  It does this by deferring deep nodes in the topology by recording
  a pointer to a referenced hammer2_chain structure on a list.
  Once the recursion backs out, H2 then processes these saved chains.
  Topologies greater than 32 nodes deep can wind up being deferred
  more than once to cover the entire depth.

  It is possible for an excessive number of chains to accumulate on the
  deferral list during the scan, each structure burning up kernel memory.

* Emplace a limit on the number of chains which can be deferred,
  vfs.hammer2.limit_saved_chains, with a reasonable default.  When
  the limit is reached, the bulkfree simply records a chain higher-up
  in the recursion instead of going deeper, thus limiting the number
  of chains that will be deferred.

  This has the effect is capping memory use during the bulkfree scan.
  The cost is slightly less scan efficiency, but it should mostly be in
  the noise.

2 years agolibc/isc: Stop using self assignment for unused variables.
Sascha Wildner [Thu, 6 Jan 2022 19:48:42 +0000 (20:48 +0100)]
libc/isc: Stop using self assignment for unused variables.

Some checkers complain about this.

Taken-from: FreeBSD

2 years agodsynth - Add config var for Meta_version and make the default 2
Matthew Dillon [Mon, 3 Jan 2022 20:13:18 +0000 (12:13 -0800)]
dsynth - Add config var for Meta_version and make the default 2

* Add the 'Meta_version' configuration variable.

* Make the default 2 (it was previously 1), to remain compatible
  with future pkg versions.

Requested-by: zrj
2 years agostand: Fix a typo in comment
Aaron LI [Mon, 3 Jan 2022 09:21:34 +0000 (17:21 +0800)]
stand: Fix a typo in comment

While there, adjust header inclusion a bit.

2 years agolibc: Fix environment passing in posix_spawnp(3)
zrj [Mon, 3 Jan 2022 06:18:15 +0000 (06:18 +0000)]
libc: Fix environment passing in posix_spawnp(3)

 The execvPe() was always passing the parent process environment to
 children (a long standing bug).

 While there, replace the deprecated index(3) with strchr(3).

Reported-by: falsifian (breakage in hs-git-annex)
2 years ago6.3 version changes. v6.3.0
Justin C. Sherrill [Mon, 3 Jan 2022 03:13:40 +0000 (22:13 -0500)]
6.3 version changes.

2 years agohammer2 - (when used for booting @BOOT) (2)
Matthew Dillon [Mon, 3 Jan 2022 00:51:22 +0000 (16:51 -0800)]
hammer2 - (when used for booting @BOOT) (2)

* Adjust the range to use HAMMER2_DIRHASH_LOMASK

Reported-by: aly
2 years agohammer2 - (when used for booting @BOOT)
Matthew Dillon [Sun, 2 Jan 2022 20:21:44 +0000 (12:21 -0800)]
hammer2 - (when used for booting @BOOT)

* Fix the @BOOT lookup to allow the whole hash range for "BOOT".
  This can come up if you delete the BOOT pfs and re-create it.
  hammer2 incremental the name hash collision counter to ensure
  that new PFSs are unique.

Reported-by: aly, mneumann
2 years agoAdd a getentropy(3) manual page.
Sascha Wildner [Fri, 31 Dec 2021 18:29:14 +0000 (19:29 +0100)]
Add a getentropy(3) manual page.

Taken-from: FreeBSD

2 years agoBump copyrights. Happy new year!!
Sascha Wildner [Fri, 31 Dec 2021 17:54:49 +0000 (18:54 +0100)]
Bump copyrights. Happy new year!!

2 years agokernel - Fix if_sn, if_sbsh issue (not in kernel by default)
Matthew Dillon [Fri, 31 Dec 2021 00:43:25 +0000 (16:43 -0800)]
kernel - Fix if_sn, if_sbsh issue (not in kernel by default)

* Fix a security problem with a data field.  Note that these drivers
  are not loaded into the kernel by default.

2 years agokernel - Add SIOCGHWADDR, fix SIOCGIFADDR
Matthew Dillon [Fri, 31 Dec 2021 00:40:59 +0000 (16:40 -0800)]
kernel - Add SIOCGHWADDR, fix SIOCGIFADDR

* Add SIOCGHWADDR, this is more commonly used to obtain the
  ether mac address of an interface these days.

* Fix SIOCGIFADDR which had a security problem with a data field.

2 years agopsm - Do not freeze mouse for 2 seconds upon encountering a single sync error
Michael Neumann [Thu, 30 Dec 2021 23:26:05 +0000 (00:26 +0100)]
psm - Do not freeze mouse for 2 seconds upon encountering a single sync error

The original code would drop all PS/2 packets for the next 2 seconds
upon missing a *single* sync byte. Instead, just discard the byte and in
case we cannot find the sync byte within the next few bytes, fall back
to the old behaviour.

Fixes bug: #3309

2 years agokernel - Add DIOCGMEDIASIZE and DIOCGSECTORSIZE
Matthew Dillon [Thu, 30 Dec 2021 21:15:44 +0000 (13:15 -0800)]
kernel - Add DIOCGMEDIASIZE and DIOCGSECTORSIZE

* Add DIOCGMEDIASIZE and DIOCGSECTORSIZE for 'go' and other dports.
  At the moment this requires #include <sys/diskslice.h>.

Requested-by: zrj (for dports)
2 years agolibc - Add getentropy()
Matthew Dillon [Thu, 30 Dec 2021 21:13:55 +0000 (13:13 -0800)]
libc - Add getentropy()

* Add getentropy().  This function uses getrandom() internally.

Requested-by: zrj, for dports
2 years agoRemove the old <sys/dir.h> compat header. Nothing needs it anymore.
Sascha Wildner [Thu, 30 Dec 2021 14:38:51 +0000 (15:38 +0100)]
Remove the old <sys/dir.h> compat header. Nothing needs it anymore.

The world has since switched over to <dirent.h>. Thanks to zrj for
confirming that with a full dports bulk build.

The libssh and RPC examples adjustments are just cosmetics. libssh
includes it only on NeXTSTEP and the RPC examples don't build.

2 years agosys/vfs/hammer2: Use HAMMER2_METH_DEFAULT
Tomohiro Kusumi [Tue, 28 Dec 2021 16:14:03 +0000 (01:14 +0900)]
sys/vfs/hammer2: Use HAMMER2_METH_DEFAULT

hammer2_chain_create() callers use HAMMER2_METH_DEFAULT, not '-1'.

2 years agodrm/i915: Enable WhiskeyLake GPUs
Michael Neumann [Sun, 26 Dec 2021 15:38:25 +0000 (16:38 +0100)]
drm/i915: Enable WhiskeyLake GPUs

* The PCI ids were added in commit a8138aa83 but the ids were never
  added to `pciidlist` so that the i915 driver did not recognize
  WhiskeyLake GPUs.

* Successfully tested with WhiskeyLake-U GT2 [UHD Graphics 620]
  (device=0x3ea0).

* As in Linux 5.8, they use the same configuration as CoffeeLake GPUs.

2 years agoAdd a small ksscanf(9) manual page.
Sascha Wildner [Sat, 25 Dec 2021 22:41:21 +0000 (23:41 +0100)]
Add a small ksscanf(9) manual page.

2 years agokprintf.9: Fix function argument name.
Sascha Wildner [Sat, 25 Dec 2021 22:40:10 +0000 (23:40 +0100)]
kprintf.9: Fix function argument name.

2 years agonvme - Back-off if driver lies about reported queue limits
Matthew Dillon [Sat, 25 Dec 2021 20:30:52 +0000 (12:30 -0800)]
nvme - Back-off if driver lies about reported queue limits

* Apparently some low-rent nvme controllers lie about how many
  queues they support.

* If the nvme driver lies about queue support and a queue
  create command fails, attempt to back-off to fewer queues
  first, rather than giving up immediately.  Complain mightily
  on the console.

2 years agohammer2 - Do not panic on freemap block I/O error
Matthew Dillon [Sat, 25 Dec 2021 06:45:17 +0000 (22:45 -0800)]
hammer2 - Do not panic on freemap block I/O error

* During bulkfree, do not panic if a freemap block has an I/O error.

Reported-by: aly
2 years agoAdd some more printf(1) tests.
Sascha Wildner [Sat, 25 Dec 2021 10:09:32 +0000 (11:09 +0100)]
Add some more printf(1) tests.

Taken-from: FreeBSD

2 years agolibc: Add a clearenv() function.
Sascha Wildner [Thu, 23 Dec 2021 17:33:17 +0000 (18:33 +0100)]
libc: Add a clearenv() function.

Seems useful for dports, as pointed out by zrj.

Taken-from: FreeBSD

2 years agogcc: Define ElfW() if it is not defined.
Sascha Wildner [Sat, 18 Dec 2021 22:41:28 +0000 (23:41 +0100)]
gcc: Define ElfW() if it is not defined.

Better than commenting it out.

Suggested-by: zrj
2 years agoedk2: Sync our TianoCore EDK II headers with the edk2-stable202111 tag.
Sascha Wildner [Sat, 18 Dec 2021 19:16:36 +0000 (20:16 +0100)]
edk2: Sync our TianoCore EDK II headers with the edk2-stable202111 tag.

2 years agoSync ACPICA with Intel's version 20211217.
Sascha Wildner [Fri, 17 Dec 2021 21:23:17 +0000 (22:23 +0100)]
Sync ACPICA with Intel's version 20211217.

* S4/S5 related fixes.

* Fix a buffer overflow.

* Add support for PCC Opregion special context data.

* Various improvements, such as adding support for various tables,
  in iasl(8).

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

2 years agokernel: Remove a.out and gzipped a.out executable support.
Sascha Wildner [Thu, 16 Dec 2021 21:16:00 +0000 (22:16 +0100)]
kernel: Remove a.out and gzipped a.out executable support.

This isn't useful for anything anymore. Likely never was.

Also point out that our current executable format is ELF on the
a.out(5) manual page, which we keep along with <sys/a.out.h> because
ports need it.

2 years agokernel/proc0_init: Do not reuse the a.out sysvec.
Sascha Wildner [Thu, 16 Dec 2021 20:45:07 +0000 (21:45 +0100)]
kernel/proc0_init: Do not reuse the a.out sysvec.

Also use correct types now.

In preparation for removing a.out executable support.

2 years agokernel: Remove an unnecessary include.
Sascha Wildner [Thu, 16 Dec 2021 20:40:36 +0000 (21:40 +0100)]
kernel: Remove an unnecessary include.

2 years agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 15 Dec 2021 15:46:46 +0000 (16:46 +0100)]
Update the pciconf(8) database.

December 10, 2021 snapshot from https://pci-ids.ucw.cz

2 years agogcc8: Fix the fix.
Sascha Wildner [Mon, 13 Dec 2021 20:09:33 +0000 (21:09 +0100)]
gcc8: Fix the fix.

2 years agogccs had ElfW() already. Comment out for now.
Sascha Wildner [Mon, 13 Dec 2021 20:04:04 +0000 (21:04 +0100)]
gccs had ElfW() already. Comment out for now.

2 years ago<sys/elf_generic.h>: Add ElfW() macro, for dports' benefit.
Sascha Wildner [Mon, 13 Dec 2021 19:45:17 +0000 (20:45 +0100)]
<sys/elf_generic.h>: Add ElfW() macro, for dports' benefit.

Taken-from:  FreeBSD
Reported-by: zrj
2 years agokernel - Fix posix_fallocate()
Matthew Dillon [Thu, 9 Dec 2021 18:18:03 +0000 (10:18 -0800)]
kernel - Fix posix_fallocate()

* Our newly minted posix_fallocate() system call was ignoring the
  offset field.

* Should fix samba, however any tdb databases that were created are
  probably corrupt so you may need to rm -rf /var/db/samba4, restart
  samba, and re-create your smb passwords.

Reported-by: Tim Darby
2 years agoRemove a number of duplicate struct declarations in header files.
Sascha Wildner [Wed, 8 Dec 2021 21:12:15 +0000 (22:12 +0100)]
Remove a number of duplicate struct declarations in header files.

2 years agoRemove the ext2fs_freebsd.ko module via 'make upgrade'.
Sascha Wildner [Wed, 8 Dec 2021 15:53:55 +0000 (16:53 +0100)]
Remove the ext2fs_freebsd.ko module via 'make upgrade'.

2 years agokernel/acpi: Improve an error message a bit.
Sascha Wildner [Wed, 8 Dec 2021 15:51:55 +0000 (16:51 +0100)]
kernel/acpi: Improve an error message a bit.

2 years agokernel/acpica: Clean up the module's .PATH a little bit more.
Sascha Wildner [Tue, 7 Dec 2021 22:49:49 +0000 (23:49 +0100)]
kernel/acpica: Clean up the module's .PATH a little bit more.

2 years agokernel/acpica: Remove some unneeded -I and .PATH from the Makefile.
Sascha Wildner [Tue, 7 Dec 2021 20:35:19 +0000 (21:35 +0100)]
kernel/acpica: Remove some unneeded -I and .PATH from the Makefile.

2 years agoBring in FreeBSD's ext2fs(5) manual page.
Sascha Wildner [Tue, 7 Dec 2021 17:52:40 +0000 (18:52 +0100)]
Bring in FreeBSD's ext2fs(5) manual page.

With some modifications as suggested by tkusumi.

2 years agokernel/ext2fs: Add some line breaks in SRCS in the Makefile.
Sascha Wildner [Tue, 7 Dec 2021 16:56:38 +0000 (17:56 +0100)]
kernel/ext2fs: Add some line breaks in SRCS in the Makefile.

2 years agoSome more adjustments regarding the recent switch to sys/vfs/ext2fs.
Sascha Wildner [Tue, 7 Dec 2021 15:35:33 +0000 (16:35 +0100)]
Some more adjustments regarding the recent switch to sys/vfs/ext2fs.

* Remove /usr/include/gnu via 'make upgrade'.

* Remove a no longer needed #undef in kdump and friends' ioctl.c.

2 years agoext2fs: Remove sys/gnu/vfs/ext2fs and make sys/vfs/ext2fs the default
Tomohiro Kusumi [Sun, 5 Dec 2021 16:23:39 +0000 (01:23 +0900)]
ext2fs: Remove sys/gnu/vfs/ext2fs and make sys/vfs/ext2fs the default

This commit removes the old+unstable GPL ext2 implementation,
and makes the new FreeBSD based ext2 implementation
(since cfe603905713d4e92a7956678970d5dff8e913f2) the default.

- Remove sys/gnu/vfs.
- Rename sys/vfs/ext2fs/ext2fs_freebsd.ko -> ext2fs.ko.
- Modify unusual userspace program which includes kernel struct.
- Bump __DragonFly_version to 600107.

2 years agobus_dma.9: Fix typo.
Sascha Wildner [Mon, 6 Dec 2021 20:23:44 +0000 (21:23 +0100)]
bus_dma.9: Fix typo.

2 years agosys/vfs/ext2fs: Check for e2fs_first_dblock in ext2_compute_sb_data()
Tomohiro Kusumi [Sun, 5 Dec 2021 13:00:23 +0000 (22:00 +0900)]
sys/vfs/ext2fs: Check for e2fs_first_dblock in ext2_compute_sb_data()

This prevents a kernel panic on a damaged ext2 superblock.

taken-from FreeBSD 3dd3a395ba975d0fbe13320e6e69fb85b037da5e

2 years agoMakefile.inc1: Fix a typo.
Sascha Wildner [Sun, 5 Dec 2021 07:08:01 +0000 (08:08 +0100)]
Makefile.inc1: Fix a typo.

2 years agocallout.9: Add callout_init_mp() to the SYNOPSIS.
Sascha Wildner [Wed, 1 Dec 2021 19:48:02 +0000 (20:48 +0100)]
callout.9: Add callout_init_mp() to the SYNOPSIS.

2 years agodrm - Hack i915 to workaround startup crash
Matthew Dillon [Tue, 30 Nov 2021 17:45:17 +0000 (09:45 -0800)]
drm - Hack i915 to workaround startup crash

* Work around a startup crash (at least on my i5-6500) caused by
  a ring timeout and request-not-completed.  Replace the BUG_ON
  with a warning and document the hack.

2 years agokernel - Do not block indefinitely in exit1() when draining controlling tty
Matthew Dillon [Mon, 29 Nov 2021 20:46:07 +0000 (12:46 -0800)]
kernel - Do not block indefinitely in exit1() when draining controlling tty

* exit1() tries to drain the controlling terminal.  This can block
  indefinitely and signals are no longer operational.  Force a
  1-second timeout for drain attempts.

  This is a bit of a hack but it works.

Reported-by: zach, pikrzyszt, piecuch, bug #3239
2 years agokernel/drmP.h: Use Linux' __printf() macro.
Sascha Wildner [Mon, 29 Nov 2021 20:41:25 +0000 (21:41 +0100)]
kernel/drmP.h: Use Linux' __printf() macro.

2 years agoacpi.4: Fix typo, ACPI_POWER -> ACPI_POWERRES.
Sascha Wildner [Sat, 27 Nov 2021 23:15:44 +0000 (00:15 +0100)]
acpi.4: Fix typo, ACPI_POWER -> ACPI_POWERRES.

2 years agokernel: Rename BUILDING_WITH_KERNEL to KERNBUILDDIR.
Sascha Wildner [Thu, 25 Nov 2021 22:17:56 +0000 (23:17 +0100)]
kernel: Rename BUILDING_WITH_KERNEL to KERNBUILDDIR.

Fits better with e.g. KERNCONFDIR.

Add a small paragraph in kmod.mk which was taken from FreeBSD.

2 years agokernel: Staticize some variables.
Sascha Wildner [Thu, 25 Nov 2021 20:54:21 +0000 (21:54 +0100)]
kernel: Staticize some variables.

2 years agonrelease: Switch to makefs(8) for the ISO's EFI system partition image.
Sascha Wildner [Thu, 25 Nov 2021 16:45:40 +0000 (17:45 +0100)]
nrelease: Switch to makefs(8) for the ISO's EFI system partition image.

Tested-by: tuxillo
2 years ago<sys/param.h>: Bump __DragonFly_version for makefs(8)'s msdosfs support.
Sascha Wildner [Thu, 25 Nov 2021 16:43:47 +0000 (17:43 +0100)]
<sys/param.h>: Bump __DragonFly_version for makefs(8)'s msdosfs support.