aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2008-10-10 08:37:13 -0400
committerAlasdair G Kergon <agk@redhat.com>2008-10-10 08:37:13 -0400
commit0c2322e4ce144e130c03d813fe92de3798662c5e (patch)
treea42eeb1a75d9e70a20a6d4d850064ba8292c2289 /drivers/md/dm-table.c
parent54160904260fa764ba6e2dc738770be30fdf9553 (diff)
dm: detect lost queue
Detect and report buggy drivers that destroy their request_queue. Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: Stefan Raspl <raspl@linux.vnet.ibm.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5dd32b8a57ac..a740a6950f59 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -482,6 +482,13 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev)
482{ 482{
483 struct request_queue *q = bdev_get_queue(bdev); 483 struct request_queue *q = bdev_get_queue(bdev);
484 struct io_restrictions *rs = &ti->limits; 484 struct io_restrictions *rs = &ti->limits;
485 char b[BDEVNAME_SIZE];
486
487 if (unlikely(!q)) {
488 DMWARN("%s: Cannot set limits for nonexistent device %s",
489 dm_device_name(ti->table->md), bdevname(bdev, b));
490 return;
491 }
485 492
486 /* 493 /*
487 * Combine the device limits low. 494 * Combine the device limits low.
@@ -950,7 +957,14 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits)
950 957
951 list_for_each_entry(dd, devices, list) { 958 list_for_each_entry(dd, devices, list) {
952 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev); 959 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev);
953 r |= bdi_congested(&q->backing_dev_info, bdi_bits); 960 char b[BDEVNAME_SIZE];
961
962 if (likely(q))
963 r |= bdi_congested(&q->backing_dev_info, bdi_bits);
964 else
965 DMWARN_LIMIT("%s: any_congested: nonexistent device %s",
966 dm_device_name(t->md),
967 bdevname(dd->dm_dev.bdev, b));
954 } 968 }
955 969
956 return r; 970 return r;
@@ -963,8 +977,14 @@ void dm_table_unplug_all(struct dm_table *t)
963 977
964 list_for_each_entry(dd, devices, list) { 978 list_for_each_entry(dd, devices, list) {
965 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev); 979 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev);
966 980 char b[BDEVNAME_SIZE];
967 blk_unplug(q); 981
982 if (likely(q))
983 blk_unplug(q);
984 else
985 DMWARN_LIMIT("%s: Cannot unplug nonexistent device %s",
986 dm_device_name(t->md),
987 bdevname(dd->dm_dev.bdev, b));
968 } 988 }
969} 989}
970 990