Page MenuHomeFreeBSD

tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts
ClosedPublic

Authored by kib on Feb 13 2023, 11:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 10, 9:20 AM
Unknown Object (File)
Sat, Feb 8, 1:59 AM
Unknown Object (File)
Wed, Feb 5, 6:59 AM
Unknown Object (File)
Wed, Feb 5, 6:56 AM
Unknown Object (File)
Wed, Feb 5, 4:27 AM
Unknown Object (File)
Sun, Feb 2, 5:13 AM
Unknown Object (File)
Mon, Jan 27, 4:59 PM
Unknown Object (File)
Jan 23 2025, 2:26 AM
Subscribers

Details

Summary
VOP_ISLOCKED() does not return bool, its only reliable use it to check
that the vnode is exclusively locked by the calling thread.  Almost all
asserts of this form repeated auto-generated assertions from
vnode_if.src for VOPs.

In two places where the assertions would be meaningful, convert them to
ASSERT_VOP_LOCKED() statements.

Diff Detail

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

Event Timeline

kib requested review of this revision.Feb 13 2023, 11:27 PM

that IFF macro should probably get gc'ed

it happens to have other uses right now though:

fs/tmpfs/tmpfs_subr.c:  MPASS(IFF(type == VLNK, target != NULL));
fs/tmpfs/tmpfs_subr.c:  MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL));
This revision is now accepted and ready to land.Feb 13 2023, 11:30 PM
This revision now requires review to proceed.Feb 13 2023, 11:50 PM
markj added inline comments.
sys/fs/tmpfs/tmpfs_vnops.c
229

The old version also asserted MPASS(error == 0 || *vpp == NULL).

This revision is now accepted and ready to land.Feb 14 2023, 2:07 PM
kib marked an inline comment as done.Feb 15 2023, 12:48 AM