Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 2006 12:49:13 +0300
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Atomic updates of NFS export lists
Message-ID:  <20060425094913.GA2041@pm513-1.comsys.ntu-kpi.kiev.ua>
In-Reply-To: <20060424115631.GE2984@roadrunner.buck.local>
References:  <20060421095610.GA1137@pm513-1.comsys.ntu-kpi.kiev.ua> <20060424115631.GE2984@roadrunner.buck.local>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 24, 2006 at 01:56:31PM +0200, Ulrich Spoerlein wrote:
> Andrey Simonenko wrote:
> > [Lots of good stuff]
> > Now mountd does not work if there is some error in exports file.
> > I think this is correct behaviour and I'm ready to explain this.
> 
> Hello Andrey,
> 
> I hope these 'errors' in the exports file only mean syntactical errors?
> For example, I have a /vol partition mounted on my NFS server, which is
> exported via NFS. Now, sometimes /vol is mounted, sometimes it is not
> mounted (on the server). This will generate some warnings from mountd,
> as it can't export the /vol filesystem, but mountd still works the same.
> Once /vol becomes available, I don't even need to restart mountd, it
> will simply pick up /vol and make it available.
> 
> I hope these semantics will remain? (No sorry, I didn't not test your
> patch yet).
> 

In general ignoring lines is not safe, since this can give wrong access
rights.  For example if second line is ignored and /usr/local is in the
same filesystem as /usr, then 10.1.2.3 will match 10.1.2.0/24
and will get r/w access for /usr:

/usr -network 10.1.2.0/24
/usr/local -ro 10.1.2.3

Output from "mountd -t":

Filesystem /usr, type "ufs", fsid 0x43d21dca:0x0225d70c
    Exported directories:
        /usr
	     -network 10.1.2.0/24
        /usr/local
	     -ro 10.1.2.3

I disallowed duplicated export specifications:

/var 10.1.2.3
/var/vol 10.1.2.3

parsing error: exports4:2: duplicated IPv4 address specification 10.1.2.3
was found for /var filesystem

But this can be solved with -quiet option as in your case:

/var 10.1.2.3
/var/vol -quiet 10.1.2.3

parsing error: exports4:2: duplicated IPv4 address specification 10.1.2.3
was found for /var filesystem
parsing error: exports4:2: this line is ignored
Filesystem /var, type "ufs", fsid 0x43d21dcb:0x22fc3751
    Exported directories:
        /var
	     10.1.2.3

When another filesystem is mounted on /var/vol, then:

Filesystem /var, type "ufs", fsid 0x43d21dcb:0x22fc3751
    Exported directories:
        /var
	     10.1.2.3

Filesystem /var/vol, type "ufs", fsid 0x444de7a4:0x96b6cba3
    Filesystem options:
	-quiet
    Exported directories:
        /var/vol
	     10.1.2.3

There is no need to restart mountd as you said, if filesystem is mounted
with mount(8), then mount(8) sends SIGHUP signal to mountd and it reloads
exports file, so it is self-restarted.



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