Page MenuHomeFreeBSD

Several fixes for nullfs and fifofs
ClosedPublic

Authored by kib on Jul 26 2021, 5:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 10:19 AM
Unknown Object (File)
Sep 30 2024, 5:25 PM
Unknown Object (File)
Sep 28 2024, 5:16 AM
Unknown Object (File)
Sep 28 2024, 3:17 AM
Unknown Object (File)
Sep 9 2024, 3:20 PM
Unknown Object (File)
Sep 8 2024, 3:53 PM
Unknown Object (File)
Sep 5 2024, 8:33 AM
Unknown Object (File)
Aug 21 2024, 9:25 PM
Subscribers

Details

Summary

Nullfs: tolerate relocking of the lower vnode. We need to acquire additional hold reference on the lower vnode, otherwise is lower is relocked and upper is reclaimed, the only reference to lower is invalidated and lowervp is potentially dandling pointer.

Nullfs: provide custom bypass methods for several VOPs which take unlocked vnode. Default bypass cannot handle reclamation. Relevant for VOP_ADVLOCK, VOP_RENAME at least.

Nullfs: re-lock dvp in null_lookup() always, not only on success. Lower lookup might have relocked lowerdvp, which makes upper vp loosing its lock.

Nullfs: style fixes

Fifofs: handle race with relocking in open. It is possible that open relocks fifofs vnode after instantiation but before VOP_OPEN() is called. In this case reclaim/fifo_close() would legitimately see NULL v_fifoinfo.

Reported and tested by: pho

Per commit view is avaiable at https://kib.kiev.ua/git/gitweb.cgi?p=deviant3.git;a=shortlog;h=refs/heads/nullfs

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jul 26 2021, 5:11 PM
kib created this revision.
kib edited the summary of this revision. (Show Details)
kib added a reviewer: markj.
sys/fs/nullfs/null_vnops.c
255
340
665

How do we know that tdnn and tnn are not NULL?

kib marked 3 inline comments as done.Jul 27 2021, 2:27 PM
kib added inline comments.
sys/fs/nullfs/null_vnops.c
665

tdvp and (optional) tvp are locked on VOP entry, and we checked that there is no cross-mount rename at the start of the VOP. Since vnodes are locked (and not doomed), their lower vnodes must be alive.

This revision is now accepted and ready to land.Jul 27 2021, 2:51 PM