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)
Sat, May 18, 6:57 AM
Unknown Object (File)
Wed, May 15, 12:42 PM
Unknown Object (File)
Mar 19 2024, 2:01 PM
Unknown Object (File)
Dec 23 2023, 10:10 AM
Unknown Object (File)
Dec 12 2023, 10:47 AM
Unknown Object (File)
Apr 20 2023, 1:35 AM
Unknown Object (File)
Apr 1 2023, 10:28 AM
Unknown Object (File)
Mar 24 2023, 2:28 PM
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