From 226e13c9da0a126d49d75a0b3f17aff6b3e5e595 Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Tue, 23 Aug 2011 15:47:21 -0400 Subject: [CRAZY RFC PATCH 3/4] dm table: disallow stacking request-based DM devices Now that request-based DM is using shared mempools it is increasingly risky to stack request-based DM devices. That said, the only consumer of request-based DM is dm-multipath and it has no need for stacking. Not-Signed-off-by: Mike Snitzer --- drivers/md/dm-table.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index d082f2a..e78cb62 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -883,6 +883,7 @@ static int dm_table_set_type(struct dm_table *t) struct dm_target *tgt; struct dm_dev_internal *dd; struct list_head *devices; + struct mapped_device *md; for (i = 0; i < t->num_targets; i++) { tgt = t->targets + i; @@ -914,6 +915,14 @@ static int dm_table_set_type(struct dm_table *t) " non-request-stackable devices"); return -EINVAL; } + + md = dm_get_md(disk_devt(dd->dm_dev.bdev->bd_disk)); + if (md) { + DMWARN("table load rejected: including" + " request-based DM devices"); + dm_put(md); + return -EINVAL; + } } /* -- 1.7.1