aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nbd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index d07c9f7fded6..0c03411c59eb 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -449,6 +449,14 @@ static void nbd_clear_que(struct nbd_device *nbd)
449 req->errors++; 449 req->errors++;
450 nbd_end_request(req); 450 nbd_end_request(req);
451 } 451 }
452
453 while (!list_empty(&nbd->waiting_queue)) {
454 req = list_entry(nbd->waiting_queue.next, struct request,
455 queuelist);
456 list_del_init(&req->queuelist);
457 req->errors++;
458 nbd_end_request(req);
459 }
452} 460}
453 461
454 462
@@ -598,6 +606,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
598 nbd->file = NULL; 606 nbd->file = NULL;
599 nbd_clear_que(nbd); 607 nbd_clear_que(nbd);
600 BUG_ON(!list_empty(&nbd->queue_head)); 608 BUG_ON(!list_empty(&nbd->queue_head));
609 BUG_ON(!list_empty(&nbd->waiting_queue));
601 if (file) 610 if (file)
602 fput(file); 611 fput(file);
603 return 0; 612 return 0;