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
AMDGPU/GlobalISel: Switch more FP opcodes to extended LLTs (part 6) (#214031)
Migrate G_LROUND, G_LLROUND, G_INTRINSIC_LRINT, G_INTRINSIC_LLRINT,
G_FCOPYSIGN, and G_ATOMICRMW_FADD to extended LLTs.
Update the relevant MIR tests.
[libc++][pstl] Implementation of parallel std::destroy() and std::destroy_n() (#211888)
This PR adds an implementation of parallel versions of `std::destroy`
and `std::destroy_n`. The implementations are based on `for_each` and
`for_each_n`, effectively one-liners
Fixes #134588.
Fixes #134589.
Fixes #101693.
OS-8759 SmartOS installation needs to pull newer bootstrap tar
Reviewed by: Jonathan Perkin <jperkin at edgecast.io>
Reviewed by: Nahum Shalman <nshalman at edgecast.io>
Approved by: Nahum Shalman <nshalman at edgecast.io>
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)
inotify: Ensure that "allocfail" is initialized in inotify_log_one()
Fixes: b70997c8c75a ("inotify: Unconditionally generate IN_IGNORED events for files/dirs")
(cherry picked from commit f370bf9fafce82851bedb2b88bc21ec6ca0182df)
inotify: Avoid calling vrele() with a namecache mutex held
In cache_vop_inotify(), we call inotify_log() with a namecache hash lock
held. inotify_log() looks at all watches registered with the vnode to
see if any of them are interested in the event. In some cases, we have
to detach and free the watch after logging the event. This means we
must vrele() the watched vnode, and this must not be done while a
non-sleepable lock held.
Previously, I deferred the vrele() to until the inotify softc and vnode
pollinfo locks were dropped. However, this is not enough since we may
still be holding the aforementioned namecache lock. Go further and use
a taskqueue thread to release vnode references. Introduce a set of
detached watches, and queue a threaded task which releases the vnode
reference.
Reported by: syzbot+c128f121cb22df95559b at syzkaller.appspotmail.com
Reviewed by: kib
Fixes: f1f230439fa4 ("vfs: Initial revision of inotify")
[3 lines not shown]
linux: Add inotify support
Implement the Linux inotify system calls using the native implementation
in vfs_inotify.c.
PR: 240874
Reviewed by: brooks
MFC after: 3 months
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50761
(cherry picked from commit 3965de642c29d831649c8307203303de560d721a)
Remove inotify example code when MK_EXAMPLES == no
This change adds the needed entries to OLD_DIRS and OLD_FILES to ensure
that the paths are properly cleaned up when `make delete-old` is run and
MK_EXAMPLES == no.
MFC after: 2 months
Fixes: 1d8664d69041 ("examples: Add a demo program for inotify")
Differential Revision: https://reviews.freebsd.org/D51934
(cherry picked from commit 19c8cc3162aca9fde56581caee743d68d322c909)
kdump: Add support for decoding inotify events
These are emitted when reading from an inotify descriptor.
MFC after: 3 months
Sponsored by: Klara, Inc.
(cherry picked from commit e02d4fab54539a5d127c12e9e9f8b0ddd2a1cafa)