Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2011 13:12:42 +0300
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        freebsd-fs@freebsd.org
Subject:   Re: kern/131342: [nfs] mounting/unmounting of disks causes NFS to fail
Message-ID:  <20110715101242.GA87688@pm513-1.comsys.ntu-kpi.kiev.ua>
In-Reply-To: <201107081310.p68DA3Nj019275@freefall.freebsd.org>
References:  <201107081310.p68DA3Nj019275@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 08, 2011 at 01:10:03PM +0000, Martin Birgmeier wrote:
> The following reply was made to PR kern/131342; it has been noted by GNATS.
> 
> From: Martin Birgmeier <Martin.Birgmeier@aon.at>
> To: bug-followup@FreeBSD.org
> Cc:  
> Subject: Re: kern/131342: [nfs] mounting/unmounting of disks causes NFS to
>  fail
> Date: Fri, 08 Jul 2011 15:00:03 +0200
> 
>  This is a friendly reminder that some kind soul with knowledge of the 
>  relevant kernel parts look into this... the error can easily be 
>  reproduced. I just had it on a 7.4 system which did heavy reading from 
>  an 8.2 server. When I mounted something on the server, the client got a 
>  "Permission denied" reply.
>  
>  So, to recap the scenario:
>  
>  7.4 NFS client
>  8.2 NFS server
>  client mounts a fs from the server (via IPv4, might be interesting to 
>  look at http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/151681, too, but 
>  that is unrelated)
>  client does heavy i/o on the mounted fs
>  server does a mount (on its side, in this case it was from an md device)
>  
>  --> error: client gets back some NFS error (in this case "permission 
>  denied")
>  

This is a well-known behaviour of NFS server on FreeBSD when some file
system is mounted on a server part.  This happens because when mount(8)
mounts something it sends the SIGHUP signal to mountd(8), it then re-reads
exports(5) file and loads new settings into NFS server.  Since mountd(8)
flushes current settings, loads new settings in a step-by-step style, all
these changes are happened in nonatomic way.  As a result exports settings
in the NFS server are incomplete in any point of time during configuration
loading or reloading.

This time window allows "denied" clients to access not allowed parts of
exported file systems and "allowed" clients can get access denied errors.

If you are interested in this topic, you can look on the kern/136865
and my messages related to this topic (information in [3] is outdated
and in [4] is very outdated):

1. NFS exports atomic and on-the-fly atomic updates
   http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/136865   

2. NFSE: new NFS exports support for FreeBSD
   http://nfse.sourceforge.net/

3. NFS exports atomic and on-the-fly atomic updates
   http://lists.freebsd.org/pipermail/freebsd-hackers/2009-June/028782.html

4. Atomic updates of NFS export lists
   http://lists.freebsd.org/pipermail/freebsd-hackers/2006-April/016248.html

5. CFT: nfse compatible mode with mountd (NFS exports file)
   http://lists.freebsd.org/pipermail/freebsd-fs/2010-May/008421.html



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