[<prev] [next>] [day] [month] [year] [list]
Message-ID: <504131ea.3+adybT2Cu/nzX3r%paul.clements@steeleye.com>
Date: Fri, 31 Aug 2012 17:51:38 -0400
From: paul.clements@...eleye.com
To: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] nbd: clear waiting_queue on shutdown
From: Paul Clements <paul.clements@...eleye.com>
Signed-off-by: Paul Clements <paul.clements@...eleye.com>
---
nbd.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index d07c9f7..0c03411 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -449,6 +449,14 @@ static void nbd_clear_que(struct nbd_device *nbd)
req->errors++;
nbd_end_request(req);
}
+
+ while (!list_empty(&nbd->waiting_queue)) {
+ req = list_entry(nbd->waiting_queue.next, struct request,
+ queuelist);
+ list_del_init(&req->queuelist);
+ req->errors++;
+ nbd_end_request(req);
+ }
}
@@ -598,6 +606,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
nbd->file = NULL;
nbd_clear_que(nbd);
BUG_ON(!list_empty(&nbd->queue_head));
+ BUG_ON(!list_empty(&nbd->waiting_queue));
if (file)
fput(file);
return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists