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)
Wed, May 6, 9:38 PM
Unknown Object (File)
Mon, May 4, 10:16 PM
Unknown Object (File)
Fri, May 1, 9:58 AM
Unknown Object (File)
Wed, Apr 29, 6:24 AM
Unknown Object (File)
Wed, Apr 29, 6:17 AM
Unknown Object (File)
Tue, Apr 28, 7:42 PM
Unknown Object (File)
Tue, Apr 28, 7:32 PM
Unknown Object (File)
Sat, Apr 25, 8:25 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