History log of /src/sys/fs/nullfs/null_vnops.c (Results 1 – 25 of 745)
Revision Date Author Comments
# e486066c 26-Feb-2026 Konstantin Belousov <kib@FreeBSD.org>

VOP_RENAME(9): add flags argument

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55539


# 6fa205a6 08-Oct-2025 Konstantin Belousov <kib@FreeBSD.org>

nullfs: add nounixbypass mount option

The option, when set, disables bypassing the unix socket vnode down
to the lower mp, effectively preventing connection to nullfs unix
socket from being acceptab

nullfs: add nounixbypass mount option

The option, when set, disables bypassing the unix socket vnode down
to the lower mp, effectively preventing connection to nullfs unix
socket from being acceptable from the lower mp (and vice versa).

This is done by providing a vop vector that stops bypass for unp-related
VOPs. I believe that VFS_VOP_VECTOR_REGISTER() does the right thing
there regardless of the order of initialization.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52983

show more ...


# 419f2fe6 08-Oct-2025 Konstantin Belousov <kib@FreeBSD.org>

nullfs: add a helper for testing if vnode belongs to a nullfs mount

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52983


# 09f925b5 06-Oct-2025 Olivier Certner <olce@FreeBSD.org>

nullfs: Slightly reduce contention by reducing concurrent sections

In null_lock_prep_with_smr(), initialize 'lvp' outside of the
SMR-protected section.

In null_lock(), if after locking the lower vn

nullfs: Slightly reduce contention by reducing concurrent sections

In null_lock_prep_with_smr(), initialize 'lvp' outside of the
SMR-protected section.

In null_lock(), if after locking the lower vnode we notice that we have
been reclaimed, we have to unlock the lower vnode and then relock our
own now that the lock isn't shared anymore. Call VOP_UNLOCK() on the
lower vnode as soon as this condition is known.

This applies comments from D38761, one of which was missed and the other
added too late.

Reviewed by: kib
MFC with: 641a58239520 ("nullfs: avoid the interlock in null_lock with smr")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52935

show more ...


# 641a5823 01-Oct-2025 Mateusz Guzik <mjg@FreeBSD.org>

nullfs: avoid the interlock in null_lock with smr

This largely eliminates contention on the vnode interlock.

Note this still does not scale, to be fixed(tm).

Reviewed by: kib
Tested by: pho (pre

nullfs: avoid the interlock in null_lock with smr

This largely eliminates contention on the vnode interlock.

Note this still does not scale, to be fixed(tm).

Reviewed by: kib
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D38761

show more ...


# 249ec853 30-Sep-2025 Mateusz Guzik <mjg@FreeBSD.org>

nullfs: smr-protected hash lookup

Vast majority of real-world contention on the hash comes from lookups,
notably seen during highly parallel poudriere runs.

Lockless lookup largely alleviates the p

nullfs: smr-protected hash lookup

Vast majority of real-world contention on the hash comes from lookups,
notably seen during highly parallel poudriere runs.

Lockless lookup largely alleviates the problem.

Reviewed by: kib
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D38761

show more ...


# 94aae051 01-Oct-2025 Mateusz Guzik <mjg@FreeBSD.org>

nullfs: remove the vhold/vdrop cycle around unlock

Both lower vnode and null data are safe while the lock is held,
at the same time neither is touched after unlock.

While here remove stale comment

nullfs: remove the vhold/vdrop cycle around unlock

Both lower vnode and null data are safe while the lock is held,
at the same time neither is touched after unlock.

While here remove stale comment about interlock handling. It is no
longer legal to pass to unlock.

Reviewed by: kib
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D38761

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


# 08f06aa1 27-Sep-2025 Mateusz Guzik <mjg@FreeBSD.org>

vfs: retire the VCALL macro

There is precisely one place using it and even that should probably go
away.


# f1f23043 03-Jul-2025 Mark Johnston <markj@FreeBSD.org>

vfs: Initial revision of inotify

Add an implementation of inotify_init(), inotify_add_watch(),
inotify_rm_watch(), source-compatible with Linux. This provides
functionality similar to kevent(2)'s E

vfs: Initial revision of inotify

Add an implementation of inotify_init(), inotify_add_watch(),
inotify_rm_watch(), source-compatible with Linux. This provides
functionality similar to kevent(2)'s EVFILT_VNODE, i.e., it lets
applications monitor filesystem files for accesses. Compared to
inotify, however, EVFILT_VNODE has the limitation of requiring the
application to open the file to be monitored. This means that activity
on a newly created file cannot be monitored reliably, and that a file
descriptor per file in the hierarchy is required.

inotify on the other hand allows a directory and its entries to be
monitored at once. It introduces a new file descriptor type to which
"watches" can be attached; a watch is a pseudo-file descriptor
associated with a file or directory and a set of events to watch for.
When a watched vnode is accessed, a description of the event is queued
to the inotify descriptor, readable with read(2). Events for files in a
watched directory include the file name.

A watched vnode has its usecount bumped, so name cache entries
originating from a watched directory are not evicted. Name cache
entries are used to populate inotify events for files with a link in a
watched directory. In particular, if a file is accessed with, say,
read(2), an IN_ACCESS event will be generated for any watched hard link
of the file.

The inotify_add_watch_at() variant is included so that this
functionality is available in capability mode; plain inotify_add_watch()
is disallowed in capability mode.

When a file in a nullfs mount is watched, the watch is attached to the
lower vnode, such that accesses via either layer generate inotify
events.

Many thanks to Gleb Popov for testing this patch and finding lots of
bugs.

PR: 258010, 215011
Reviewed by: kib
Tested by: arrowd
MFC after: 3 months
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50315

show more ...


# 7587f6d4 23-May-2025 Mark Johnston <markj@FreeBSD.org>

namei: Make stackable filesystems check harder for jail roots

Suppose a process has its cwd pointing to a nullfs directory, where the
lower directory is also visible in the jail's filesystem namespa

namei: Make stackable filesystems check harder for jail roots

Suppose a process has its cwd pointing to a nullfs directory, where the
lower directory is also visible in the jail's filesystem namespace.
Suppose that the lower directory vnode is moved out from under the
nullfs mount. The nullfs vnode still shadows the lower vnode, and
dotdot lookups relative to that directory will instantiate new nullfs
vnodes outside of the nullfs mountpoint, effectively shadowing the lower
filesystem.

This phenomenon can be abused to escape a chroot, since the nullfs
vnodes instantiated by these dotdot lookups defeat the root vnode check
in vfs_lookup(), which uses vnode pointer equality to test for the
process root.

Fix this by extending nullfs and unionfs to perform the same check,
exploiting the fact that the passed componentname is embedded in a
nameidata structure to avoid changing the VOP_LOOKUP interface. That
is, add a flag to indicate that containerof can be used to get the full
nameidata structure, and perform the root vnode check on the lower vnode
when performing a dotdot lookup.

PR: 262180
Reviewed by: olce, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D50418

show more ...


# 89549c23 17-May-2025 Konstantin Belousov <kib@FreeBSD.org>

nullfs lookup: cn_flags is 64bit

Reviewed by: olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50390


# 5c3af1d6 09-Nov-2022 Konrad Witaszczyk <def@FreeBSD.org>

nullfs: Use an a_gen field to cast to vop_generic_args

Instead of casting a vop_F_args object to vop_generic_args, use a
vop_F_args.a_gen field when calling null_bypass(). This way we don't
hardcode

nullfs: Use an a_gen field to cast to vop_generic_args

Instead of casting a vop_F_args object to vop_generic_args, use a
vop_F_args.a_gen field when calling null_bypass(). This way we don't
hardcode the vop_generic_args data type in the callers of null_bypass().

Before this change, there were 3 null_bypass() calls using
a vop_F_args.a_gen field and 5 null_bypass() calls using a cast to
vop_generic_args. This change makes all null_bypass() calls consistent
and easier to maintain.

Pointed out by: jrtc27
Reviewed by: kib, oshogbo
Accepted by: oshogbo (mentor)
Differential Revision: https://reviews.freebsd.org/D37359

show more ...


# 326836a1 18-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

nullfs: do not allow bypass on copy_file_range()

There must be no callers of VOP_COPY_FILE_RANGE() except
vn_copy_file_range(), which does enough to find the write-vnodes where
to call the VOP.

Rev

nullfs: do not allow bypass on copy_file_range()

There must be no callers of VOP_COPY_FILE_RANGE() except
vn_copy_file_range(), which does enough to find the write-vnodes where
to call the VOP.

Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42603

show more ...


# 4cbe4c48 18-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

VFS: add VOP_GETLOWVNODE()

It is similar to VOP_GETWRITEMOUNT(), and for given vnode vp should
return the lower vnode which would actually handle write to vp.
Flags allow to specify FREAD or FWRITE

VFS: add VOP_GETLOWVNODE()

It is similar to VOP_GETWRITEMOUNT(), and for given vnode vp should
return the lower vnode which would actually handle write to vp.
Flags allow to specify FREAD or FWRITE for benefit of possible unionfs
implementation.

Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42603

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 ...


# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 4c399b04 07-Aug-2022 Gordon Bergling <gbe@FreeBSD.org>

nullfs(5): Fix a typo in a source code comment

- s/examing/examining/

MFC after: 3 days


# 7fd37611 10-Jun-2022 Konstantin Belousov <kib@FreeBSD.org>

null_vptocnp(): busy nullfs mp instead of refing it

null_nodeget() needs a valid mount point data, otherwise we might
race and dereference NULL.

Using MBF_NOWAIT makes non-forced unmount non-transp

null_vptocnp(): busy nullfs mp instead of refing it

null_nodeget() needs a valid mount point data, otherwise we might
race and dereference NULL.

Using MBF_NOWAIT makes non-forced unmount non-transparent for
vn_fullpath() over nullfs, but we make no guarantee that fullpath
calculation succeeds anyway.

Reported and tested by: pho
Reviewed by: jah
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D35477

show more ...


# 4eaf9609 24-Jul-2021 Konstantin Belousov <kib@FreeBSD.org>

nullfs: provide custom null_rename bypass

fdvp and fvp vnodes are not locked, and race with reclaim cannot be handled
by the generic bypass routine.

Reported and tested by: pho
Reviewed by: markj
S

nullfs: provide custom null_rename bypass

fdvp and fvp vnodes are not locked, and race with reclaim cannot be handled
by the generic bypass routine.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31310

show more ...


# 26e72728 24-Jul-2021 Konstantin Belousov <kib@FreeBSD.org>

null_rename: some style

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31310


# 4f21442e 21-Jul-2021 Konstantin Belousov <kib@FreeBSD.org>

null_lookup: restore dvp lock always, not only on success

Caller of VOP_LOOKUP() passes dvp locked and expect it locked on return.
Relock of lower vnode in any case could leave upper vnode reclaimed

null_lookup: restore dvp lock always, not only on success

Caller of VOP_LOOKUP() passes dvp locked and expect it locked on return.
Relock of lower vnode in any case could leave upper vnode reclaimed and
unlocked.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31310

show more ...


# d5b07816 20-Jul-2021 Konstantin Belousov <kib@FreeBSD.org>

null_bypass(): prevent loosing the only reference to the lower vnode

The upper vnode reference to the lower vnode is the only reference that
keeps our pointer to the lower vnode alive. If lower vnod

null_bypass(): prevent loosing the only reference to the lower vnode

The upper vnode reference to the lower vnode is the only reference that
keeps our pointer to the lower vnode alive. If lower vnode is relocked
during the VOP call, upper vnode might become unlocked and reclaimed,
which invalidates our reference.

Add a transient vhold around VOP call.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31310

show more ...


# 161e9a97 17-Jul-2021 Konstantin Belousov <kib@FreeBSD.org>

nullfs: provide custom null_advlock bypass

The advlock VOP takes the vnode unlocked, which makes the normal bypass
function racy. Same as null_pgcache_read(), nullfs implementation needs
to take in

nullfs: provide custom null_advlock bypass

The advlock VOP takes the vnode unlocked, which makes the normal bypass
function racy. Same as null_pgcache_read(), nullfs implementation needs
to take interlock and reference lower vnode under it.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31310

show more ...


12345678910>>...30