aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svclock.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r--fs/lockd/svclock.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 2f4d8fa66689..fe9bdb4a220c 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -763,11 +763,20 @@ callback:
763 dprintk("lockd: GRANTing blocked lock.\n"); 763 dprintk("lockd: GRANTing blocked lock.\n");
764 block->b_granted = 1; 764 block->b_granted = 1;
765 765
766 /* Schedule next grant callback in 30 seconds */ 766 /* keep block on the list, but don't reattempt until the RPC
767 nlmsvc_insert_block(block, 30 * HZ); 767 * completes or the submission fails
768 */
769 nlmsvc_insert_block(block, NLM_NEVER);
770
771 /* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
772 * will queue up a new one if this one times out
773 */
774 error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
775 &nlmsvc_grant_ops);
768 776
769 /* Call the client */ 777 /* RPC submission failed, wait a bit and retry */
770 nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops); 778 if (error < 0)
779 nlmsvc_insert_block(block, 10 * HZ);
771} 780}
772 781
773/* 782/*
@@ -786,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
786 795
787 dprintk("lockd: GRANT_MSG RPC callback\n"); 796 dprintk("lockd: GRANT_MSG RPC callback\n");
788 797
798 /* if the block is not on a list at this point then it has
799 * been invalidated. Don't try to requeue it.
800 *
801 * FIXME: it's possible that the block is removed from the list
802 * after this check but before the nlmsvc_insert_block. In that
803 * case it will be added back. Perhaps we need better locking
804 * for nlm_blocked?
805 */
806 if (list_empty(&block->b_list))
807 return;
808
789 /* Technically, we should down the file semaphore here. Since we 809 /* Technically, we should down the file semaphore here. Since we
790 * move the block towards the head of the queue only, no harm 810 * move the block towards the head of the queue only, no harm
791 * can be done, though. */ 811 * can be done, though. */