* [PATCH] Associate HBA and storage in rdac_controller to support partitions in storage
@ 2011-07-20 21:22 Chandra Seetharaman
2011-07-27 10:34 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Chandra Seetharaman @ 2011-07-20 21:22 UTC (permalink / raw)
To: linux-scsi; +Cc: dm-devel, Moger, Babu, yanling.Qi, Stankey, Robert
rdac hardware handler assumes that there is one-to-one relation ship
between the host and the controller w.r.t lun. IOW, it does not
support "multiple storage partitions" within a storage.
Example:
HBA1 and HBA2 see lun 0 and 1 in storage A (1)
HBA3 and HBA4 see lun 0 and 1 in storage A (2)
HBA5 and HBA6 see lun 0 and 1 in storage A (3)
luns 0 and 1 in (1), (2) and (3) are totally different.
But, rdac handler treats the lun 0s (and lun 1s) as the same when
sending a mode select to the controller, which is wrong.
This patch makes the rdac hardware handler associate HBA and the
storage w.r.t lun (and not the host itself).
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
drivers/scsi/device_handler/scsi_dh_rdac.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 214d7f0..67c2c99 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -149,6 +149,7 @@ struct rdac_controller {
} mode_select;
u8 index;
u8 array_name[ARRAY_LABEL_LEN];
+ struct Scsi_Host *host;
spinlock_t ms_lock;
int ms_queued;
struct work_struct ms_work;
@@ -380,7 +381,7 @@ static void release_controller(struct kref *kref)
}
static struct rdac_controller *get_controller(u8 *serial, int index,
- char *array_name)
+ char *array_name, struct scsi_device *sdev)
{
struct rdac_controller *ctlr, *tmp;
@@ -388,7 +389,8 @@ static struct rdac_controller *get_controller(u8 *serial, int index,
list_for_each_entry(tmp, &ctlr_list, node) {
if ((memcmp(tmp->serial, serial, SERIAL_NO_LEN) == 0) &&
- (tmp->index == index)) {
+ (tmp->index == index) &&
+ (tmp->host == sdev->host)) {
kref_get(&tmp->kref);
spin_unlock(&list_lock);
return tmp;
@@ -402,6 +404,7 @@ static struct rdac_controller *get_controller(u8 *serial, int index,
memcpy(ctlr->serial, serial, SERIAL_NO_LEN);
memcpy(ctlr->array_name, array_name, ARRAY_LABEL_LEN);
ctlr->index = index;
+ ctlr->host = sdev->host;
kref_init(&ctlr->kref);
ctlr->use_ms10 = -1;
@@ -525,7 +528,8 @@ static int initialize_controller(struct scsi_device *sdev,
if (err != SCSI_DH_OK)
return err;
inq_p80 = &h->inq.p80;
- h->ctlr = get_controller(inq_p80->serial, index, array_name);
+ h->ctlr = get_controller(inq_p80->serial, index,
+ array_name, sdev);
if (!h->ctlr)
err = SCSI_DH_RES_TEMP_UNAVAIL;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Associate HBA and storage in rdac_controller to support partitions in storage
2011-07-20 21:22 [PATCH] Associate HBA and storage in rdac_controller to support partitions in storage Chandra Seetharaman
@ 2011-07-27 10:34 ` James Bottomley
2011-07-27 18:20 ` Chandra Seetharaman
0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2011-07-27 10:34 UTC (permalink / raw)
To: sekharan; +Cc: linux-scsi, dm-devel, Moger, Babu, yanling.Qi, Stankey, Robert
On Wed, 2011-07-20 at 14:22 -0700, Chandra Seetharaman wrote:
> rdac hardware handler assumes that there is one-to-one relation ship
> between the host and the controller w.r.t lun. IOW, it does not
> support "multiple storage partitions" within a storage.
>
> Example:
> HBA1 and HBA2 see lun 0 and 1 in storage A (1)
> HBA3 and HBA4 see lun 0 and 1 in storage A (2)
> HBA5 and HBA6 see lun 0 and 1 in storage A (3)
>
> luns 0 and 1 in (1), (2) and (3) are totally different.
>
> But, rdac handler treats the lun 0s (and lun 1s) as the same when
> sending a mode select to the controller, which is wrong.
>
> This patch makes the rdac hardware handler associate HBA and the
> storage w.r.t lun (and not the host itself).
>
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> ---
> drivers/scsi/device_handler/scsi_dh_rdac.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
This doesn't apply;
patching file drivers/scsi/device_handler/scsi_dh_rdac.c
Hunk #1 succeeded at 158 (offset 9 lines).
Hunk #2 FAILED at 381.
Hunk #3 FAILED at 389.
Hunk #4 FAILED at 403.
Hunk #5 FAILED at 526.
4 out of 5 hunks FAILED -- saving rejects to file
drivers/scsi/device_handler/scsi_dh_rdac.c.rej
it looks like there's a missing intermediate patch somewhere, can you
check scsi-misc and tell me what it is?
Thanks,
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Associate HBA and storage in rdac_controller to support partitions in storage
2011-07-27 10:34 ` James Bottomley
@ 2011-07-27 18:20 ` Chandra Seetharaman
0 siblings, 0 replies; 3+ messages in thread
From: Chandra Seetharaman @ 2011-07-27 18:20 UTC (permalink / raw)
To: James Bottomley
Cc: linux-scsi, dm-devel, Moger, Babu, yanling.Qi, Stankey, Robert
Oops. Sorry. By mistake sent an earlier version. Will send the correct
version.
On Wed, 2011-07-27 at 14:34 +0400, James Bottomley wrote:
> On Wed, 2011-07-20 at 14:22 -0700, Chandra Seetharaman wrote:
> > rdac hardware handler assumes that there is one-to-one relation ship
> > between the host and the controller w.r.t lun. IOW, it does not
> > support "multiple storage partitions" within a storage.
> >
> > Example:
> > HBA1 and HBA2 see lun 0 and 1 in storage A (1)
> > HBA3 and HBA4 see lun 0 and 1 in storage A (2)
> > HBA5 and HBA6 see lun 0 and 1 in storage A (3)
> >
> > luns 0 and 1 in (1), (2) and (3) are totally different.
> >
> > But, rdac handler treats the lun 0s (and lun 1s) as the same when
> > sending a mode select to the controller, which is wrong.
> >
> > This patch makes the rdac hardware handler associate HBA and the
> > storage w.r.t lun (and not the host itself).
> >
> > Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> > ---
> > drivers/scsi/device_handler/scsi_dh_rdac.c | 10 +++++++---
> > 1 files changed, 7 insertions(+), 3 deletions(-)
>
> This doesn't apply;
>
> patching file drivers/scsi/device_handler/scsi_dh_rdac.c
> Hunk #1 succeeded at 158 (offset 9 lines).
> Hunk #2 FAILED at 381.
> Hunk #3 FAILED at 389.
> Hunk #4 FAILED at 403.
> Hunk #5 FAILED at 526.
> 4 out of 5 hunks FAILED -- saving rejects to file
> drivers/scsi/device_handler/scsi_dh_rdac.c.rej
>
>
> it looks like there's a missing intermediate patch somewhere, can you
> check scsi-misc and tell me what it is?
>
> Thanks,
>
> James
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-27 18:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-20 21:22 [PATCH] Associate HBA and storage in rdac_controller to support partitions in storage Chandra Seetharaman
2011-07-27 10:34 ` James Bottomley
2011-07-27 18:20 ` Chandra Seetharaman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox