dev_wait was meant to return table status not dev status.  [Alasdair Kergon]
--- diff/drivers/md/dm-ioctl.c	2003-10-16 10:44:58.000000000 +0100
+++ source/drivers/md/dm-ioctl.c	2003-10-16 10:45:01.000000000 +0100
@@ -768,6 +768,7 @@
 {
 	int r;
 	struct mapped_device *md;
+	struct dm_table *table;
 	DECLARE_WAITQUEUE(wq, current);
 
 	md = find_device(param);
@@ -790,7 +791,16 @@
 	 * him and save an ioctl.
 	 */
 	r = __dev_status(md, param);
+	if (r)
+		goto out;
+
+	table = dm_get_table(md);
+	if (table) {
+		retrieve_status(table, param, param_size);
+		dm_table_put(table);
+	}
 
+ out:
 	dm_put(md);
 	return r;
 }