Date: Wed, 14 Apr 2021 18:33:42 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 255061] [PATCH] Proof of concept nested mounts for automounter -hosts map Message-ID: <bug-255061-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255061 Bug ID: 255061 Summary: [PATCH] Proof of concept nested mounts for automounter -hosts map Product: Base System Version: 12.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: kreuter@progn.net Created attachment 224112 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=224112&action=edit Extend automountd, autounmountd, and autofs to understand nested automounted mount points. (This is perhaps a duplicate of bug #195564, but I don't know whether the project prefers reopening things vs. new reports.) I'm interested in enhancing the automounter to be able to handle nested/hierarchical keys in the -hosts map (mostly as a complement to zfs, which makes it convenient to organize data sets in nested hierarchies), so I'm attaching a working proof-of-concept implementation of the capability. This picture shows the net result on a test machine that exports some zfs shares rooted at /t to itself: # mount | grep /net map -hosts on /net (autofs) localhost:/t/a on /net/localhost/t/a (nfs, nosuid, automounted) map -hosts on /net/localhost/t/a/b (autofs, automounted) localhost:/t/a/b on /net/localhost/t/a/b (nfs, nosuid, automounted) map -hosts on /net/localhost/t/a/b/c (autofs, automounted) That is, I've added the idea of "automounted autofs" mount points. Because they're automounted, they are created dynamically by automountd and destroyed by autounmountd. Because they're autofs mounts, they eventually cause something else to get mounted. The attachment is a tar file, here's a description of its contents: report.txt -- this PR writeup. notes.txt -- detailed description of the approach, limitations, future work automountd.diff -- add the notion of automounted autofs mounts autounmountd.diff -- teach autounmountd about unmount order dependencies. autofs.diff -- have an automounted autofs pass getattr calls through. These diffs apply against the releng-12.2 branch (it's what I was running when I started), but should be pretty cleanly applicable to CURRENT or HEAD, since not much has changed in the automounter. Note that the diffs are named "logically"; in fact the first 2 diffs touch multiple files in usr.sbin/autofs, and and must be applied in the order I've mentioned them. This set of changes is lightly tested, but does what I want it to so far under repeated, but manual, testing. That said, the approach I've taken isn't the only conceivable way to do things; it was just the shortest path I could think of from what was there to the behavior I wanted to see. Anyhow, there's work to do before this might be merge-worthy (e.g., I haven't gotten to "automount -u" yet.) If there's an interest in incorporating this approach, I'd be very happy to iterate on this effort, ideally with some guidance/help from those who know this stuff. -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255061-227>
