* [PATCH and question]: dm-table should check for valid queue
@ 2006-08-10 11:29 Stefan Bader
2006-08-14 18:12 ` Alasdair G Kergon
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Bader @ 2006-08-10 11:29 UTC (permalink / raw)
To: dm-devel
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
Hi,
in some cases it is possible that bdev_get_queue() returns NULL. And
there are some places where device-mapper just uses the returned pointer
to call queue functions. The attached patch adds this to
dm_table_unplug_all() and dm_table_flush_all(). I treated a device
without a queue as sort of successfully flushed. Is this what would be
expected?
Same problem with dm_table_any_congested() which I didn't change, yet.
This function should probably also check before using
q->backing_dev_info. But what effect should a missing queue have? Same
as device is congested or not or let the call fail somehow?
Regards,
Stefan Bader
[-- Attachment #2: dm-table-checkreqq.diff --]
[-- Type: text/plain, Size: 692 bytes --]
diff -Nurp linux-RHEL4/drivers/md/dm-table.c linux-RHEL4-BTM/drivers/md/dm-table.c
--- linux-RHEL4/drivers/md/dm-table.c 2006-08-07 13:15:30.000000000 +0200
+++ linux-RHEL4-BTM/drivers/md/dm-table.c 2005-10-06 15:34:15.000000000 +0200
@@ -917,7 +917,7 @@ void dm_table_unplug_all(struct dm_table
struct dm_dev *dd = list_entry(d, struct dm_dev, list);
request_queue_t *q = bdev_get_queue(dd->bdev);
- if (q && q->unplug_fn)
+ if (q->unplug_fn)
q->unplug_fn(q);
}
}
@@ -932,9 +932,6 @@ int dm_table_flush_all(struct dm_table *
request_queue_t *q = bdev_get_queue(dd->bdev);
int err;
- if (!q)
- continue;
-
if (!q->issue_flush_fn)
err = -EOPNOTSUPP;
else
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-14 18:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-10 11:29 [PATCH and question]: dm-table should check for valid queue Stefan Bader
2006-08-14 18:12 ` Alasdair G Kergon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.