Page MenuHomeFreeBSD

Add support for an exports.db to mountd
Needs ReviewPublic

Authored by on Oct 24 2023, 10:48 PM.
Referenced Files
Unknown Object (File)
Apr 21 2024, 10:49 PM
Unknown Object (File)
Apr 21 2024, 6:37 AM
Unknown Object (File)
Apr 20 2024, 11:04 PM
Unknown Object (File)
Jan 5 2024, 10:33 PM
Unknown Object (File)
Dec 25 2023, 5:24 PM
Unknown Object (File)
Dec 20 2023, 8:26 AM
Unknown Object (File)
Dec 14 2023, 7:27 PM
Unknown Object (File)
Dec 2 2023, 6:37 AM



Peter Eriksson submitted this patch, which adds support for a
database form of the exports file (as an alternative to the
exports(5) flat file). He has a patch for ZFS that generates
this database file format and it saves time when ZFS exports
a large number of file systems.

The current patch first looks for a file with the ".db" suffix and
uses that file instead of one without the ".db" suffix, if found.
(I am not 1000% sure if this semantic is appropriate vs requiring
the "exports.db" file name being an argument, but it avoids any
changes being needed for /etc/rc.d/mountd and avoids any
POLA, since behaviour remains the same unless "<file>.db" exists.

Although this is meant to be used with a patched version of ZFS,
the database can be generated manually via:
"makemap -f btree <file>.db < <file>"

A manual update will be done as a separate commit.

Test Plan

I have tested it with/without databases created manually
from exports(5) by makemap. Peter has tested a previous
version of the patch in his production environment.

Diff Detail

rG FreeBSD src repository
Lint Skipped
Tests Skipped

Event Timeline

Neat. I should have looked at Phabricator before I created D42432. I think they should be considered together. And the patched version of zfs (I haven't looked, of course), should also consider special characters in mount point names if it doesn't.

rmacklem foisted this revision upon
rmacklem edited reviewers, added: rmacklem; removed:
rmacklem added a reviewer:

Update the patch to include the recent changes for
handling blanks/tabs in directory paths.

Hopefully Peter can confirm that this version of the
patch works with an exports.db generated from a
patched ZFS?