realpath: Improve prev_len logic
* Save prev_len after having checked for and appended a trailing slash,
not before. This requires us to back up if we end up returning a
partial result, but previously we would sometimes return a partial
result with a trailing slash and sometimes without.
* Replace strlcat() with a faster strlcpy() since we know exactly how
far into the buffer we are.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55914
realpath: Improve manual page
* Try to make the RETURN VALUES section flow better.
* Add basename(3), dirname(3), free(3) to the SEE ALSO section.
* Drop the CAVEATS section, which was obsolete the moment realpath(3)
was added to the Single Unix Specification in 1994.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55928
NAS-140288 / 25.10.2.2 / During failover avoid remote calls for FC port wiring (by bmeagherix) (#18503)
- Skip `ensure_wired` during failover
`fcport.query` was triggering `ensure_wired` -> `wire()` ->
`failover.call_remote` inside the `become_active` window.
- Guard `reset_wired` remote calls when peer is unavailable
Original PR: https://github.com/truenas/middleware/pull/18502
---------
Co-authored-by: Brian M <brian.meagher at ixsystems.com>
NAS-140288 / 26.0.0-BETA.2 / During failover avoid remote calls for FC port wiring (by bmeagherix) (#18504)
- Skip `ensure_wired` during failover
`fcport.query` was triggering `ensure_wired` -> `wire()` ->
`failover.call_remote` inside the `become_active` window.
- Guard `reset_wired` remote calls when peer is unavailable
Original PR: https://github.com/truenas/middleware/pull/18502
---------
Co-authored-by: Brian M <brian.meagher at ixsystems.com>
[compiler-rt] Unify python shebangs (#187285)
As per PEP-0394[1], there is no real concensus over what binary names
Python has, specifically 'python' could be Python 3, Python 2, or not
exist.
However, everyone has a python3 interpreter and the scripts are all
written for Python 3. Unify the shebangs so that the ~50% of shebangs
that use python now use python3.
[1] https://peps.python.org/pep-0394/
Delete error-check code that can never happen.
Near the top of kern_mmap() that implements the mmap(2) system call,
it sets
prot = PROT_EXTRACT(prot);
with
So prot can only be the three PROT_ flags.
The following test of the user's mmap(2) parameters (near line 275
in vm/vm_mmap.c):
if (prot != PROT_NONE &&
(prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) {
return (EXTERROR(EINVAL, "invalid prot %#jx", prot));
}
[7 lines not shown]