HomeFreeBSD

tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS()

Description

tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS()

Protect the call with the node lock. We cannot lock the fvp vnode
sleepable there, because we already own other participating vnode's
locks. Taking it without sleeping require unwinding the whole locking
state in one more place.

Note that the liveness of the node is guaranteed by the lock on the
parent directory vnode.

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

Details

Provenance
kibAuthored on Feb 12 2023, 11:20 PM
Reviewer
markj
Differential Revision
D38557: tmpfs_rename(): fix a locking bug
Parents
rGadc3506d56d7: Extract tmpfs-specific part of tmpfs_access() into a helper
Branches
Unknown
Tags
Unknown