| #
a8e92198
|
| 26-Jan-2026 |
Konstantin Belousov <kib@FreeBSD.org> |
devfs: unlock the directory vnode around the call to dev_clone handler
The lock around dev_clone is unfortunate because cloner might need to take its own locks that establish the order with devfs vn
devfs: unlock the directory vnode around the call to dev_clone handler
The lock around dev_clone is unfortunate because cloner might need to take its own locks that establish the order with devfs vnodes, and then transiently participates in further VFS locks order. For instance, this way the proctree_lock or allproc_lock become involved.
Unlock dvp, we can unwind if the vnode become doomed while cloner was called.
Reported and tested by: pho Reviewed by: kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55028
show more ...
|
| #
4dbe6628
|
| 23-Oct-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
devfs: make destroy_dev() a release barrier for cdevpriv destructors runs
Ensure that all destructors for cdevpriv finished running before destroy_dev() returns to the caller. Otherwise, since devf
devfs: make destroy_dev() a release barrier for cdevpriv destructors runs
Ensure that all destructors for cdevpriv finished running before destroy_dev() returns to the caller. Otherwise, since devfs_destroy_cdevpriv() removes the cdevpriv data from the list, drops the cdevpriv_mtx, and then starts the destructor, it is possible for destroy_dev() to return before destructor finished in other thread.
This should allow drivers to safely remove cdev instance data that might be referenced by cdevpriv data.
Diagnosed by: kevans Reviewed by: kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53303
show more ...
|
| #
7e4c451c
|
| 27-Sep-2025 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: retire the VREF macro
It is defined as a plain use of vref.
Churn generated with coccinelle: @@ expression vp; @@
- VREF(vp) + vref(vp)
|
| #
01c8e2e3
|
| 27-Sep-2025 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: retire the NULLVP macro
The kernel was already mostly using plain NULL, just whack it and be doen with the legacy.
Churn generated with coccinelle: @@ @@
- NULLVP + NULL
|
| #
011efaa5
|
| 01-Aug-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
devfs readdir: handle short buffer same as UFS
Return EINVAL if this is the first dirent encountered with the short buffer, or EJUSTRETURN if something was already copied out.
This is needed to pas
devfs readdir: handle short buffer same as UFS
Return EINVAL if this is the first dirent encountered with the short buffer, or EJUSTRETURN if something was already copied out.
This is needed to pass eof check in vop_readdir_post(): we are not at eof but resid was not advanced.
Reported and tested by: pho (previous version) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51667
show more ...
|
| #
198d2ed2
|
| 29-May-2025 |
Mark Johnston <markj@FreeBSD.org> |
devfs: Set eofflag in devfs_readdir()
At least vn_dir_next_dirent() checks that eofflag is set appropriately when INVARIANTS is enabled, so the omission here could cause an assertion failure.
Revie
devfs: Set eofflag in devfs_readdir()
At least vn_dir_next_dirent() checks that eofflag is set appropriately when INVARIANTS is enabled, so the omission here could cause an assertion failure.
Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50598
show more ...
|
| #
ef9ffb85
|
| 25-Nov-2024 |
Mark Johnston <markj@FreeBSD.org> |
kern: Make fileops and filterops tables const where possible
No functional change intended.
MFC after: 1 week
|
| #
6d79564f
|
| 07-May-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
devfs_allocv(): style
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
| #
d3efbe01
|
| 22-Mar-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
cdevpriv(9): add iterator
Reviewed by: christos Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44469
|
| #
5c41d888
|
| 19-Jan-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
kcmp(2): implement for devfs files
Compare not vnodes, which are different between mount points, but actual cdev referenced by the devfs node.
Reviewed by: brooks, markj Sponsored by: The FreeBSD
kcmp(2): implement for devfs files
Compare not vnodes, which are different between mount points, but actual cdev referenced by the devfs node.
Reviewed by: brooks, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43518
show more ...
|
| #
29363fb4
|
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
| #
67864268
|
| 19-Sep-2023 |
Jason A. Harmening <jah@FreeBSD.org> |
devfs: add integrity asserts for cdevp_list
It's possible for misuse of cdev KPIs or for bugs in devfs itself to result in e.g. a cdev object's container being freed while still on the global list u
devfs: add integrity asserts for cdevp_list
It's possible for misuse of cdev KPIs or for bugs in devfs itself to result in e.g. a cdev object's container being freed while still on the global list used to populate each devfs mount; see PR 273418 for a recent example.
Since a node may be marked inactive well before it is reaped from the list, add a new flag solely to track list membership, and employ it in some basic list integrity assertions to catch bad actors.
Discussed with: kib, mjg MFC after: 1 week
show more ...
|
| #
95ee2897
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| #
4d846d26
|
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
| #
829f0bcb
|
| 19-Dec-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: add the concept of vnode state transitions
To quote from a comment above vput_final: <quote> * XXX Some filesystems pass in an exclusively locked vnode and strongly depend * on the lock being h
vfs: add the concept of vnode state transitions
To quote from a comment above vput_final: <quote> * XXX Some filesystems pass in an exclusively locked vnode and strongly depend * on the lock being held all the way until VOP_INACTIVE. This in particular * happens with UFS which adds half-constructed vnodes to the hash, where they * can be found by other code. </quote>
As is there is no mechanism which allows filesystems to denote that a vnode is fully initialized, consequently problems like the above are only found the hard way(tm).
Add rudimentary support for state transitions, which in particular allow to assert the vnode is not legally unlocked until its fate is decided (either construction finishes or vgone is called to abort it).
The new field lands in a 1-byte hole, thus it does not grow the struct.
Bump __FreeBSD_version to 1400077
Reviewed by: kib (previous version) Tested by: pho Differential Revision: https://reviews.freebsd.org/D37759
show more ...
|
| #
5b5b7e2c
|
| 17-Sep-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: always retain path buffer after lookup
This removes some of the complexity needed to maintain HASBUF and allows for removing injecting SAVENAME by filesystems.
Reviewed by: kib (previous versi
vfs: always retain path buffer after lookup
This removes some of the complexity needed to maintain HASBUF and allows for removing injecting SAVENAME by filesystems.
Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D36542
show more ...
|
| #
497240de
|
| 19-Aug-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
Retire clone_drain_lock
It is only ever xlocked in drain_dev_clone_events and the only consumer of that routine does not need it -- eventhandler code already makes sure the relevant callback is no l
Retire clone_drain_lock
It is only ever xlocked in drain_dev_clone_events and the only consumer of that routine does not need it -- eventhandler code already makes sure the relevant callback is no longer running.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D36268
show more ...
|
| #
8ea3ceda
|
| 06-Feb-2022 |
Gordon Bergling <gbe@FreeBSD.org> |
fs: fix a few common typos in source code comments
- s/quadradically/quadratically/ - s/persistant/persistent/
Obtained from: NetBSD MFC after: 3 days
|
| #
66c5fbca
|
| 28-Jan-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
insmntque1(): remove useless arguments
Also remove once-used functions to clean up after failed insmntque1(), which were destructor callbacks in previous life.
Reviewed by: markj Tested by: pho Spo
insmntque1(): remove useless arguments
Also remove once-used functions to clean up after failed insmntque1(), which were destructor callbacks in previous life.
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D34071
show more ...
|
| #
2a7e4cf8
|
| 27-Jan-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
Revert b58ca5df0bb7 ("vfs: remove the now unused insmntque1")
I was somehow convinced that insmntque calls insmntque1 with a NULL destructor. Unfortunately this worked well enough to not immediately
Revert b58ca5df0bb7 ("vfs: remove the now unused insmntque1")
I was somehow convinced that insmntque calls insmntque1 with a NULL destructor. Unfortunately this worked well enough to not immediately blow up in simple testing.
Keep not using the destructor in previously patched filesystems though as it avoids unnecessary casts.
Noted by: kib Reported by: pho
show more ...
|
| #
3af3e99c
|
| 26-Jan-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
devfs: stop using insmntque1
It adds nothing of value over insmntque.
|
| #
3ffcfa59
|
| 26-Nov-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: add vop_stdadd_writecount_nomsync
This avoids needing to inspect the mount point every time.
Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D33125
|
| #
2b68eb8e
|
| 01-Oct-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: remove thread argument from VOP_STAT
and fo_stat.
|
| #
b4a58fbf
|
| 01-Oct-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: remove cn_thread
It is always curthread.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D32453
|
| #
243b324f
|
| 03-May-2021 |
Mark Johnston <markj@FreeBSD.org> |
devfs: Avoid comparison with an uninitialized var in devfs_fp_check()
devvn_refthread() will initialize *devp only if it succeeds, so check for success before comparing with fp->f_data. Other devvn
devfs: Avoid comparison with an uninitialized var in devfs_fp_check()
devvn_refthread() will initialize *devp only if it succeeds, so check for success before comparing with fp->f_data. Other devvn_refthread() callers are careful to do this.
Reported by: KMSAN Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30068
show more ...
|