It's otherwise ok, but this part is certainly buggy:
> @@ -296,7 +303,12 @@
> #endif
> req->errors = 0;
>
> + spin_unlock_irq(&io_request_lock);
> nbd_send_req(lo->sock, req); /* Why does this block? */
> + spin_lock_irq(&io_request_lock);
> +
> + if (CURRENT != req)
> + FAIL("CURRENT was modified");
> CURRENT = CURRENT->next;
> req->next = NULL;
> if (lo->head == NULL) {
If you drop the io-request lock, and then not expect CURRENT to change,
you're just fooling yourself. That's like saying "oh, btw, I now let
people change the CURRENT queue, but by God if anybody actually does so
I'll panic". That's just too stupid for me to accept as a patch.
As far as I can tell, the code will unlink the request immediately
afterwards anyway, so the fix is to just unlink it _before_ dropping the
IO request lock, so that we don't have to worry about the request lists
any more.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html