<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/fs/devfs, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-02T19:48:25Z</updated>
<entry>
<title>devfs: unlock the directory vnode around the call to dev_clone handler</title>
<updated>2026-02-02T19:48:25Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2026-01-26T01:49:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a8e92198f854c2766eedec5a2ea3cc23c64d7b12'/>
<id>urn:sha1:a8e92198f854c2766eedec5a2ea3cc23c64d7b12</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>devfs: make destroy_dev() a release barrier for cdevpriv destructors runs</title>
<updated>2025-10-24T16:09:25Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2025-10-23T18:37:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4dbe6628179d8e6bf400bfdb4bfa869bdc102a56'/>
<id>urn:sha1:4dbe6628179d8e6bf400bfdb4bfa869bdc102a56</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>style(9): white space after ; and around binary operators</title>
<updated>2025-10-16T22:02:50Z</updated>
<author>
<name>David E. O'Brien</name>
<email>obrien@FreeBSD.org</email>
</author>
<published>2025-10-15T05:22:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0050289464fa56ec79e060b8d8378b9ff7145a0e'/>
<id>urn:sha1:0050289464fa56ec79e060b8d8378b9ff7145a0e</id>
<content type='text'>
in for() loops.  Also, use 'while', where only the
conditional test of 'for' was used.

Reviewed by: sjg
</content>
</entry>
<entry>
<title>vfs: retire the VREF macro</title>
<updated>2025-09-27T04:00:59Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2025-09-27T02:13:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7e4c451c12aeb26cc1179221b8230c491b17cf00'/>
<id>urn:sha1:7e4c451c12aeb26cc1179221b8230c491b17cf00</id>
<content type='text'>
It is defined as a plain use of vref.

Churn generated with coccinelle:
@@
expression vp;
@@

- VREF(vp)
+ vref(vp)
</content>
</entry>
<entry>
<title>vfs: retire the NULLVP macro</title>
<updated>2025-09-27T04:00:59Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2025-09-27T02:07:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=01c8e2e33df81b242d73a23de49a6b61f33c24c1'/>
<id>urn:sha1:01c8e2e33df81b242d73a23de49a6b61f33c24c1</id>
<content type='text'>
The kernel was already mostly using plain NULL, just whack it and be
doen with the legacy.

Churn generated with coccinelle:
@@
@@

- NULLVP
+ NULL
</content>
</entry>
<entry>
<title>devfs readdir: handle short buffer same as UFS</title>
<updated>2025-08-01T16:48:53Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2025-08-01T08:22:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=011efaa5cd246a67bbe6e37364baa18178a9f7bd'/>
<id>urn:sha1:011efaa5cd246a67bbe6e37364baa18178a9f7bd</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>devfs: Set eofflag in devfs_readdir()</title>
<updated>2025-05-29T18:25:56Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-05-29T18:25:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=198d2ed2d4c6c921928a9175f825d0d8345e5a46'/>
<id>urn:sha1:198d2ed2d4c6c921928a9175f825d0d8345e5a46</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>sysctl(9): Ease exporting struct sizes; Discourage doing that</title>
<updated>2025-05-07T10:13:40Z</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2025-05-01T16:02:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=713abc9880aabe0ff924ff644bceb6ff404ed3cd'/>
<id>urn:sha1:713abc9880aabe0ff924ff644bceb6ff404ed3cd</id>
<content type='text'>
Introduce two helpers, the more general SYSCTL_SIZEOF() and
a struct-specific one SYSCTL_SIZEOF_STRUCT() which prepends 'struct' in
the description and in the use of sizeof() but uses the raw structure
name as the knob's name.  The size of the object/structure is exported
under 'debug.sizeof'.

Existing knobs under 'debug.sizeof' were all converted to use the
helpers.

Add a note before the helpers discouraging the introduction of new
leaves for ad-hoc reasons.  List alternative means for developers to
obtain the size of arbitrary kernel structures easily (thanks to markj@
for providing these).

No functional change (intended).

Reviewed by:    kib, markj
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D50121
</content>
</entry>
<entry>
<title>devfs: Return early from sysctl_devname() if no input is given</title>
<updated>2025-03-20T01:34:10Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-03-20T01:34:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=48d6b52add36cc09e7fb1fbec44ab66c0742f320'/>
<id>urn:sha1:48d6b52add36cc09e7fb1fbec44ab66c0742f320</id>
<content type='text'>
Otherwise we end up searching for a device using an uninitialized key,
tripping up KMSAN.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>kern: Make fileops and filterops tables const where possible</title>
<updated>2024-11-26T21:04:21Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-11-25T22:39:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ef9ffb8594eee294334ced627755bf5b46b48f9f'/>
<id>urn:sha1:ef9ffb8594eee294334ced627755bf5b46b48f9f</id>
<content type='text'>
No functional change intended.

MFC after:	1 week
</content>
</entry>
</feed>
