]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | Subject: cciss driver may panic if a logical volume is deleted |
2 | From: Hannes Reinecke <hare@suse.de> | |
3 | Date: Wed Jan 7 12:32:12 2009 +0100: | |
4 | References: bnc#459553 | |
5 | ||
6 | If the customer uses either ACUXE or hpacucli to delete a logical volume the | |
7 | Smart Array driver may panic. If the logical volume is in the middle of an | |
8 | array the driver will panic every time. | |
9 | ||
10 | Signed-off-by: Mike Miller <mike.miller@hp.com> | |
11 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
12 | ||
13 | --- | |
14 | drivers/block/cciss.c | 16 +++++++++------- | |
15 | 1 file changed, 9 insertions(+), 7 deletions(-) | |
16 | ||
17 | --- a/drivers/block/cciss.c | |
18 | +++ b/drivers/block/cciss.c | |
19 | @@ -164,7 +164,7 @@ static int cciss_getgeo(struct block_dev | |
20 | ||
21 | static int cciss_revalidate(struct gendisk *disk); | |
22 | static int rebuild_lun_table(ctlr_info_t *h, int first_time); | |
23 | -static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, | |
24 | +static int deregister_disk(ctlr_info_t *h, int drv_index, | |
25 | int clear_all); | |
26 | ||
27 | static void cciss_read_capacity(int ctlr, int logvol, int withirq, | |
28 | @@ -1491,8 +1491,7 @@ static void cciss_update_drive_info(int | |
29 | * which keeps the interrupt handler from starting | |
30 | * the queue. | |
31 | */ | |
32 | - ret = deregister_disk(h->gendisk[drv_index], | |
33 | - &h->drv[drv_index], 0); | |
34 | + ret = deregister_disk(h, drv_index, 0); | |
35 | h->drv[drv_index].busy_configuring = 0; | |
36 | } | |
37 | ||
38 | @@ -1710,8 +1709,7 @@ static int rebuild_lun_table(ctlr_info_t | |
39 | spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags); | |
40 | h->drv[i].busy_configuring = 1; | |
41 | spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); | |
42 | - return_code = deregister_disk(h->gendisk[i], | |
43 | - &h->drv[i], 1); | |
44 | + return_code = deregister_disk(h, i, 1); | |
45 | h->drv[i].busy_configuring = 0; | |
46 | } | |
47 | } | |
48 | @@ -1781,15 +1779,19 @@ mem_msg: | |
49 | * the highest_lun should be left unchanged and the LunID | |
50 | * should not be cleared. | |
51 | */ | |
52 | -static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, | |
53 | +static int deregister_disk(ctlr_info_t *h, int drv_index, | |
54 | int clear_all) | |
55 | { | |
56 | int i; | |
57 | - ctlr_info_t *h = get_host(disk); | |
58 | + struct gendisk *disk; | |
59 | + drive_info_struct *drv; | |
60 | ||
61 | if (!capable(CAP_SYS_RAWIO)) | |
62 | return -EPERM; | |
63 | ||
64 | + drv = &h->drv[drv_index]; | |
65 | + disk = h->gendisk[drv_index]; | |
66 | + | |
67 | /* make sure logical volume is NOT is use */ | |
68 | if (clear_all || (h->gendisk[0] == disk)) { | |
69 | if (drv->usage_count > 1) |