]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nbd: clear waiting_queue on shutdown
authorPaul Clements <paul.clements@steeleye.com>
Mon, 17 Sep 2012 21:09:02 +0000 (14:09 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 26 Nov 2012 19:38:00 +0000 (11:38 -0800)
commitf58d9487afaf1e3eb6f037eada7437721efb4894
tree86d1667d951141c703df2163415ebd0c22738556
parent520cd03197de9d8430727b7caa588795383be30d
nbd: clear waiting_queue on shutdown

Bug-db: 13690
Backport upstream commit: fded4e090c60100d709318896c79816d68d5b47d
Fix a serious but uncommon bug in nbd which occurs when there is heavy
I/O going to the nbd device while, at the same time, a failure (server,
network) or manual disconnect of the nbd connection occurs.

There is a small window between the time that the nbd_thread is stopped
and the socket is shutdown where requests can continue to be queued to
nbd's internal waiting_queue.  When this happens, those requests are
never completed or freed.

The fix is to clear the waiting_queue on shutdown of the nbd device, in
the same way that the nbd request queue (queue_head) is already being
cleared.

Signed-off-by: Paul Clements <paul.clements@steeleye.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
Conflicts:
drivers/block/nbd.c
drivers/block/nbd.c