HomeFreeBSD

namei dotdot tracker: take mnt_renamelock shared to prevent parallel renames

Description

namei dotdot tracker: take mnt_renamelock shared to prevent parallel renames

For each visited dvp vnode, take the shared lock on mp->mnt_renamelock
for the lowest stacked filesystem.

This keeps the hierarchy walked by O_RELATIVE_BENEATH lookups stable.
As a consequence, we no longer need to track the dvps visited, it is
enough to remember the mount points only, and even this is needed only
to properly unlock them afterward.

Taking the lowest mp using VOP_GETWRITEMOUNT() ensures that renames on
lower fs are not allowed to break the guarantees of the
O_RELATIVE_BENEATH.

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:26 AM
Reviewer
markj
Differential Revision
D50648: mnt_renamelock
Parents
rG2ffee9aef7c2: vfs_lookup: split NDRESTART
Branches
Unknown
Tags
Unknown