style.Makefile.5: Remove title macros, tag SPDX
Title macros are discouraged in mdoc(7) because they are not portable.
While here, remove a redundant "file". File is still in the title twice.
MFC after: 3 days
(cherry picked from commit 8f480d0075263ff354212ce0558ee811ce62ff09)
nvmecontrol.8: Explain non-operational power modes
`nvmecontrol power -l ...` lists the available power modes.
Non-operational modes are marked with an asterisk. While here,
add <device-id | namespace-id> to the "nvmecontrol power" synopsis.
MFC after: 3 days
Reviewed by: dab, imp, michaelo, ziaee
Differential Revision: https://reviews.freebsd.org/D58480
(cherry picked from commit 868158f7fd2a172ef22f1b6b682cc1d38e54cf63)
ctfmerge.1: Fix uniqlabel typos
The flag is -D, but it was written as a second -d. Add a period too.
MFC after: 3 days
(cherry picked from commit 4f293e32e4529617dd05bd64fd3c22a57a56a355)
ctfmerge.1: Import ENVIRONMENT from NetBSD
Import the ENVIRONMENT section from NetBSD, minus the variable that our
ctfmerge does not have. Alphabetize them, polish grammar and alignment,
and add the variables to the man database. While here, remove whitespace
from the end of some lines to quiet linter.
MFC after: 3 days
PR: 291186
Co-authored-by: Alexander Ziaee <ziaee at FreeBSD.org>
Obtained from: NetBSD (christos <christos at NetBSD.org>, 8a0c0d8)
Differential Revision: https://reviews.freebsd.org/D54054
(cherry picked from commit 32cf24b725fdf899fb642c47004b69fcfae9b9db)
padlock.4: Update slightly for 64-bit hardware
- Change the document description to "Via and Zhaoxin CPU crypto driver"
- Add a HARDWARE section mentioning these in the hardware release note
This manual still needs desperate help, but just this little bit could
have saved a lot of confusion. I'd write more if I had information.
PR: 295517
Fixes: 14b8531c4ccb8 (Restore padlock_rng the the amd64 build)
MFC after: 3 days (to 15 only)
Reviewed by: bcr, asomers
Differential Revision: https://reviews.freebsd.org/D57920
(cherry picked from commit 380c6f59c4f87dbc45a67983d927700ca7e22be2)
rtadvd(8): Fix RA flag inconsistency messages
During flag inconsistency report, we handle rai->rai_otherflg
as a bool, but the value is 0x40. Make it a simple number comparison.
PR: 295995
Reviewed by: markj, Faraz Vahedi <kfv at kfv.io>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D58672
inotify: Fix a couple of locking bugs
When hooking vop_rename_post(), the preexisting dst vnode will be
unlocked. But, we need to invoke VOP_GETATTR on it in vn_inotify() to
check its link count.
In inotify_unlink_watch_locked(), the vnode interlock is not held, so
don't use vn_irflag_unset_locked().
Reviewed by: kib
Fixes: f1f230439fa4 ("vfs: Initial revision of inotify")
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51401
(cherry picked from commit af0ec3fa29cad823d0196538381f1e832f5974a7)
nullfs: Clear inotify flags during reclaim
The inotify flags are copied from the lower vnode into the nullfs vnode
so that the INOTIFY() macro will invoke VOP_INOTIFY on the nullfs vnode;
this is then bypassed to the lower vnode. However, when a nullfs vnode
is reclaimed we should clear these flags, as the vnode is now doomed and
no longer forwards VOPs to the lower vnode.
Add regression tests. Remove a test in vn_inotify_revoke() which is no
longer needed after this change.
PR: 292495
Reviewed by: kib
Reported by: Jed Laundry <jlaundry at jlaundry.com>
Fixes: f1f230439fa4 ("vfs: Initial revision of inotify")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56639
(cherry picked from commit a02d794f5acd12ba3cf1de5c204a8dd56af47edd)
inotify: Unconditionally generate IN_IGNORED events for files/dirs
The implementation previously only generated an IN_IGNORED event for a
deleted watched file if the watch explicitly requested IN_DELETE_SELF.
This is not correct, IN_IGNORED should always be raised when the watched
subject is deleted. Adjust the implementation of inotify_log_one()
accordingly.
This also fixes a problem where a deleted watched file's watch
would not be removed if IN_DELETE_SELF was not in the watch's event
mask, in which case the unlinked vnode would linger until the inotify
descriptor itself is closed.
Add a regression test.
Reported by: jrtc27
Reviewed by: jrtc27
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58050
[2 lines not shown]
nullfs: close a race when syncing inotify flags from the lower vnode
After a bypassed VOP, nullfs mirrors the lower vnode's inotify state
onto the upper vnode. The flags were checked with lockless reads
before being updated with the asserting flag set/unset primitives, so
two threads syncing the same vnode concurrently (or a sync racing a
watch being established) could both decide to make the same change;
the loser then trips the "flags already set" assertion on an
INVARIANTS kernel. On other kernels the race is harmless.
Keep the lockless check as the fast path, but re-make the decision
under the vnode interlock before actually changing the flags.
Reproduced in a 4-CPU VM with one thread cycling an inotify watch on
a lower-filesystem file while several threads stat(2) the same file
through a nullfs mount: the unpatched INVARIANTS kernel panics under
this load, the patched kernel runs it to completion.
Fixes: f1f230439fa4 ("vfs: Initial revision of inotify")
[6 lines not shown]
inotify: Work around the vput() bug directly
For 15.0, apply a minimal fix which at least ensures that inotify can't
trigger the latent race described in commit 99cb3dca4773 ("vnode: Rework
vput() to avoid holding the vnode lock after decrementing").
Reviewed by: olce, kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53774
(cherry picked from commit ebc17879f0885ca87644980f6275b9759b311eb3)
inotify: Use memcmp() to compare embedded file names
Otherwise gcc warns that strcmp() will read a byte from a zero-length
array, though in practice we exclude that case with an explicit length
check.
Fixes: f1f230439fa4 ("vfs: Initial revision of inotify")
(cherry picked from commit bc6b526e2b71cf7e07806db5bc77926ed5c874f7)
inotify: Avoid resetting the cookie
The IN_MOVED_FROM and _TO events only apply to names in a watched
directory, never to a watched directory itself. So, the cookie value
there is always zero, and in particular we should not reset the
caller-provided cookie value, as it may be used later.
Add a regression test.
Reported by: arrowd
MFC after: 1 week
(cherry picked from commit da8ab13249420e85935b89794f333f0755e56385)