Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2015 09:24:25 -0400 (EDT)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= <trasz@FreeBSD.org>
Cc:        FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   Re: RFC: should automounted file systems be exportable?
Message-ID:  <1693868675.37887047.1431609865698.JavaMail.root@uoguelph.ca>
In-Reply-To: <20150512074602.GA93864@brick.home>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Edward Tomasz Napierala wrote:
> On 0511T2217, Rick Macklem wrote:
> > A recent bug was reported related to mountd and the
> > "automounted" flag.
> > 
> > Loosely related to this is the question...
> > Should automounted file systems be exportable?
> > 
> > I haven't tested it, but I suspect that it would be
> > broken and the NFS server will reply NFSERR_STALE
> > after the file system has been dismounted.
> > 
> > So, should I patch mountd so that it won't export
> > automounted file systems?
> 
> Exporting an automounted filesystem doesn't seem to make much sense,
> I agree, but I'm not sure if adding code to prevent it is such
> a good idea.  If the user asks for it, by putting it into exports(5),
> it's his fault; the only thing this code could add would be a more
> friendly error message.
> 
> 
So, how about having mountd generate a warning message in syslog(),
but allow it to proceed?
(Untested patch for this is attached.)

rick
ps: One other person emailed me suggesting that it should be doable and
    no one emailed that it should be restricted, so I figure that the "vote"
    favours a warning.

[-- Attachment #2 --]
--- mountd.c.orig	2015-05-09 22:04:15.000000000 -0400
+++ mountd.c	2015-05-14 09:18:01.000000000 -0400
@@ -1410,6 +1410,9 @@ get_exportlist_one(void)
 			    }
 			    if (check_dirpath(cp) &&
 				statfs(cp, &fsb) >= 0) {
+				if ((fsb.f_flags & MNT_AUTOMOUNTED) != 0)
+				    syslog(LOG_ERR, "Warning: exporting of "
+					"automounted fs %s not supported", cp);
 				if (got_nondir) {
 				    syslog(LOG_ERR, "dirs must be first");
 				    getexp_err(ep, tgrp);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1693868675.37887047.1431609865698.JavaMail.root>