[pnfs] [PATCH 23/55] pnfsd: nfs4_close_delegation: release state lock around nfsd_close

J. Bruce Fields bfields at fieldses.org
Thu Jul 16 12:09:49 EDT 2009


On Tue, Jul 07, 2009 at 04:38:49PM -0400, andros at netapp.com wrote:
> From: Benny Halevy <bhalevy at panasas.com>
> 
> similar to the release_stateid in the regular close path
>  the state_lock needs to be released around the call to nfsd_close
>  to allow the exported file system to recall layouts and the client
>  to return layouts while the file system waits synchronously
>  for these to be returned before returning from nfsd_close.

(Comment as before: also, if this is a problem which exofs in particular
exposes, let's delay these two patches till the introduction of exofs,
so that we can deal with the locking problem in the context of the
specifics of exofs's needs.)

--b.

> 
> Original patch provided by Benny Halevy <bhalevy at panasas.com>
> 
> Signed-off-by: Ricardo Labiaga <ricardo.labiaga at netapp.com>
> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
> ---
>  fs/nfsd/nfs4state.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 4803313..128e89a 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -259,7 +259,9 @@ nfs4_close_delegation(struct nfs4_delegation *dp)
>  	 * but we want to remove the lease in any case. */
>  	if (dp->dl_flock)
>  		vfs_setlease(filp, F_UNLCK, &dp->dl_flock);
> +	nfs4_unlock_state();	/* allow nested layout recall/return */
>  	nfsd_close(filp);
> +	nfs4_lock_state();
>  }
>  
>  /* Called under the state lock. */
> -- 
> 1.5.4.3
> 
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs


More information about the pNFS mailing list