Sascha Wildner [Sun, 18 Feb 2018 01:42:43 +0000 (02:42 +0100)]
Replace local array size calculations with NELEM().
Eitan Adler [Fri, 16 Feb 2018 08:53:39 +0000 (00:53 -0800)]
Convert from __arysize to NELEM
Try to use a single macro across the board
Discussed-with: zrj, swildner
Sascha Wildner [Sat, 17 Feb 2018 22:35:11 +0000 (23:35 +0100)]
nfs.5: Adjust (c) year.
Sascha Wildner [Sat, 17 Feb 2018 22:31:09 +0000 (23:31 +0100)]
nfs.5: Remove unneeded .Pp
Sascha Wildner [Sat, 17 Feb 2018 22:29:15 +0000 (23:29 +0100)]
devfs.5: Document sysctl.
Submitted-by: zrj
Sascha Wildner [Sat, 17 Feb 2018 22:28:15 +0000 (23:28 +0100)]
ffs.5: Document more sysctls.
Move ffs sysctls to their own section.
Submitted-by: zrj
Sascha Wildner [Sat, 17 Feb 2018 22:27:03 +0000 (23:27 +0100)]
Add nfs(5) manpage.
Document all sysctls.
Submitted-by: zrj
Sascha Wildner [Sat, 17 Feb 2018 22:25:39 +0000 (23:25 +0100)]
Add vfs(7) manpage.
Document all sysctls except for sizeof stuct ones.
Submitted-by: zrj
Matthew Dillon [Sat, 17 Feb 2018 19:29:49 +0000 (11:29 -0800)]
kernel - Fix syscons's visual bell
* The visual bell code was completely broken.
* Refactor the callout, and use the new callout_init_lk facility
to deal with races.
Reported-by: snurg
François Tigeot [Sat, 17 Feb 2018 08:56:55 +0000 (09:56 +0100)]
drm/linux: Update hlist_for_each_entry_safe() from FreeBSD
Tomohiro Kusumi [Sat, 17 Feb 2018 01:49:39 +0000 (10:49 +0900)]
sbin/hammer: Fix compile warning on Linux
Warned by gcc 7.3.1 in Fedora.
Extend the size of destination string.
dirent::d_name[] is 256 bytes in Linux (and *BSD).
--
cmd_abort.c: In function 'hammer_cmd_abort_cleanup':
cmd_abort.c:73:44: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size 55 [-Wformat-truncation=]
snprintf (pidfile, PIDFILE_BUFSIZE, "%s/%s",
^~
cmd_abort.c:73:4: note: 'snprintf' output between 10 and 265 bytes into a destination of size 64
snprintf (pidfile, PIDFILE_BUFSIZE, "%s/%s",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pidfile_loc, den->d_name);
~~~~~~~~~~~~~~~~~~~~~~~~~
Eitan Adler [Fri, 16 Feb 2018 08:13:08 +0000 (00:13 -0800)]
mille(6): minor nits
- adding missing header
- remove unused variable
- static where possible
Reviewed-by: zrj
zrj [Wed, 14 Feb 2018 15:08:24 +0000 (17:08 +0200)]
gcc50: Switch backends to use internal lib framework.
Previously backends where implicitly using bsd.hostlib.mk that have few
unwanted side effects (backends are install targets). Avoid that.
No functional change for current master users.
Tested-with: WORLD_CCVER and _DEFAULT_CCVER combinations.
zrj [Thu, 15 Feb 2018 13:43:06 +0000 (15:43 +0200)]
fish(6): Suppress -Wdiscarded-qualifiers warning.
Sascha Wildner [Thu, 15 Feb 2018 14:19:30 +0000 (15:19 +0100)]
/usr/Makefile: Fix typo.
Eitan Adler [Thu, 15 Feb 2018 12:21:58 +0000 (04:21 -0800)]
correct prior commit...
Eitan Adler [Thu, 15 Feb 2018 12:17:58 +0000 (04:17 -0800)]
larn(6): fix open call
Prior to this the ", 0666" was being treated like the comma operator
rather than an argument to open(2).
Eitan Adler [Thu, 15 Feb 2018 12:10:13 +0000 (04:10 -0800)]
larn(6): remove HIDEBYLINK
The implementation of HIDEBYLINK is a bit wonky, doesn't really work,
and includes its own reimplementation of bzero.
Eitan Adler [Thu, 15 Feb 2018 11:52:52 +0000 (03:52 -0800)]
fish(6): fix several issues
- avoid use of _ in application namespace
- use posix_spawnp instead of system()
- prefer less(1) over more(1)
- mark usage as dead
- staticfy
This world-class programs deserves world-class source code.
Sascha Wildner [Thu, 15 Feb 2018 11:03:40 +0000 (12:03 +0100)]
Update the pciconf(8) database.
February 15, 2018 snapshot from https://pci-ids.ucw.cz
Sascha Wildner [Thu, 15 Feb 2018 09:10:34 +0000 (10:10 +0100)]
<pthread.h>: Note that we are missing some functions in #if 0'd protos.
Eitan Adler [Thu, 15 Feb 2018 08:53:49 +0000 (00:53 -0800)]
devd: only use correct argument in select(2)
Discussed-with: zrj
Reviewed-by: vangyzen@FreeBSD.org, ian@FreeBSD.org
Objected-to-by: imp@FreeBSD.org
Eitan Adler [Thu, 15 Feb 2018 08:40:34 +0000 (00:40 -0800)]
select(2): mark as restrict in man page
This has already been done in code, so change the man page
Discussed-with: swildner
Sascha Wildner [Thu, 15 Feb 2018 08:54:34 +0000 (09:54 +0100)]
Add missing restrict qualifiers in POSIX function definitions/declarations.
This creates no further -Wrestrict warnings with gcc80 in buildworld.
Sascha Wildner [Thu, 15 Feb 2018 08:26:09 +0000 (09:26 +0100)]
<sys/cdefs.h>: Add __restrict_arr to declare arrays as non-overlapping.
Based-on: glibc
Matthew Dillon [Wed, 14 Feb 2018 19:53:40 +0000 (11:53 -0800)]
kernel - Vet b_cmd in swap_pager_strategy().
* swap_pager_strategy() needs to properly vet b_cmd. This doesn't fix
any bugs per-say, but is needed for robustness to ensure that the code
does not accidently corrupt the swapcache in a later evolution.
Matthew Dillon [Wed, 14 Feb 2018 19:49:40 +0000 (11:49 -0800)]
kernel - Fix rare missed wakeup() in lockmgr
* Fix a rare missed wakeup() case in lockmgr. lk_count can briefly
become (SHARED | 0 counts | (EXREQ or UPREQ)). Three competing cores
can then cause a situation where undo_shreq() fails to issue a wakeup()
to threads acquiring a shared lock that are blocked waiting for the
EXREQ or UPREQ
Issue the missing wakeup() for this case.
* This race arises because of an optimization we make when dropping a
shared lock. atomic_fcmpset*() loops are fairly poor at dealing
with concurrent increments and decrements, so undo_shreq() (which
is also used when releasing a standard shared lock) decrements the
shared lock count first, then deals with EXREQ or UPREQ afterwords.
Usually a shared lock request bumps the shared lock count before
blocking, which other lock releases use to determine the need for a
wakeup(). However, shared lock requests cannot bump the shared lock
count when the lock is already held SHARED but there is an EXREQ or
UPREQ pending, because doing do basically grants the shared lock
immediately.
This combination leads to the brief situation which allows other cpu
cores to squeeze in operations of their own without realizing that
someone might be blocked trying to obtain a shared lock, but with no
shared count present to indicate so. If the undo_shreq()'s later
atomic_fcmpset*() calls then fail, or find that there is no EXREQ or
UPREQ pending, it fails to issue the needed wakeup().
Matthew Dillon [Wed, 14 Feb 2018 15:48:10 +0000 (07:48 -0800)]
hammer2 - Add missing bkvasync() (2)
* Add another missing bkvasync(). This fixes a temporary (memory-only)
corruption issue which crops up in synth tests.
Matthew Dillon [Wed, 14 Feb 2018 15:45:26 +0000 (07:45 -0800)]
kernel - Document bkvasync() requirements
* Document that bkvasync() needs to be callable from multiple
cpus concurrently (aka H2 shared buffering). The lock has to be
controlled by the caller (owned by the caller in some way), but the
owner does not have to be the calling cpu.
zrj [Wed, 14 Feb 2018 09:30:38 +0000 (11:30 +0200)]
Bump __DragonFly_version after %b and %r formats removal.
Sascha Wildner [Wed, 14 Feb 2018 08:49:50 +0000 (09:49 +0100)]
ddb: Some minor adjustments.
zrj [Sun, 4 Feb 2018 17:13:02 +0000 (19:13 +0200)]
kernel: Add security.ptr_restrict sysctl.
Allow to prevent leaking kernel addresses back to the userland
(intentionally or not). We have quite a lot debug prints already and by
default we allow unprivileged processes to read kernel message buffers.
zrj [Sun, 4 Feb 2018 15:58:34 +0000 (17:58 +0200)]
Update porting_drivers.txt
zrj [Sun, 4 Feb 2018 15:32:02 +0000 (17:32 +0200)]
world: Remove references to %r and %b.
While there, remove %r and %b and %y support from libstand(3).
Those format are not used in loaders and only eat space.
zrj [Sun, 4 Feb 2018 14:50:03 +0000 (16:50 +0200)]
kernel: Remove last use cases of "%b" format.
Switch to args safe "%pb%i" internal format.
zrj [Sun, 4 Feb 2018 14:27:27 +0000 (16:27 +0200)]
kernel/disk: Remove use of "%b" format.
Switch to args safe "%pb%i" internal format.
zrj [Sun, 4 Feb 2018 13:06:59 +0000 (15:06 +0200)]
kernel/net: Remove use of "%b" format.
Switch to args safe "%pb%i" internal format.
Note: the if_nfe.c used 0x%4b format, while %b was not handling the width.
zrj [Sun, 4 Feb 2018 12:30:53 +0000 (14:30 +0200)]
kernel: Remove use of "%b" format in main kernel code.
Switch to args safe "%pb%i" internal format.
zrj [Sun, 4 Feb 2018 12:15:43 +0000 (14:15 +0200)]
kernel: Implement "%pb%i" as args safe "%b" replacement.
zrj [Sat, 3 Feb 2018 19:27:51 +0000 (21:27 +0200)]
kernel: Nuke legacy FreeBSD "%r" format support.
Makes a quite a cleanup in subr_prf.c and less hits against things
like "%rip". Only one custom format remains - "%b".
zrj [Sat, 3 Feb 2018 18:42:11 +0000 (20:42 +0200)]
kernel: Remove use of deprecated "%r" radix format.
zrj [Sat, 3 Feb 2018 18:37:03 +0000 (20:37 +0200)]
kernel: Implement makedev_unit_b32()
It would be used to replace deprecated legacy FreeBSD "%r" formats.
Change tty_pty.c to use hex2ascii(), since it has only upto 32 devices.
zrj [Sat, 3 Feb 2018 13:08:21 +0000 (15:08 +0200)]
ddb(4): Remove use of deprecated "%r" radix format.
Use internal helpers like for "%z" to print numbers.
Taken-from: NetBSD (with adaptations by swildner)
Matthew Dillon [Wed, 14 Feb 2018 07:02:18 +0000 (23:02 -0800)]
kernel - Try to fix delayed mtime updates on SHARED+RW maps again
* Attempt to fix continuing problems with mtime updates related to
modifications made via SHARED+RW mmap()s. As evidenced by builds
under synth sometimes getting confused.
* Don't update vp->v_lastwrite_ts in vop_stdclose(). Instead, update
the field and set a new flag VLASTWRITETS upon mmap(SHARED+PROT_WRITE)
or upon mprotect(PROT_WRITE) on a SHARED mmap.
* Clear the flag on any regular write, utimes, or truncation.
* Adjust various filesystems to update mtime from vp->v_lastwrite_ts
only upon UIO_NOCOPY writes, and only if VLASTWRITETS is set.
tmpfs, ufs, hammer, hammer2 adjusted.
Matthew Dillon [Wed, 14 Feb 2018 01:46:46 +0000 (17:46 -0800)]
hammer2 - Add missing bkvasync()
* Add missing bkvasync() when a file read receives a chain from the
XOP helper thread.
Sascha Wildner [Tue, 13 Feb 2018 17:25:10 +0000 (18:25 +0100)]
pthread.3: Add missing functions.
Sascha Wildner [Tue, 13 Feb 2018 17:23:21 +0000 (18:23 +0100)]
<signal.h>: Adjust #if 0'd prototype.
Sascha Wildner [Tue, 13 Feb 2018 17:22:38 +0000 (18:22 +0100)]
Change __restrict -> restrict in two manual pages.
Tomohiro Kusumi [Tue, 13 Feb 2018 23:48:39 +0000 (08:48 +0900)]
sbin/hammer: Fix compile error on Linux
Failed with gcc 4.4.7 in CentOS 6.x.
--
cmd_recover.c:78: error: redefinition of typedef 'bigblock_t'
cmd_recover.c:55: note: previous declaration of 'bigblock_t' was here
Tomohiro Kusumi [Tue, 13 Feb 2018 23:35:32 +0000 (08:35 +0900)]
sys/vfs/autofs: Remove AUTOFS_ASSERT_*LOCKED()
These macros came from FreeBSD, but more readable without these.
Tomohiro Kusumi [Tue, 13 Feb 2018 22:13:13 +0000 (07:13 +0900)]
sys/vfs/autofs: Change autofs_mount::am_lock to use mutex(9)
Tomohiro Kusumi [Tue, 13 Feb 2018 21:57:32 +0000 (06:57 +0900)]
sys/vfs/autofs: Change autofs_node::an_vnode_lock to use mutex(9)
Sascha Wildner [Tue, 13 Feb 2018 14:06:25 +0000 (15:06 +0100)]
hammer(8): Remove include guards in a .c file.
Tomohiro Kusumi [Tue, 13 Feb 2018 18:33:30 +0000 (03:33 +0900)]
sys/vfs/autofs: Remove #if0'd export related code
Exporting is never going to be implemented.
Tomohiro Kusumi [Tue, 13 Feb 2018 17:10:39 +0000 (02:10 +0900)]
sys/vfs/autofs: Cleanups
zrj [Tue, 13 Feb 2018 09:56:13 +0000 (11:56 +0200)]
binutils227: Add support for DWARF-4 line number tables.
Backport from upstream trunk the
c83344582375e65643c5efe68b3739e87db482f3
Work around the ld.gold issue when '.rela.debug_line' is populated.
We use ld.gold as default system linker that sigbus on DWARF-4 tables.
LDVER=ld.bfd seems to be unaffected, apply 2018-02-03 fix only for 227.
No functional change for default non-debug buildworlds (only for gcc80).
Sascha Wildner [Mon, 12 Feb 2018 20:05:42 +0000 (21:05 +0100)]
<unistd.h>: Remove commented out ctermid() prototype. It's not needed here.
Tomohiro Kusumi [Tue, 13 Feb 2018 02:28:15 +0000 (11:28 +0900)]
etc/autofs: Cleanup trailing whitespaces
This generates diff from FreeBSD.
Tomohiro Kusumi [Mon, 12 Feb 2018 10:24:24 +0000 (19:24 +0900)]
etc/autofs: Sync special_media with FreeBSD
Tomohiro Kusumi [Mon, 12 Feb 2018 10:22:40 +0000 (19:22 +0900)]
usr.sbin/fstyp: Bring in exFAT support from FreeBSD
exFAT support was added by below FreeBSD@GitHub commit in 2017.
f72e57262fe11f1cc7ffc3b3000bc5747467b8c3
Matthew Dillon [Sun, 11 Feb 2018 06:18:19 +0000 (22:18 -0800)]
tmpfs - Fix data loss issues
* Fix a data loss issue that can occur when vnodes are cycled. This
can be replicated by setting kern.maxvnodes to a fairly low value.
Vnode recycling does not necessarily issue a vinvalbuf() when clean
pages are present, which tmpfs needs to retain.
* Fix a data loss issue when swap becomes full or when the system has
no swap configured. When tmpfs tries to flush to swap and fails,
pages can remain associated with the vnode after the vinvalbuf()
call, and then lost when the vnode is recycled.
* The above fixes are accomplished by call vinvalbuf() on vnode deactivation
to make sure that all buffers have been flushed, and then moving any
pages that remain to tn_aobj.
The pages are moved back when the vnode is reinstantiated and an open(),
read(), write(), or setattr (i.e. truncation or extension) is called.
We try to avoid moving the pages back if the vnode is merely *stat()d
or deleted.
* Use cluster_read() by default to try to improve read throughput when
pages are swap-backed.
Reported-by: zrj, marino
Matthew Dillon [Sun, 11 Feb 2018 06:17:31 +0000 (22:17 -0800)]
kernel - syntax
* Improve a formatting issue.
Matthew Dillon [Sun, 11 Feb 2018 06:11:18 +0000 (22:11 -0800)]
kernel - Fix two rare namecache bugs
* Fix calculations which use the vfscache_negs global. This global
is somewhat heuristical and can values which are a bit off, including
0. Copy to a local and limit the range, fixing a divide-by-zero
bug and a negative-number handling bug.
* Fix a bug in the handling of a race in _cache_cleanneg(). We were
unlocking the ncp but failing to drop it, leaving it with a ref.
The accumulating namecache records prevent umount from succeeding.
This race can only occur regularly when kern.maxvnodes is set to
a low value.
Sepherosa Ziehau [Sat, 10 Feb 2018 02:37:16 +0000 (10:37 +0800)]
if: Allow user to override software queue length.
Sepherosa Ziehau [Sat, 10 Feb 2018 00:19:49 +0000 (08:19 +0800)]
if: Remove ifq maxlen fixup in ifinit.
It will not work, and no drivers in the base require this kind of fixup.
Sascha Wildner [Thu, 8 Feb 2018 10:16:52 +0000 (11:16 +0100)]
<fcntl.h>: Add #if 0'd prototypes for posix_fa{dvise,llocate}().
Sascha Wildner [Wed, 7 Feb 2018 14:06:18 +0000 (15:06 +0100)]
syscall.9: Explain better how errno and return value are set in userland.
In-discussion-with: peeterm, zrj
Sascha Wildner [Tue, 6 Feb 2018 08:49:30 +0000 (09:49 +0100)]
Use 'null' and 'NULL' instead of 'nil' in some manual pages.
Matthew Dillon [Sun, 4 Feb 2018 19:17:47 +0000 (11:17 -0800)]
kernel - Do not panic on media size of zero in disk_probe()
* Do not panic if the media size is zero in disk_probe().
Matthew Dillon [Sun, 4 Feb 2018 19:13:03 +0000 (11:13 -0800)]
kernel - Fix CAM peripheral error handling
* cam_periph.c was bcopy()ing the *ENTIRE* saved ccb back to the
original when working through certain error results. This completely
destroys linked list entry fields.
* Refactor by hacking a restore_ccb() function which does not copy
over the link list entry fields or the callout structure.
* Fixes panics with CDs, particularly audio CDs, and can also fix
other panics.
Panics are related to situations where an AHCI error or errors occur
while multiple CCBs are queued.
* Also always initialize the state tracking field for various scsi
periphals to ensure that stale data does not result in improper
processing in scsi/*.c's *done() functions.
Reported-by: htse
Matthew Dillon [Sun, 4 Feb 2018 19:01:49 +0000 (11:01 -0800)]
ahci - Improve debug output
* TFES errors now also report the slot and ccb pointer
Sascha Wildner [Sun, 4 Feb 2018 12:01:46 +0000 (13:01 +0100)]
bsd.sys.mk: Don't exclude -Wformat-extra-args in FORMAT_AUDIT builds.
Not sure why this was originally added but we surely want to see them.
Reported-by: zrj
Sascha Wildner [Sun, 4 Feb 2018 11:59:59 +0000 (12:59 +0100)]
gdb/lvm: Fix two -Wformat-extra-args warnings.
The gdb one was taken from upstram and the lvm one is in __DragonFly__
specific code.
Sascha Wildner [Sat, 3 Feb 2018 20:41:20 +0000 (21:41 +0100)]
pthread_join.3: Add a missing header in the SYNOPSIS.
zrj [Sat, 3 Feb 2018 08:56:45 +0000 (10:56 +0200)]
cpucontrol(8): Fix -e handling.
We do not have implemented CPUCTL_EVAL_CPU_FEATURES in cpuctl(4) yet.
Sascha Wildner [Sat, 3 Feb 2018 08:00:39 +0000 (09:00 +0100)]
Fix a few mdoc issues.
Sascha Wildner [Sat, 3 Feb 2018 08:00:23 +0000 (09:00 +0100)]
newsyslog.8: Comment out another zstd reference (and fix a typo).
Sascha Wildner [Sat, 3 Feb 2018 07:57:40 +0000 (08:57 +0100)]
callout.9: Remove some obsolete MLINKS.
Eitan Adler [Sat, 3 Feb 2018 04:58:31 +0000 (20:58 -0800)]
[fish] fix style
Eitan Adler [Sat, 3 Feb 2018 04:51:45 +0000 (20:51 -0800)]
[fish] don't allow users to request cards they have made books for
It is not technically legal to request a card you don't have in your
hand, even if you have the book for it. This really only matters if
you're playing with more than one deck, which fish(6) does not support,
but since this is a critical bug, fix it.
zrj [Fri, 2 Feb 2018 20:15:20 +0000 (22:15 +0200)]
newsyslog(8): Add missing fallthrough.
Sascha Wildner [Fri, 2 Feb 2018 15:24:08 +0000 (16:24 +0100)]
Normalize libcrypto and libssl DPADD variable names and adjust Makefiles.
zrj [Tue, 30 Jan 2018 16:47:48 +0000 (18:47 +0200)]
drill(1): Use strdup() for known strings.
zrj [Tue, 30 Jan 2018 16:25:54 +0000 (18:25 +0200)]
libarchive: Use memcpy() when constructing buffers.
Avoid common mistakes that strncpy() will terminate the string.
Results here are not expected to be NULL terminated.
zrj [Tue, 30 Jan 2018 18:36:08 +0000 (20:36 +0200)]
ee(1): Fix ispell_op().
Do not pass NULL to sprintf, use tempname returned by mkstemp(3).
zrj [Wed, 31 Jan 2018 12:08:56 +0000 (14:08 +0200)]
truncate(1): Add support for T.
While there, add fallthrough.
zrj [Wed, 31 Jan 2018 12:06:19 +0000 (14:06 +0200)]
tput(1): Constify.
While there, add fallthrough.
zrj [Wed, 31 Jan 2018 12:02:08 +0000 (14:02 +0200)]
rs(1): Staticize.
While there, add few fallthrough.
zrj [Wed, 31 Jan 2018 11:47:02 +0000 (13:47 +0200)]
jot(1): General cleanup.
* staticize
* constify
* add fallthrough
zrj [Wed, 31 Jan 2018 11:33:32 +0000 (13:33 +0200)]
ident(1): Use NULL instead of 0.
While there, add few cases of fallthrough (few need more investigation).
zrj [Wed, 31 Jan 2018 11:16:43 +0000 (13:16 +0200)]
ctags(1): Add missing fallthrough.
The -v option implies the -x.
zrj [Wed, 31 Jan 2018 11:13:12 +0000 (13:13 +0200)]
colcrt(1): Add missing fallthrough.
zrj [Wed, 31 Jan 2018 11:04:08 +0000 (13:04 +0200)]
at(1): Add missing fallthrough.
While there, constify struct.
zrj [Tue, 30 Jan 2018 21:22:43 +0000 (23:22 +0200)]
kgdb(1): Avoid -Wformat-truncation warning.
No functional change.
zrj [Tue, 30 Jan 2018 19:50:13 +0000 (21:50 +0200)]
window(1): Add some format safety.
While there, add some FALLTHROUGH too.
zrj [Tue, 30 Jan 2018 19:13:11 +0000 (21:13 +0200)]
netstat(1): Add some formats safety.
No functional change intended.
zrj [Tue, 30 Jan 2018 14:43:43 +0000 (16:43 +0200)]
sort(1): Use asprintf(3) when fixing legacy options.
While there, make fix_obsolete_keys() static.
zrj [Tue, 30 Jan 2018 20:31:52 +0000 (22:31 +0200)]
tzsetup(8): Suppress -Wformat-overflow warning.
zrj [Tue, 30 Jan 2018 19:32:45 +0000 (21:32 +0200)]
systat(8): Add some formats safety.
Mainly to suppress -Wformat-overflow
zrj [Tue, 30 Jan 2018 20:28:21 +0000 (22:28 +0200)]
sliplogin(8): Add some formats safety.
Use %hu for printing ipv4 address octects and reduce login name lenght a
bit to allow for prepending path.