Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346605
b: refs/heads/master
c: 7b939a3
h: refs/heads/master
i:
  346603: 1c60855
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 5, 2012
1 parent 0b26d2a commit 75aa11f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd0c09537a8494e9dccf3856b90058e1f97f1d62
refs/heads/master: 7b939a3f44293516c4225f640e8c4b9200beeabc
16 changes: 7 additions & 9 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,29 +523,23 @@ int nfs41_setup_sequence(struct nfs4_session *session,
if (test_bit(NFS4_SESSION_DRAINING, &session->session_state) &&
!rpc_task_has_priority(task, RPC_PRIORITY_PRIVILEGED)) {
/* The state manager will wait until the slot table is empty */
rpc_sleep_on(&tbl->slot_tbl_waitq, task, NULL);
spin_unlock(&tbl->slot_tbl_lock);
dprintk("%s session is draining\n", __func__);
return -EAGAIN;
goto out_sleep;
}

if (!rpc_queue_empty(&tbl->slot_tbl_waitq) &&
!rpc_task_has_priority(task, RPC_PRIORITY_PRIVILEGED)) {
rpc_sleep_on(&tbl->slot_tbl_waitq, task, NULL);
spin_unlock(&tbl->slot_tbl_lock);
dprintk("%s enforce FIFO order\n", __func__);
return -EAGAIN;
goto out_sleep;
}

slot = nfs4_alloc_slot(tbl);
if (IS_ERR(slot)) {
/* If out of memory, try again in 1/4 second */
if (slot == ERR_PTR(-ENOMEM))
task->tk_timeout = HZ >> 2;
rpc_sleep_on(&tbl->slot_tbl_waitq, task, NULL);
spin_unlock(&tbl->slot_tbl_lock);
dprintk("<-- %s: no free slots\n", __func__);
return -EAGAIN;
goto out_sleep;
}
spin_unlock(&tbl->slot_tbl_lock);

Expand All @@ -566,6 +560,10 @@ int nfs41_setup_sequence(struct nfs4_session *session,
out_success:
rpc_call_start(task);
return 0;
out_sleep:
rpc_sleep_on(&tbl->slot_tbl_waitq, task, NULL);
spin_unlock(&tbl->slot_tbl_lock);
return -EAGAIN;
}
EXPORT_SYMBOL_GPL(nfs41_setup_sequence);

Expand Down

0 comments on commit 75aa11f

Please sign in to comment.