[pnfs] [PATCH 17/37] pnfs: call LD's free_layout before pnfs_return_layout_rpc

Dean Hildebrand seattleplus at gmail.com
Wed Jan 2 17:41:48 EST 2008



Benny Halevy wrote:
> free_layout is called in any case (even if the layoutreturn rpc fails)
> and it's ok according to the nfsv4.1 spec for the client to forget about
> the layout before returning it.
>
> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
> ---
>  fs/nfs/pnfs.c |   15 +++------------
>  1 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index ced7f30..cb8115f 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -344,6 +344,9 @@ pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range)
>  	if (nfsi->current_layout == NULL)
>  		return 0;
>  
> +	server->pnfs_curr_ld->ld_io_ops->free_layout(
> +		&nfsi->current_layout, &arg.lseg);
> +
>   
Do we need to check if free_layout exists?
Dean
>  	arg.reclaim = 0;
>  	arg.layout_type = server->pnfs_curr_ld->id;
>  	arg.return_type = RETURN_FILE;
> @@ -358,18 +361,6 @@ pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range)
>  
>  	status = pnfs_return_layout_rpc(server, &arg);
>  
> -	if (nfsi->current_layout) {
> -		if (status)
> -			dprintk("%s: pnfs_return_layout_rpc status=%d. "
> -				"removing layout anyway\n", __FUNCTION__,
> -				status);
> -		else
> -			dprintk("%s: removing layout\n", __FUNCTION__);
> -
> -		server->pnfs_curr_ld->ld_io_ops->free_layout(
> -			&nfsi->current_layout, &arg.lseg);
> -	}
> -
>  	dprintk("%s:Exit status %d\n", __FUNCTION__, status);
>  	return status;
>  }
>   


More information about the pNFS mailing list