summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMike Sager <sager@netapp.com>2010-01-19 12:54:41 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-02-10 08:30:55 -0500
commit72ce2b3c064471fc511a9ca2fb6c38d90d2ab826 (patch)
tree5020b4040c1ead6521aef52933b39269fc955dfc /fs
parenta7989c3e4702203baa5ddb3614f92bfc49a6e491 (diff)
downloadblackbird-op-linux-72ce2b3c064471fc511a9ca2fb6c38d90d2ab826.tar.gz
blackbird-op-linux-72ce2b3c064471fc511a9ca2fb6c38d90d2ab826.zip
nfs41: Process callback's referring call list
If a CB_SEQUENCE referring call triple matches a slot table entry, the client is still waiting for a response to the original request. In this case, return NFS4ERR_DELAY as the response to the callback. Signed-off-by: Mike Sager <sager@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/callback_proc.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 631b44c1439b..49c4b548b4d0 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -280,17 +280,12 @@ out:
return status;
}
-/* FIXME: referring calls should be processed */
unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
struct cb_sequenceres *res)
{
struct nfs_client *clp;
int i, status;
- for (i = 0; i < args->csa_nrclists; i++)
- kfree(args->csa_rclists[i].rcl_refcalls);
- kfree(args->csa_rclists);
-
status = htonl(NFS4ERR_BADSESSION);
clp = find_client_with_session(args->csa_addr, 4, &args->csa_sessionid);
if (clp == NULL)
@@ -301,6 +296,16 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
if (status)
goto out_putclient;
+ /*
+ * Check for pending referring calls. If a match is found, a
+ * related callback was received before the response to the original
+ * call.
+ */
+ if (referring_call_exists(clp, args->csa_nrclists, args->csa_rclists)) {
+ status = htonl(NFS4ERR_DELAY);
+ goto out_putclient;
+ }
+
memcpy(&res->csr_sessionid, &args->csa_sessionid,
sizeof(res->csr_sessionid));
res->csr_sequenceid = args->csa_sequenceid;
@@ -311,6 +316,10 @@ unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
out_putclient:
nfs_put_client(clp);
out:
+ for (i = 0; i < args->csa_nrclists; i++)
+ kfree(args->csa_rclists[i].rcl_refcalls);
+ kfree(args->csa_rclists);
+
dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
res->csr_status = status;
return res->csr_status;
OpenPOWER on IntegriCloud