]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/lockd/svclock.c
NLM: don't requeue block if it was invalidated while GRANT_MSG was in flight
[linux-2.6-omap-h63xx.git] / fs / lockd / svclock.c
index 82db7b323b83c030fe91eb5d85249d3fe66d7d1f..fe9bdb4a220cd32827c5818001651cabb5f1966d 100644 (file)
@@ -795,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
 
        dprintk("lockd: GRANT_MSG RPC callback\n");
 
+       /* if the block is not on a list at this point then it has
+        * been invalidated. Don't try to requeue it.
+        *
+        * FIXME: it's possible that the block is removed from the list
+        * after this check but before the nlmsvc_insert_block. In that
+        * case it will be added back. Perhaps we need better locking
+        * for nlm_blocked?
+        */
+       if (list_empty(&block->b_list))
+               return;
+
        /* Technically, we should down the file semaphore here. Since we
         * move the block towards the head of the queue only, no harm
         * can be done, though. */