[pnfs] CVS: nfsv4

Marc Eshel IBM eshel at citi.umich.edu
Sun Dec 24 19:01:59 EST 2006


CVSROOT:	/cvs
Module name:	nfsv4
Changes by:	eshel at citi.	2006/12/24 19:01:59

Modified files:
	cvs/pnfs/fs/nfs: inode.c pnfs.c 

Log message:
If for some reason the server does not return a layout the client keep asking
on each read. Remember that get layout failed and don't request it again.

Index: inode.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/inode.c,v
retrieving revision 1.17
diff -u -r1.17 inode.c
--- inode.c	18 Dec 2006 17:18:43 -0000	1.17
+++ inode.c	24 Dec 2006 23:54:04 -0000
@@ -1084,6 +1084,7 @@
#endif
#ifdef CONFIG_NFS_V4 /* XXX CONFIG_PNFS */
nfsi->nfs4_acl = NULL;
+	nfsi->pnfs_layout_state = 0;
nfsi->current_layout = NULL;
nfsi->layoutcommit_ctx = NULL;
#endif /* CONFIG_NFS_V4 */
Index: pnfs.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/pnfs.c,v
retrieving revision 1.50
diff -u -r1.50 pnfs.c
--- pnfs.c	14 Dec 2006 10:47:40 -0000	1.50
+++ pnfs.c	24 Dec 2006 23:54:05 -0000
@@ -436,6 +436,11 @@
}

res.layout.buf = NULL;
+
+        /* if get layout already failed once goto out */
+        if (nfsi->pnfs_layout_state & NFS_INO_LAYOUT_FAILED)
+		goto out;
+
if ((result = get_layout(ino, ctx, count, pos, iomode, &arg, &res))) {
printk("\n%s: ERROR retrieving layout %d\n",__FUNCTION__,result);
result =  -EIO;
@@ -468,10 +473,15 @@

result = 0;
out:
+
+        /* remember that get layout failed and don't try again */
+        nfsi->pnfs_layout_state |= NFS_INO_LAYOUT_FAILED;
+
/* res.layout.buf kalloc'ed by the xdr decoder? */
if (res.layout.buf)
kfree(res.layout.buf);
-	dprintk("%s end (err:%d)\n",__FUNCTION__,result);
+	dprintk("%s end (err:%d) state %d\n",
+		__FUNCTION__,result,nfsi->pnfs_layout_state);
return result;
}



More information about the pNFS mailing list