aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-07-23 19:02:15 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-07-28 14:30:23 -0400
commit88e588d56a2f0226a34386b94a03fda97d2b8e67 (patch)
treea190c3618ed4772c9f9b36a948be33b5368fecba /fs/nfsd
parent5261dcf8eb3d098545a676030910cf2c05a00e6c (diff)
nfsd41: change check_slot_seqid parameters
For separation of session slot and clientid slot processing. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 0be417e3aab6..99df8e7a687b 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1309,26 +1309,26 @@ error:
1309} 1309}
1310 1310
1311static int 1311static int
1312check_slot_seqid(u32 seqid, struct nfsd4_slot *slot) 1312check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
1313{ 1313{
1314 dprintk("%s enter. seqid %d slot->sl_seqid %d\n", __func__, seqid, 1314 dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
1315 slot->sl_seqid); 1315 slot_seqid);
1316 1316
1317 /* The slot is in use, and no response has been sent. */ 1317 /* The slot is in use, and no response has been sent. */
1318 if (slot->sl_inuse) { 1318 if (slot_inuse) {
1319 if (seqid == slot->sl_seqid) 1319 if (seqid == slot_seqid)
1320 return nfserr_jukebox; 1320 return nfserr_jukebox;
1321 else 1321 else
1322 return nfserr_seq_misordered; 1322 return nfserr_seq_misordered;
1323 } 1323 }
1324 /* Normal */ 1324 /* Normal */
1325 if (likely(seqid == slot->sl_seqid + 1)) 1325 if (likely(seqid == slot_seqid + 1))
1326 return nfs_ok; 1326 return nfs_ok;
1327 /* Replay */ 1327 /* Replay */
1328 if (seqid == slot->sl_seqid) 1328 if (seqid == slot_seqid)
1329 return nfserr_replay_cache; 1329 return nfserr_replay_cache;
1330 /* Wraparound */ 1330 /* Wraparound */
1331 if (seqid == 1 && (slot->sl_seqid + 1) == 0) 1331 if (seqid == 1 && (slot_seqid + 1) == 0)
1332 return nfs_ok; 1332 return nfs_ok;
1333 /* Misordered replay or misordered new request */ 1333 /* Misordered replay or misordered new request */
1334 return nfserr_seq_misordered; 1334 return nfserr_seq_misordered;
@@ -1351,7 +1351,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
1351 1351
1352 if (conf) { 1352 if (conf) {
1353 slot = &conf->cl_slot; 1353 slot = &conf->cl_slot;
1354 status = check_slot_seqid(cr_ses->seqid, slot); 1354 status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
1355 slot->sl_inuse);
1355 if (status == nfserr_replay_cache) { 1356 if (status == nfserr_replay_cache) {
1356 dprintk("Got a create_session replay! seqid= %d\n", 1357 dprintk("Got a create_session replay! seqid= %d\n",
1357 slot->sl_seqid); 1358 slot->sl_seqid);
@@ -1376,7 +1377,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
1376 } 1377 }
1377 1378
1378 slot = &unconf->cl_slot; 1379 slot = &unconf->cl_slot;
1379 status = check_slot_seqid(cr_ses->seqid, slot); 1380 status = check_slot_seqid(cr_ses->seqid, slot->sl_seqid,
1381 slot->sl_inuse);
1380 if (status) { 1382 if (status) {
1381 /* an unconfirmed replay returns misordered */ 1383 /* an unconfirmed replay returns misordered */
1382 status = nfserr_seq_misordered; 1384 status = nfserr_seq_misordered;
@@ -1477,7 +1479,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
1477 slot = &session->se_slots[seq->slotid]; 1479 slot = &session->se_slots[seq->slotid];
1478 dprintk("%s: slotid %d\n", __func__, seq->slotid); 1480 dprintk("%s: slotid %d\n", __func__, seq->slotid);
1479 1481
1480 status = check_slot_seqid(seq->seqid, slot); 1482 status = check_slot_seqid(seq->seqid, slot->sl_seqid, slot->sl_inuse);
1481 if (status == nfserr_replay_cache) { 1483 if (status == nfserr_replay_cache) {
1482 cstate->slot = slot; 1484 cstate->slot = slot;
1483 cstate->session = session; 1485 cstate->session = session;