[pnfs] [PATCH] free layout even if get error from server
Benny Halevy
bhalevy at panasas.com
Sun Sep 16 06:21:15 EDT 2007
I agree this is OK to do as the client can forget about layouts
it has (but not vice versa, i.e. keep layouts it does not have)
I think that a debug message about that would be appropriate though...
E.g. patch below
Benny
PS: what error did you encounter?
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 862590f..be52b73 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -373,8 +373,12 @@ pnfs_return_layout(struct inode* ino, struct nfs4_pnfs_layout_segment *range)
status = pnfs_return_layout_rpc(server, &arg);
- if (!status && nfsi->current_layout) {
- dprintk ("%s: removing layout\n", __FUNCTION__);
+ 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, ino, &arg.lseg);
}
--
On Sep 14, 2007, 21:43 +0300, Marc Eshel <eshel at almaden.ibm.com> wrote:
> From: Marc Eshel <eshel at almaden.ibm.com>
>
>
> ---
>
> fs/nfs/pnfs.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index d7154b2..5d2be81 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -373,7 +373,7 @@ pnfs_return_layout(struct inode* ino, st
>
> status = pnfs_return_layout_rpc(server, &arg);
>
> - if (!status && nfsi->current_layout) {
> + if (nfsi->current_layout) {
> dprintk ("%s: removing layout\n", __FUNCTION__);
> server->pnfs_curr_ld->ld_io_ops->free_layout(&nfsi->current_layout, ino, &arg.lseg);
> }
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
More information about the pNFS
mailing list