Page MenuHomeFreeBSD

vfs_mount.c: Don't call VFS_MOUNT() if only exports are being updated
ClosedPublic

Authored by rmacklem on Tue, Feb 17, 12:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 18, 1:30 AM
Unknown Object (File)
Tue, Feb 17, 11:13 PM
Unknown Object (File)
Tue, Feb 17, 9:29 PM
Unknown Object (File)
Tue, Feb 17, 8:18 PM
Unknown Object (File)
Tue, Feb 17, 5:39 PM
Unknown Object (File)
Tue, Feb 17, 5:17 PM
Unknown Object (File)
Tue, Feb 17, 5:34 AM
Unknown Object (File)
Tue, Feb 17, 1:33 AM
Subscribers

Details

Summary

PR#293198 reports a hang within ZFS when exports
are being updated concurrently with a VOP_SETEXTATTR().
The hang appears to be caused by mishandling of the
z_teardown_lock, but fixing handling of this lock appears
to be a major effort. Since the hang occurs when
VFS_MOUNT() acquires a write/exclusive z_teardown_lock,
which rarely occurs, except when exports are being updated,
this patch avoids the VFS_MOUNT() call for this case.

Avoiding a VFS_MOUNT() call fixes the hang for the case
reported by PR#293198 and is also an optimization.
As such, this patch avoids the VFS_MOUNT() call when only exports
are being updated similar to what was already being done
within vnet prisons.

Test Plan

Tested by the reporter of the PR and also for exports
of both ZFS and UFS file systems.

Diff Detail

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

Event Timeline

sys/kern/vfs_mount.c
993

Mihgt be, some more descriptive name would be useful? Like 'only_export'?
Or at least a comment might be added explaining the intent of the local.

Changed the variable name has_export to only_export,
as suggested by kib@. I also changed the comment
related to this vaiable.

This revision is now accepted and ready to land.Tue, Feb 17, 2:33 PM