HomeFreeBSD

Add a VN_OPEN_INVFS flag.

Description

Add a VN_OPEN_INVFS flag.

vn_open_cred() assumes that it is called from the top-level of a VFS
syscall. Writers must call bwillwrite() before locking any VFS
resource to wait for cleanup of dirty buffers.

ZFS getextattr() and setextattr() VOPs do call vn_open_cred(), which
results in wait for unrelated buffers while owning ZFS vnode lock (and
ZFS does not use buffer cache). VN_OPEN_INVFS allows caller to skip
bwillwrite.

Note that ZFS is still incorrect there, because it starts write on an
mp and locks a vnode while holding another vnode lock.

Reported by: Willem Jan Withagen <wjw@digiware.nl>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on
Parents
rS355210: In nfs_lock(), recheck vp->v_data after lock before accessing it.
Branches
Unknown
Tags
Unknown