[pnfs] CVS: nfsv4

Marc Eshel IBM eshel at citi.umich.edu
Sat Feb 24 17:09:14 EST 2007


CVSROOT:	/cvs
Module name:	nfsv4
Changes by:	eshel at citi.umich.edu	2007/02/24 17:09:13

Modified files:
	cvs/pnfs/fs/nfsd: nfs4pnfsds.c nfs4state.c 

Log message:
First step for adding  exchange id for pNFS client. For now it looks like a
regular client until we add the pNFS flag to the protocol.
The DS will have to avoid expiring the client since it doesn't renew its state.
Also remove hack code from cton.

Index: nfs4pnfsds.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfsd/nfs4pnfsds.c,v
retrieving revision 1.8
diff -u -r1.8 nfs4pnfsds.c
--- nfs4pnfsds.c	2 Feb 2007 02:52:55 -0000	1.8
+++ nfs4pnfsds.c	24 Feb 2007 21:49:21 -0000
@@ -285,6 +285,7 @@
sb = ino->i_sb;
if (sb && sb->s_export_op->get_state)
status = sb->s_export_op->get_state(ino, &cfh->fh_handle, &gs);
+		dprintk("pNFSD: %s from MDS status %d\n", __func__, status);
if (status)
return NULL;
/* create new pnfs_ds_stateid */
@@ -318,18 +319,4 @@
if (stateid->si_generation < dsp->ds_stid.si_generation)
return nfserr_old_stateid;
return 0;
-}
-
-/* HACK for Connectathon 2007 testing */
-void
-gen_ds_sessionid(clientid_t *clid, sessionid_t *sid)
-{
-        u32 *p = (u32 *)sid;
-        u64 *q;
-        static u64 sessionid_ctr = 0;
-
-        *p++ = clid->cl_boot;
-        *p++ = clid->cl_id;
-        q = (u64 *)sid[8];
-        *q = sessionid_ctr++;
}
Index: nfs4state.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfsd/nfs4state.c,v
retrieving revision 1.38
diff -u -r1.38 nfs4state.c
--- nfs4state.c	22 Feb 2007 07:35:20 -0000	1.38
+++ nfs4state.c	24 Feb 2007 21:49:21 -0000
@@ -453,9 +453,8 @@
{
if (clid->cl_boot == boot_time)
return 0;
-	dprintk("xxx ignore NFSD stale clientid (%08x/%08x) boot_time %08lx\n",
+	dprintk("NFSD stale clientid (%08x/%08x) boot_time %08lx\n",
clid->cl_boot, clid->cl_id, boot_time);
-	return 0; //??? temp fix
return 1;
}

@@ -1258,16 +1257,6 @@
unconf = find_unconfirmed_client(&session->clientid);
conf = find_confirmed_client(&session->clientid);

-        if (!conf && !unconf) {
-		/* client records purged
-		status =  nfserr_stale_clientid;
-		goto out;
-		*/
-		/* ??? HACK for connectathon 2007 testing */
-                dprintk("xxx hack a create_session replay!\n");
-		goto hack;
-        }
-
if (conf) {
status = nfs_ok;
if (conf->cl_seqid != session->seqid + 1) {
@@ -1312,12 +1301,6 @@
nfs4_unlock_state();
dprintk("%s returns %d %d\n", __FUNCTION__, status, ntohl(status));
return status;
-
-hack:
-	gen_ds_sessionid(&session->clientid, &session->sessionid);
-	session->seqid = 1; /* unused */
-	add_to_sessionid_hashtbl(&session->clientid, &session->sessionid);
-	goto out;
}

@@ -2209,8 +2192,7 @@
status = nfserr_expired;
if (clp == NULL) {
/* We assume the client took too long to RENEW. */
-		dprintk("xxx ignore nfsd4_renew: clientid not found!\n");
-		status = nfs_ok; //???
+		dprintk("nfsd4_renew: clientid not found!\n");
goto out;
}
renew_client(clp);
@@ -2278,10 +2260,15 @@
clientid_val = t;
break;
}
+#if 1 //???
+		dprintk("NFSD: xxx HACK xxx skip purging unused client (clientid %08x)\n",
+			clp->cl_clientid.cl_id);
+#else
dprintk("NFSD: purging unused client (clientid %08x)\n",
clp->cl_clientid.cl_id);
nfsd4_remove_clid_dir(clp);
expire_client(clp);
+#endif
}
INIT_LIST_HEAD(&reaplist);
spin_lock(&recall_lock);



More information about the pNFS mailing list