This patch is similar to one I posted yesterday for 2.6. It fixes the following race conditions in nbd: 1) adds locking and properly orders the code in NBD_CLEAR_SOCK to eliminate races with other code 2) adds an lo->sock check to nbd_clear_que to eliminate races between do_nbd_request and nbd_clear_que, which resulted in the dequeuing of active requests 3) adds an lo->sock check to NBD_DO_IT to eliminate races with NBD_CLEAR_SOCK, which caused an Oops when "nbd-client -d" was called Marcelo, If we can get this into 2.4.22, that would be great. I know there's at least one person who's consistently getting oopses with nbd. Thanks, Paul