Commit Graph

281010 Commits

Author SHA1 Message Date
Fedor Uporov
0de4895aac Fix pjfstest issue tests/rename/23.t
This test creates two files like file0 and file1,
then creates link to file1 and checks ctime on it.
Then renames file0 to file1. Then checks ctime on
link again. It is expected, that second ctime will
be higher then first ctime, because rename happen.
Add ctime updating for directory entry,
which will be deleted on rename.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38051
2023-01-29 11:12:32 +03:00
Fedor Uporov
9ad2d4c490 Fix pjfstest issue tests/rename/19.t
The rename call with args like:
"./dir0/dir1/.." "./dir2" will cause MPASS failure.
The tmpfs_dir_lookup() does not accept names like
'.' and '..' for lookup. Move the '.' and '..' entry
check before tmpfs_dir_lookup() call.

Reviewed by:    kib
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D38051
2023-01-29 11:11:23 +03:00
Fedor Uporov
344243fc92 Fix block bitmap end position computation
PR:                     261850
Reported by:            chenguang.wang
MFC after:              2 weeks
2023-01-29 11:11:02 +03:00
Fedor Uporov
509ee39ff2 Fix developer second name. 2023-01-29 11:10:39 +03:00
Stefan Eßer
fdd4c35832 usr.bin/gh-bc: update Makefiles for version 6.2.2
The sources of this program are in contrib/bc, but built using the
Makefiles touched in this commit, which had to be adapted to comply
with changed made to the build system of this software, which is
not used when building in the base system.
2023-01-28 23:48:34 +01:00
Stefan Eßer
d101cdd6ed contrib/bc: merge from vendor release 6.2.2
This update fixes a few issues in history editing and the processing
of the "quit" function. The "quit" function will no longer cause bc
to exit when encountered in a script file (before any command from
the script has been executed).

New functions is_number(), is_string return 1 if the passed argument
is a number resp. a string. The asciify() function has been extended
to support the conversion of an array of numbers into a string.

Merge commit '1a63323d17fedb05b6962853e821c9d7c6b9853e'
2023-01-28 22:26:22 +01:00
Stefan Eßer
1a63323d17 vendor/bc: import version 6.2.2
This is a production release that fixes a bug.

The bug was that if an array element was used as a parameter, and then
a later parameter had the same name as the array whose element was
used, bc would grab the element from the new array parameter, not the
actual element from before the function call.
2023-01-28 21:08:43 +01:00
Stefan Eßer
3c2ba19f6b vendor/bc: import version 6.2.1
This fixes one bug  in the history editing functions.
2023-01-28 21:06:20 +01:00
Stefan Eßer
e7017237c9 vendor/bc: import version 6.2.0
This is a production release with a new feature and a few bug fixes.

The bug fixes include:

 - A crash when bc and dc are built using editline, but history is not
   activated.
 - A missing local in the uint*() family of functions in the extended
   math library.
 - A failure to clear the tail call list in dc on error.
 - A crash when attempting to swap characters in command-line history
   when no characters exist.
 - SIGWINCH was activated even when history was not.

The new feature is that stack traces are now given for runtime errors.
In debug mode, the C source file and line of errors are given as well.
2023-01-28 21:02:27 +01:00
Stefan Eßer
0b671e8cf1 vendor/bc: import version 6.1.0
This is a production release that fixes a discrepancy from the bc
standard, a couple of memory bugs, and adds new features.

The discrepancy from the bc standard was with regards to the behavior
of the quit command. This bc used to quit whenever it encountered quit
during parsing, even if it was parsing a full file. Now, bc only quits
when encountering quit after it has executed all executable statements
up to that point.

This behavior is slightly different from GNU bc, but users will only
notice the difference if they put quit on the same line as other
statements.

The first memory bug could be reproduced by assigning a string to a
non-local variable in a function, then redefining the function with
use of the same non-local variable, which would still refer to a
string in the previous version of the function.

The second memory bug was caused by passing an array argument to the
asciify() built-in function. In certain cases, that was wrongly
allowed, and the interpreter just assumed everything was correct and
accessed memory. Now that arrays are allowed as arguments (see below),
this is not an issue.

The first feature was the addition of the is_number() built-in
function (u in dc) that returns 1 if the runtime argument is a number
and 0 otherwise.

The second feature was the addition of the is_string() built-in
function (t in dc) that returns 1 if the runtime argument is a string
and 0 otherwise.

These features were added because I realized that type-checking is
necessary now that strings can be assigned to variables in bc and
because they've always been assignable to variables in dc.

The last added feature is the ability of the asciify() built-in
function in bc to convert a full array of numbers into a string. This
means that character-by-character printing will not be necessary, and
more strings than just single-character ones will be able to be
created.
2023-01-28 20:59:18 +01:00
Stefan Eßer
9471e6a095 vendor/bc: import version 6.0.4
This version fixes a bug in the BC library that only affected
OpenBSD.
2023-01-28 20:54:39 +01:00
Xin LI
8f02c0d156 Disable sandboxing when building with WITHOUT_CAPSICUM.
PR:		bin/269185
MFC after:	3 days
2023-01-28 10:53:47 -08:00
Alexander Naumochkin
050e4bca94 stat(1): Do not pass S_IFBLK to devname unconditionally
PR:	269190
Reviewed by:	kib
MFC after:	1 week
2023-01-28 20:04:43 +02:00
Alexander Naumochkin
0311fe403d devname(3): apply S_ISBLK() to type, not dev_t
PR:	269190
Reviewed by:	kib
MFC after:	1 week
2023-01-28 20:04:35 +02:00
Dmitry Chagin
c19fc5cd9b linux_common: Fixup .PATH.
Since we have arm64, and awaiting ppc64 Linuxulator, do not include x86 specific
path to the module build for non x86 architectures.

MFC after:		1 week
2023-01-28 20:31:38 +03:00
Alexander V. Chernikov
95b47ba629 netlink: export nextop group kernel index when dumping multipath route.
MFC after:	2 weeks
2023-01-28 15:39:25 +00:00
Bjoern A. Zeeb
dbbf46ebba LinuxKPI: skbuff: implement skb_free_frag()
Using the work from 55038a6306 implement
skb_free_frag() calling page_frag_free().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-28 15:33:12 +00:00
Gordon Bergling
ee27834d74 umcs(4): Fix a typo in a kernel message
- s/confguration/configuration/
- s/nornal/normal/

Obtained from:	NetBSD
MFC after:	5 days
2023-01-28 15:45:52 +01:00
Dmitry Chagin
9922bccbc9 linux(4): Convert mount exported flags for statfs system calls.
MFC after:		1 week
2023-01-28 13:20:27 +03:00
Dmitry Chagin
953688e823 linux(4): Rework statfs conversion routine.
Rework the routines to convert a native statfs structure (with fixed-size 64-bit
counters) to a Linux statfs structure (with long-sized counters) for 32-bit apps.

Instead of following Linux and return an EOVERFLOW error from statfs() family of
syscalls when actual fs stat value(s) are large enough to not fit into 32 bits,
apply scale logics used by FreeBSD to convert a 5.x statfs structure to a 4.x
statfs structure.

For more details see cc479dda.

Tested by:		glebius
MFC after:		1 week
2023-01-28 13:19:41 +03:00
John Baldwin
4d77927e2a linuxkpi: Use a proper declaration for pm_suspend_via_firmware.
Reported by:	GCC -Wstrict-prototypes
2023-01-27 19:41:35 -08:00
Simon J. Gerraty
4fde40d9b5 Merge/update to bmake-20230126 2023-01-27 16:33:01 -08:00
Simon J. Gerraty
2e36ab2363 Import bmake-20230126
Relevant/interesting changes (see ChangeLog for more):

	o variables like .newline and .MAKE.{GID,PID,PPID,UID}
	should be read-only.
	o .[NO]READONLY: for control of read-only variables
	o .SYSPATH: for controlling the path searched for makefiles
	o allow for white-space between command specifiers @+-
	o add more details to warning 'Extra targets ignored'
	o make.1: sync list of built-in variables with reality
	sort list of built-in variables
	o cond.c: add more details to error message for numeric comparison
	o job.c: fix handling of null bytes in output
	o Allow .break to terminate a .for loop early
	o var.c: fix out-of-bounds errors when parsing
	o fix exit status for '-q' (since 1994)
2023-01-27 16:23:54 -08:00
Mitchell Horne
52f9a2823c rtalloc.9: remove obsolete man page
This KPI was removed in d223372545. Note that there are a handful of
references remaining in the src tree to these rtalloc functions that
could be cleaned up by someone with more domain knowledge.

Reviewed by:	pauamma (manpages), glebius, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38188
2023-01-27 18:01:47 -04:00
Mitchell Horne
d1c7405ef6 PCBGROUP.9: remove obsolete man page
The PCBGROUP option and KPI were removed entirely in 93c67567e0.

Reviewed by:	pauamma (manpages), glebius, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38187
2023-01-27 18:01:47 -04:00
John Baldwin
370110fd57 universe: Switch GCC toolchains to GCC 12.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D38230
2023-01-27 13:35:13 -08:00
Jean-Sébastien Pédron
3d751b7a71
linuxkpi: Add pin_user_pages*() functions
They were defined in the i915 DRM driver. I move the code in linuxkpi so
it can benefit other drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38078
2023-01-27 21:54:39 +01:00
Jean-Sébastien Pédron
3e0856b63f
linuxkpi: Fix sg_alloc_table_from_pages() to have the same API as Linux
It now returns a `struct scatterlist *` pointer instead of an error
code only.

The implementation is incomplete because it doesn't use the `prv`
argument.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38077
2023-01-27 21:53:59 +01:00
Jean-Sébastien Pédron
8c46bd9f86
linuxkpi: Include linux/sched/mm.h from linux/sched.h
At least one file in the DRM drivers benefits from some namespace
pollution to use `fs_reclaim_acquire()`/`fs_reclaim_release()`. They are
defined in `linux/sched/mm.h` and this header must be included
indirectly into the DRM drivers' source file.

I couldn't find how it was included. Therefore this commit includes
`linux/sched/mm.h` from `linux/sched.h`. This is not the case in Linux
but fixes the issue with the DRM drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D37912
2023-01-27 21:53:44 +01:00
Ed Maste
e7f9bdb4a6 Cirrus-CI: switch GCC job to GCC 12
We need a C++20 or later compiler.

Sponsored by:	The FreeBSD Foundation
2023-01-27 15:02:34 -05:00
Mark Johnston
96bc40f4df release.7: Correct a variable name
MFC after:	1 week
2023-01-27 14:01:12 -05:00
Emmanuel Vadot
04afa8cc37 loader: md: Use default func for fmtdev and parsedev
The default function are enough for md so use them instead of the
disks ones that doesn't work for it anymore.

Reviewed by:	imp
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	now
Differential Revision:	https://reviews.freebsd.org/D38218
2023-01-27 19:06:25 +01:00
Alexander V. Chernikov
79111aa26f netstat: fix format string on 32-bit archs 2023-01-27 17:45:49 +00:00
Konstantin Belousov
153643a5bc amd64: do not enable PKRU if user disabled saving PKRU register in xsave mask
This is done by reverting CR4_PKE bit, because we perform %CR4
initialization in initializecpu(), and the function is called before
xsave_mask is read.  To not redo the whole early initialization
sequence for the corner case, this should be good enough.

Reported by:	jhb
Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38219
2023-01-27 19:44:49 +02:00
Konstantin Belousov
11989314dc x86: add more definitions for XCR0 bits
This covers all currently defined bits, adding PKRU and TILE.

Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38219
2023-01-27 19:44:49 +02:00
John Baldwin
9501683925 Revert "Don't omit bsd.compiler.mk for the nested delete-old in buildworld."
The original motivation (src.opts.mk needing bsd.comppiler.mk to
determine if CXX is supported) is no longer relevant now that CXX is
non-optional.

This reverts commit b9cb80883b.
2023-01-27 09:41:47 -08:00
Allan Jude
5ff13fbc19 MFV: zstd 1.5.2
Merge commit 'b3392d84da5bf2162baf937c77e0557f3fd8a52b' into zstd_1.5.2

full changelog: https://github.com/facebook/zstd/compare/v1.4.8...v1.5.2

Updated sys/kern/subr_compressor.c to new API

MFC after:	3 days
Relnotes:	yes
Sponsored by:	Klara, Inc.
2023-01-27 17:22:31 +00:00
Alexander V. Chernikov
68636dcb6f netstat: make netstat -rn use netlink instead of rtsock
This change switches route listing in netstat to netlink, with fallback to rtsock.
The outputs are mostly identical, with an exception of not showing kernel
 nexthop indexes for multipath routes.

Differential Revision: https://reviews.freebsd.org/D36529
2023-01-27 15:36:10 +00:00
Bjoern A. Zeeb
68b1d16250 LinuxKPI: linux_pci.c: fix whitespace
Properly indent a line.  No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-27 15:27:42 +00:00
Gleb Smirnoff
f394d9c0a4 sysctl: use correct types and names in sysctl_*sec_to_sbintime
The functions are intended to report kernel variables that are
stored as sbintime_t (pointed to by arg1) as human readable
nanoseconds or milliseconds (reported via sysctl_handle_64).
The variable types and names were reversed.  I guess there is
no functional change here, as all types flipped around were
signed 64.  Note that these function aren't used yet anywhere
in the kernel.

Reviewed by:		mav
Differential revision:	https://reviews.freebsd.org/D38217
2023-01-27 07:09:22 -08:00
Emmanuel Vadot
cc9b2b58e2 Revert "rc.d: Put growfs script in FreeBSD-ufs"
The growfs script also support zfs.

This reverts commit 36a7fa1e16.

Reported by:	emaste, Mina Galić
2023-01-27 11:30:24 +01:00
Emmanuel Vadot
a6a21bbedc rc.d: Put resolv script in FreeBSD-resolvconf
Differential Revision:	https://reviews.freebsd.org/D37190
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
36a7fa1e16 rc.d: Put growfs script in FreeBSD-ufs
Differential Revision:	https://reviews.freebsd.org/D37189
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
91314ca2ff rc.d: Put ggated script in FreeBSD-ggate
Differential Revision:	https://reviews.freebsd.org/D37188
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
81b18bea09 rc.d: Put dhclient script in FreeBSD-dhclient
Differential Revision:	https://reviews.freebsd.org/D37187
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
d8799160c2 rc.d: Put devmatch script in FreeBSD-devmatch
Differential Revision:	https://reviews.freebsd.org/D37192
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
f043569692 rc.d: Put devd script in FreeBSD-devd package
Differential Revision:	https://reviews.freebsd.org/D37186
2023-01-27 10:35:32 +01:00
Phil Shafer
b1cbac9ff4 Vendor import of NetBSD's mtree at 2020-12-11 2023-01-27 01:32:04 -05:00
Ed Maste
ac4c695ad6 Retire WITHOUT_CXX option
Several important base system components are written in C++, and the
WITHOUT_CXX option produced a system that was not fully functional.
Just accept this, and remove the option to build without C++ support.

This reverts commit adc3c128c6.

Reviewed by:	brooks, kevans, jhb (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33108
2023-01-26 21:13:16 -05:00
John Baldwin
9d2f979817 <sys/cdefs.h>: Decay expression passed to fallback version of __generic()
This ensures that __generic() more closely matches _Generic() when
using the fallback version when _Generic() is not available (such as
GCC).

Co-authored by:	jrtc27
Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D38215
2023-01-26 16:28:22 -08:00