Page MenuHomeFreeBSD

lockf: Do not block in vfs_busy()
ClosedPublic

Authored by markj on Thu, Sep 24, 1:51 PM.
Tags
None
Referenced Files
F175059002: D59982.id.diff
Wed, Oct 7, 11:32 PM
F174951290: D59982.diff
Wed, Oct 7, 3:58 AM
Unknown Object (File)
Tue, Oct 6, 8:35 AM
Unknown Object (File)
Mon, Oct 5, 7:04 PM
Unknown Object (File)
Sun, Oct 4, 7:06 PM
Unknown Object (File)
Fri, Oct 2, 4:56 AM
Unknown Object (File)
Thu, Oct 1, 8:19 PM
Unknown Object (File)
Thu, Oct 1, 2:48 PM
Subscribers

Details

Summary

I believe a race is possible otherwise: vfs_busy() may return after an
unmounted filesystem has been removed from the global mount list.
That is, vfs_busy() will block until vfs_mount_destroy() sets
MNTK_REFEXPIRE, and at that point the mountpoint has been removed from
the mountlist, so TAILQ_FOREACH can return an invalid value.

Simply do not block if the mountpoint is being unmounted.

Fixes: eca39864f702 ("Add sysctl KERN_LOCKF")

Diff Detail

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