]> git.ipfire.org Git - people/ummeegge/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.suse/dm-mpath-no-partitions-feature
Imported linux-2.6.27.39 suse/xen patches.
[people/ummeegge/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.suse / dm-mpath-no-partitions-feature
CommitLineData
2cb7cef9
BS
1From: Hannes Reinecke <hare@suse.de>
2Subject: Disable partitions scan for multipathed devices
3References: bnc#402922,bnc#514767
4
5When multipath devices are being used as disks for VM Guests
6any partition scanning / setup should be done within the VM Guest,
7not from host. So we need to switch off partitions scanning via
8kpartx there.
9For this I've implemented a new feature 'no_partitions' which
10just serves as a notifier to kpartx to _not_ create partitions
11on these devices.
12
13Patch ported to SLES11.
14
15Signed-off-by: Hannes Reinecke <hare@suse.de>
16
17---
18 drivers/md/dm-mpath.c | 12 +++++++++++-
19 1 file changed, 11 insertions(+), 1 deletion(-)
20
21--- a/drivers/md/dm-mpath.c
22+++ b/drivers/md/dm-mpath.c
23@@ -55,6 +55,8 @@ struct priority_group {
24 struct list_head pgpaths;
25 };
26
27+#define FEATURE_NO_PARTITIONS 1
28+
29 /* Multipath context */
30 struct multipath {
31 struct list_head list;
32@@ -79,6 +81,7 @@ struct multipath {
33 unsigned saved_queue_if_no_path;/* Saved state during suspension */
34 unsigned pg_init_retries; /* Number of times to retry pg_init */
35 unsigned pg_init_count; /* Number of times pg_init called */
36+ unsigned features; /* Additional selected features */
37
38 struct work_struct process_queued_ios;
39 struct list_head queued_ios;
40@@ -802,6 +805,10 @@ static int parse_features(struct arg_set
41 continue;
42 }
43
44+ if (!strnicmp(param_name, MESG_STR("no_partitions"))) {
45+ m->features |= FEATURE_NO_PARTITIONS;
46+ continue;
47+ }
48 if (!strnicmp(param_name, MESG_STR("pg_init_retries")) &&
49 (argc >= 1)) {
50 r = read_param(_params + 1, shift(as),
51@@ -1321,11 +1328,14 @@ static int multipath_status(struct dm_ta
52 DMEMIT("2 %u %u ", m->queue_size, m->pg_init_count);
53 else {
54 DMEMIT("%u ", m->queue_if_no_path +
55- (m->pg_init_retries > 0) * 2);
56+ (m->pg_init_retries > 0) * 2 +
57+ (m->features & FEATURE_NO_PARTITIONS));
58 if (m->queue_if_no_path)
59 DMEMIT("queue_if_no_path ");
60 if (m->pg_init_retries)
61 DMEMIT("pg_init_retries %u ", m->pg_init_retries);
62+ if (m->features & FEATURE_NO_PARTITIONS)
63+ DMEMIT("no_partitions ");
64 }
65
66 if (!m->hw_handler_name || type == STATUSTYPE_INFO)