Page MenuHomeFreeBSD

free export structures when a file system is dismounted
ClosedPublic

Authored by rmacklem on Feb 4 2023, 9:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2025, 12:28 PM
Unknown Object (File)
Feb 11 2025, 9:50 PM
Unknown Object (File)
Feb 7 2025, 9:41 PM
Unknown Object (File)
Feb 4 2025, 11:14 PM
Unknown Object (File)
Feb 2 2025, 10:43 PM
Unknown Object (File)
Jan 27 2025, 4:36 PM
Unknown Object (File)
Jan 27 2025, 9:41 AM
Unknown Object (File)
Jan 26 2025, 5:58 PM
Subscribers

Details

Summary

During testing of exporting file systems in jails, I
noticed that the export structures on a mount
were not being free'd when the mount is dismounted.

This bug appears to have been in the system for a
very long time. It would have resulted in a slow memory
leak when exported file systems were dismounted.

Prior to r362158, freeing the structures during dismount
would not have been safe, since VFS_CHECKEXP() returned
a pointer into an export structure, which might still be used
by the NFS server for an in-progress RPC when the file system
is dismounted. r362158 fixed this, so it should now be safe
to free the structures in vfs_mount_destroy(), which is what
this patch does.

Test Plan

Monitored export structure allocation via "vmstat -m"
before and after doing a umount of an exported file
system.

Diff Detail

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