Page MenuHomeFreeBSD

Allow vdrop() of a vnode not yet on the per-mount list after r306512.
ClosedPublic

Authored by bdrewery on Aug 25 2017, 11:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 11 2024, 10:20 PM
Unknown Object (File)
Jan 10 2024, 7:36 PM
Unknown Object (File)
Sep 13 2023, 2:14 AM
Unknown Object (File)
Jun 15 2023, 6:44 PM
Unknown Object (File)
Jun 3 2023, 1:34 AM
Unknown Object (File)
Apr 18 2023, 7:32 PM
Unknown Object (File)
Feb 9 2023, 5:12 AM
Unknown Object (File)
Jan 30 2023, 1:22 AM
Subscribers
None

Details

Summary

The old code allowed calling vdrop() before insmntque() to place the vnode back
onto the freelist for later recycling. Some downstream consumers may rely on
this support. Normally insmntque() failing is fine since is uses vgone() and
immediately frees the vnode rather than attempting to add it to the freelist if
vdrop() were used instead.

Also assert that vhold() cannot be used on such a vnode.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Aug 26 2017, 12:07 AM
markj added inline comments.
sys/kern/vfs_subr.c
2865 ↗(On Diff #32401)

It would be nice to include the vnode pointer in the assertion message. It's often a bit difficult to locate stack variables after a KASSERT panic.

2959 ↗(On Diff #32401)

Same comment as above.

sys/kern/vfs_subr.c
2865 ↗(On Diff #32401)

VNASSERT uses vn_printf which includes the vp pointer.

This revision was automatically updated to reflect the committed changes.