List Info

Thread: dm-table should check for valid queue




dm-table should check for valid queue
user name
2006-08-10 11:29:08
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
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
--
dm-devel mailing list
dm-develredhat.com
http
s://www.redhat.com/mailman/listinfo/dm-devel
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )