Page MenuHomeFreeBSD

VOP_CLOSE(): MNTK_EXTENDED_SHARED filesystems do not need excl lock
ClosedPublic

Authored by kib on Apr 24 2023, 10:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 3, 10:20 AM
Unknown Object (File)
Sep 9 2024, 9:47 PM
Unknown Object (File)
May 19 2024, 10:12 AM
Unknown Object (File)
May 16 2024, 2:41 PM
Unknown Object (File)
May 14 2024, 4:24 AM
Unknown Object (File)
May 13 2024, 7:08 PM
Unknown Object (File)
May 13 2024, 7:08 PM
Unknown Object (File)
May 13 2024, 6:15 PM
Subscribers

Details

Summary
All in-tree implementations of VOP_CLOSE() for filesystems proclaiming
MNTK_EXTENDED_SHARED, are fine with the shared lock for the closed
vnode.  I checked the following implementations:
        ffs
        ext2
        ufs
        null
        tmpfs
        devfs
        fdescfs
        cd9660
        zfs
It seems that initial addition of FWRITE check was due to necessity of
handling the VV_TEXT vnode vflag.  Since VOP_ADD_WRITECOUNT() only
requires shared lock, we can relax the locking requirement there.

Diff Detail

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

Event Timeline

kib requested review of this revision.Apr 24 2023, 10:50 PM
kib added reviewers: jhb, markj.
kib added a subscriber: olce.
This revision is now accepted and ready to land.Apr 25 2023, 1:16 PM

FWIW, I've checked these filesystems as well and I concur. I've also tested the patch with a parallel buildkernel and several find processes repeatedly cating files in /usr/obj without problems.