]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.arch/s390-03-05-dasd-block-uevent.patch
Disable build of xen kernel.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.arch / s390-03-05-dasd-block-uevent.patch
1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: dasd: DASD uevents are not sent correctly
3 References: bnc#440610,LTC#49429
4
5 Symptom: by-id device links are not created
6 Problem: On SLES10 there was an extra patch that would send
7 uevents for a DASD block device when it reached the
8 online state. This code was never upstream and is now
9 missing from SLES11.
10 Solution: Send change events when device reaches or leaves online
11 state.
12
13 Acked-by: John Jolly <jjolly@suse.de>
14 ---
15 drivers/s390/block/dasd.c | 33 ++++++++++++++++++++++++++++++---
16 1 file changed, 30 insertions(+), 3 deletions(-)
17
18 Index: linux-sles11/drivers/s390/block/dasd.c
19 ===================================================================
20 --- linux-sles11.orig/drivers/s390/block/dasd.c
21 +++ linux-sles11/drivers/s390/block/dasd.c
22 @@ -335,7 +335,9 @@ static int dasd_state_unfmt_to_basic(str
23 static int
24 dasd_state_ready_to_online(struct dasd_device * device)
25 {
26 - int rc;
27 + int rc, i;
28 + struct gendisk *disk;
29 + struct hd_struct *p;
30
31 if (device->discipline->ready_to_online) {
32 rc = device->discipline->ready_to_online(device);
33 @@ -343,8 +345,19 @@ dasd_state_ready_to_online(struct dasd_d
34 return rc;
35 }
36 device->state = DASD_STATE_ONLINE;
37 - if (device->block)
38 + if (device->block) {
39 dasd_schedule_block_bh(device->block);
40 +
41 + disk = device->block->bdev->bd_disk;
42 + kobject_uevent(&disk->dev.kobj, KOBJ_CHANGE);
43 + /* send uevents for all partitions */
44 + for (i = 1; i < disk->minors; i++) {
45 + p = disk->part[i-1];
46 + if (!p || !p->nr_sects)
47 + continue;
48 + kobject_uevent(&p->dev.kobj, KOBJ_CHANGE);
49 + }
50 + }
51 return 0;
52 }
53
54 @@ -353,7 +366,9 @@ dasd_state_ready_to_online(struct dasd_d
55 */
56 static int dasd_state_online_to_ready(struct dasd_device *device)
57 {
58 - int rc;
59 + int rc, i;
60 + struct gendisk *disk;
61 + struct hd_struct *p;
62
63 if (device->discipline->online_to_ready) {
64 rc = device->discipline->online_to_ready(device);
65 @@ -361,6 +376,18 @@ static int dasd_state_online_to_ready(st
66 return rc;
67 }
68 device->state = DASD_STATE_READY;
69 +
70 + /* send uevents for all partitions */
71 + if (device->block) {
72 + disk = device->block->bdev->bd_disk;
73 + for (i = 1; i < disk->minors; i++) {
74 + p = disk->part[i-1];
75 + if (!p || !p->nr_sects)
76 + continue;
77 + kobject_uevent(&p->dev.kobj, KOBJ_CHANGE);
78 + }
79 + kobject_uevent(&disk->dev.kobj, KOBJ_CHANGE);
80 + }
81 return 0;
82 }
83