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)
Sep 26 2024, 5:48 PM
Unknown Object (File)
Sep 19 2024, 2:49 PM
Unknown Object (File)
Sep 2 2024, 8:32 AM
Unknown Object (File)
Aug 31 2024, 10:12 PM
Unknown Object (File)
Aug 30 2024, 3:06 PM
Unknown Object (File)
Aug 28 2024, 11:29 PM
Unknown Object (File)
Aug 19 2024, 12:57 AM
Unknown Object (File)
Aug 16 2024, 6:54 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 Skipped
Unit
Tests Skipped

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
228

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