2010-07-07 11:12:45 +00:00
|
|
|
From: Hannes Reinecke <hare@suse.de>
|
|
|
|
Subject: Disable partitions scan for multipathed devices
|
|
|
|
References: bnc#402922,bnc#514767
|
|
|
|
Patch-mainline: not yet
|
|
|
|
|
|
|
|
When multipath devices are being used as disks for VM Guests
|
|
|
|
any partition scanning / setup should be done within the VM Guest,
|
|
|
|
not from host. So we need to switch off partitions scanning via
|
|
|
|
kpartx there.
|
|
|
|
For this I've implemented a new feature 'no_partitions' which
|
|
|
|
just serves as a notifier to kpartx to _not_ create partitions
|
|
|
|
on these devices.
|
|
|
|
|
|
|
|
Patch ported to SLES11.
|
|
|
|
|
|
|
|
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
|
|
|
|
|
|
|
---
|
|
|
|
drivers/md/dm-mpath.c | 12 +++++++++++-
|
|
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/drivers/md/dm-mpath.c
|
|
|
|
+++ b/drivers/md/dm-mpath.c
|
|
|
|
@@ -57,6 +57,8 @@ struct priority_group {
|
|
|
|
struct list_head pgpaths;
|
|
|
|
};
|
|
|
|
|
|
|
|
+#define FEATURE_NO_PARTITIONS 1
|
|
|
|
+
|
|
|
|
/* Multipath context */
|
|
|
|
struct multipath {
|
|
|
|
struct list_head list;
|
|
|
|
@@ -83,6 +85,7 @@ struct multipath {
|
|
|
|
unsigned pg_init_retries; /* Number of times to retry pg_init */
|
|
|
|
unsigned pg_init_count; /* Number of times pg_init called */
|
2011-04-19 20:09:59 +00:00
|
|
|
unsigned pg_init_delay_msecs; /* Number of msecs before pg_init retry */
|
2010-07-07 11:12:45 +00:00
|
|
|
+ unsigned features; /* Additional selected features */
|
|
|
|
|
|
|
|
struct work_struct process_queued_ios;
|
|
|
|
struct list_head queued_ios;
|
2011-04-19 20:09:59 +00:00
|
|
|
@@ -852,6 +855,10 @@ static int parse_features(struct arg_set
|
2010-07-07 11:12:45 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (!strnicmp(param_name, MESG_STR("no_partitions"))) {
|
|
|
|
+ m->features |= FEATURE_NO_PARTITIONS;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
if (!strnicmp(param_name, MESG_STR("pg_init_retries")) &&
|
|
|
|
(argc >= 1)) {
|
|
|
|
r = read_param(_params + 1, shift(as),
|
2011-04-19 20:09:59 +00:00
|
|
|
@@ -1486,11 +1493,14 @@ static int multipath_status(struct dm_ta
|
2010-07-07 11:12:45 +00:00
|
|
|
else {
|
|
|
|
DMEMIT("%u ", m->queue_if_no_path +
|
2011-04-19 20:09:59 +00:00
|
|
|
(m->pg_init_retries > 0) * 2 +
|
|
|
|
- (m->pg_init_delay_msecs != DM_PG_INIT_DELAY_DEFAULT) * 2);
|
|
|
|
+ (m->pg_init_delay_msecs != DM_PG_INIT_DELAY_DEFAULT) * 2 +
|
2010-07-07 11:12:45 +00:00
|
|
|
+ (m->features & FEATURE_NO_PARTITIONS));
|
|
|
|
if (m->queue_if_no_path)
|
|
|
|
DMEMIT("queue_if_no_path ");
|
|
|
|
if (m->pg_init_retries)
|
|
|
|
DMEMIT("pg_init_retries %u ", m->pg_init_retries);
|
|
|
|
+ if (m->features & FEATURE_NO_PARTITIONS)
|
|
|
|
+ DMEMIT("no_partitions ");
|
2011-04-19 20:09:59 +00:00
|
|
|
if (m->pg_init_delay_msecs != DM_PG_INIT_DELAY_DEFAULT)
|
|
|
|
DMEMIT("pg_init_delay_msecs %u ", m->pg_init_delay_msecs);
|
2010-07-07 11:12:45 +00:00
|
|
|
}
|