HomeFreeBSD

VOP_RENAME: add mp-global lock

Description

VOP_RENAME: add mp-global lock

It is before all vnode locks, but after vn_start_write().

The lock prevents parallel rename operations on the same mount point,
which should in (near future) simplify a lot of code in VFS/fs that
otherwise need to code with either the changing hierarchy, or with the
lock order for vnodes due to changed hierarchy.

On renames, the lock is taken on the lowest stacked filesystem.
Otherwise rename could still occur in parallel, by performing one of op
on the lower fs.

Proposed by: mjg (long time ago)
Reviewed by: markj, olce
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50648

Details

Provenance
kibAuthored on Jun 2 2025, 7:05 AM
Reviewer
markj
Differential Revision
D50648: mnt_renamelock
Parents
rGf9cf745a5084: RELNOTES: Document the addition of inotify
Branches
Unknown
Tags
Unknown