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)
Sun, Apr 7, 9:47 PM
Unknown Object (File)
Feb 19 2024, 10:10 PM
Unknown Object (File)
Feb 10 2024, 9:38 PM
Unknown Object (File)
Jan 14 2024, 10:56 AM
Unknown Object (File)
Dec 13 2023, 7:14 AM
Unknown Object (File)
Nov 17 2023, 4:14 PM
Unknown Object (File)
Sep 13 2023, 10:38 PM
Unknown Object (File)
Aug 29 2023, 6:18 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