<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/fs/unionfs, 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-03-05T23:46:53Z</updated>
<entry>
<title>VOP_RENAME(9): add flags argument</title>
<updated>2026-03-05T23:46:53Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2026-02-26T18:22:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e486066cf48a89ba87fab6b3d2b56f271f50439b'/>
<id>urn:sha1:e486066cf48a89ba87fab6b3d2b56f271f50439b</id>
<content type='text'>
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
</content>
</entry>
<entry>
<title>Remove the DEBUG_VFS_LOCKS kernel option</title>
<updated>2026-01-15T13:50:20Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-01-15T13:50:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9d015a916745e320aed50fc759f111fc7622e427'/>
<id>urn:sha1:9d015a916745e320aed50fc759f111fc7622e427</id>
<content type='text'>
After commit 3bd8fab2415b ("vfs: Move DEBUG_VFS_LOCKS checks to
INVARIANTS"), this option has no effect.  Let's finish the removal.

There are a couple of additional uses in zfs, I will submit a separate
patch upstream for them.

Reviewed by:	mckusick, kib
Differential Revision:	https://reviews.freebsd.org/D54662
</content>
</entry>
<entry>
<title>unionfs: Sporadic cleanup</title>
<updated>2025-12-17T22:46:04Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-12-14T23:35:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e64928611b3d157608d4fb3906b7362ab98c4ad1'/>
<id>urn:sha1:e64928611b3d157608d4fb3906b7362ab98c4ad1</id>
<content type='text'>
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
</content>
</entry>
<entry>
<title>unionfs: Support renaming symbolic links</title>
<updated>2025-12-17T22:40:59Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-12-17T22:38:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a678e87f5533521f6dec1a4e85c3decb1c3b6584'/>
<id>urn:sha1:a678e87f5533521f6dec1a4e85c3decb1c3b6584</id>
<content type='text'>
This adds support for renaming a symbolic link found on the lower fs,
which necessitates copying it to the upper fs, as well as basic tests.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	olce, siderop1_netapp.com, jah
Differential Revision:	https://reviews.freebsd.org/D54229
</content>
</entry>
<entry>
<title>unionfs: detect common deadlock-producing mount misconfigurations</title>
<updated>2025-12-12T06:32:05Z</updated>
<author>
<name>Jason A. Harmening</name>
<email>jah@FreeBSD.org</email>
</author>
<published>2025-11-29T07:53:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0247b4018de2c341ac59a585362c10044cea86ad'/>
<id>urn:sha1:0247b4018de2c341ac59a585362c10044cea86ad</id>
<content type='text'>
When creating a unionfs mount, it's fairly easy to shoot oneself
in the foot by specifying upper and lower file hierarchies that
resolve back to the same vnodes.  This is fairly easy to do if
the sameness is not obvious due to aliasing through nullfs or other
unionfs mounts (as in the associated PR), and will produce either
deadlock or failed locking assertions on any attempt to use the
resulting unionfs mount.

Leverage VOP_GETLOWVNODE() to detect the most common cases of
foot-shooting at mount time and fail the mount with EDEADLK.
This is not meant to be an exhaustive check for all possible
deadlock-producing scenarios, but it is an extremely cheap and
simple approach that, unlike previous proposed fixes, also works
in the presence of nullfs aliases.

PR:		172334
Reported by:	ngie, Karlo Miličević &lt;karlo98.m@gmail.com&gt;
Reviewed by:	kib, olce
Tested by:	pho
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53988
</content>
</entry>
<entry>
<title>unionfs: Implement VOP_GETLOWVNODE</title>
<updated>2025-12-12T06:32:05Z</updated>
<author>
<name>Jason A. Harmening</name>
<email>jah@FreeBSD.org</email>
</author>
<published>2025-11-28T07:36:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5c025978fc3649730329994eecc56ada119e6717'/>
<id>urn:sha1:5c025978fc3649730329994eecc56ada119e6717</id>
<content type='text'>
This function returns the vnode that will be used to resolve the
access type specified in the 'flags' argument, and is useful for
optimal behavior of vn_copy_file_range(). While most filesystems
can simply use the default implementation which returns the passed-
in vnode, unionfs (like nullfs) ideally should resolve the access
request to whichever base layer vnode will be used for the I/O.

For unionfs, write accesses must be resolved through the upper vnode,
while read accesses will be resolved through the upper vnode if
present or the lower vnode otherwise.  Provide a simple
unionfs_getlowvnode() implementation that reflects this policy.

Reviewed by:	kib, olce
Tested by:	pho
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53988
</content>
</entry>
<entry>
<title>unionfs: avoid vdrop()ing a locked but doomed vnode</title>
<updated>2025-10-16T15:30:34Z</updated>
<author>
<name>Jason A. Harmening</name>
<email>jah@FreeBSD.org</email>
</author>
<published>2025-10-14T19:40:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a498c5e1a111ae8c48b8e7028daff861785c2bf2'/>
<id>urn:sha1:a498c5e1a111ae8c48b8e7028daff861785c2bf2</id>
<content type='text'>
unionfs_lock() unconditionally calls vdrop() on the target vnode
after locking it, but it's possible this vnode may be doomed.
In that case, vdrop() may free the vnode, which in certain cases
requires taking the vnode lock.  Commit a7aac8c20497d added an
assert to this effect, which unionfs_lock() now trips over.

Fix this by lightly reworking the flow of unionfs_lock() so that
the target vnode is vdrop()ed after being unlocked in the case
where the unionfs lock operation needs to be restarted (which
will happen if the unionfs vnode has been doomed, which is a
prerequisite for the target vnode in the underlying filesystem
to have been doomed).

While here, get rid of a superfluous vhold/vdrop sequence in
unionfs_unlock() that was probably inherited from nullfs and whose
nullfs equivalent was recently removed.

MFC after:	1 week
Reviewed by:	kib, markj, olce
Tested by:	pho
Differential Revision: https://reviews.freebsd.org/D53107
</content>
</entry>
<entry>
<title>unionfs: fix NULL deref on closing an fd passed through SCM_RIGHTS</title>
<updated>2025-10-14T18:48:51Z</updated>
<author>
<name>Jason A. Harmening</name>
<email>jah@FreeBSD.org</email>
</author>
<published>2025-10-13T20:40:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=880d180bb21c764aec6bd5bc8c0a6b07b8c2e199'/>
<id>urn:sha1:880d180bb21c764aec6bd5bc8c0a6b07b8c2e199</id>
<content type='text'>
If the last reference to an open file is contained in an SCM_RIGHTS
message in a UNIX domain socket, and that message is discarded without
being read out by the receiver, VOP_CLOSE will ultimately be called
with ap-&gt;a_td == NULL.

Change unionfs_close() to check for this condition instead of blindly
passing the thread to unionfs_find_node_status() which will try to
dereference it.  Also add relevant asserts on the node status lookup
paths.

PR:		289700
Reported by:	asomers
Reviewed by:	asomers, olce
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D53079
</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>namei: Fix cn_flags width in various places</title>
<updated>2025-05-27T13:29:14Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-05-27T13:29:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0d224af399a66f00a5b33e5512fc018062cabf1d'/>
<id>urn:sha1:0d224af399a66f00a5b33e5512fc018062cabf1d</id>
<content type='text'>
This truncation is mostly harmless today, but fix it anyway to avoid
pain later down the road.

Reviewed by:	olce, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D50417
</content>
</entry>
</feed>
