public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Should sd REALLY allocate a device for an offline device
@ 2003-03-14 16:50 Steve Brueggeman
  2003-03-14 19:33 ` Luben Tuikov
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Brueggeman @ 2003-03-14 16:50 UTC (permalink / raw)
  To: linux-scsi


There's a managed storage device that reports 0x20 in byte 0 of the
Inquiry data, which means it's a SCSI_DISK, but the LUN is detached.

scan_scsis_single() acknowledgs this, and marks the device as not
online, and lets the upper level device drivers decide what to do.

It is my belief that if a device is not online, the scsi disk driver
should not allocate a device slot for it.  See the following simple
patch.  Any thoughts?  It seems obvious to me, but maybe I'm missing
something.

diff -ruN -X dontdiff linux-2.4.20.orig/drivers/scsi/sd.c
linux-2.4.20.new/drivers/scsi/sd.c
--- linux-2.4.20.orig/drivers/scsi/sd.c	Fri Aug  2 19:39:44 2002
+++ linux-2.4.20.new/drivers/scsi/sd.c	Fri Mar 14 10:26:32 2003
@@ -1264,6 +1264,8 @@
 {
 	if (SDp->type != TYPE_DISK && SDp->type != TYPE_MOD)
 		return 0;
+	if (!SDp->online)
+		return 0;
 	sd_template.dev_noticed++;
 	return 1;
 }
@@ -1276,6 +1278,8 @@
 	char nbuff[6];
 
 	if (SDp->type != TYPE_DISK && SDp->type != TYPE_MOD)
+		return 0;
+	if (!SDp->online)
 		return 0;
 
 	if (sd_template.nr_dev >= sd_template.dev_max || rscsi_disks
== NULL) {



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Should sd REALLY allocate a device for an offline device
@ 2003-03-14 18:17 David.Egolf
  0 siblings, 0 replies; 3+ messages in thread
From: David.Egolf @ 2003-03-14 18:17 UTC (permalink / raw)
  To: Steve Brueggeman; +Cc: linux-scsi, linux-scsi-owner

Larger systems and servers work with intelligent disk arrays that provide 
various schemes for dynamic hardware mirroring.  For example, EMC 
Symmetrix Cached Disk Arrays have a feature called TimeFinder.  It allows 
the disk array to copy disk contents to other volumes in the disk array. 
When the mirrors are split apart, the copies are brought online to some 
system where they can be used for saves or data warehouse type access. 
While the mirrors are being copied, they are "offline" on their channels. 
A similar situation exists for mirrors which are maintained for disaster 
recovery purposes.  I know that EMC, Hitachi Data Systems, and others 
provide such features.

The "offline" devices can be in any particular state during a system boot. 
 They can go online and offline multiple times a day.





Steve Brueggeman <xioborg@yahoo.com>
Sent by: linux-scsi-owner@vger.kernel.org
03/14/2003 09:50 AM

 
        To:     linux-scsi@vger.kernel.org
        cc: 
        Subject:        Should sd REALLY allocate a device for an offline device



>There's a managed storage device that reports 0x20 in byte 0 of the
>Inquiry data, which means it's a SCSI_DISK, but the LUN is detached.
>
>scan_scsis_single() acknowledgs this, and marks the device as not
>online, and lets the upper level device drivers decide what to do.
>
>It is my belief that if a device is not online, the scsi disk driver
>should not allocate a device slot for it.  See the following simple
>patch.  Any thoughts?  It seems obvious to me, but maybe I'm missing
>something.
>
>diff -ruN -X dontdiff linux-2.4.20.orig/drivers/scsi/sd.c
>linux-2.4.20.new/drivers/scsi/sd.c
>--- linux-2.4.20.orig/drivers/scsi/sd.c                 Fri Aug  2 
19:39:44 2002
>+++ linux-2.4.20.new/drivers/scsi/sd.c          Fri Mar 14 10:26:32 2003
>@@ -1264,6 +1264,8 @@
> {
>                if (SDp->type != TYPE_DISK && SDp->type != TYPE_MOD)
>                                return 0;
>+               if (!SDp->online)
>+                               return 0;
>                sd_template.dev_noticed++;
>                return 1;
> }
>@@ -1276,6 +1278,8 @@
>                char nbuff[6];
> 
>                if (SDp->type != TYPE_DISK && SDp->type != TYPE_MOD)
>+                               return 0;
>+               if (!SDp->online)
>                                return 0;
> 
>                if (sd_template.nr_dev >= sd_template.dev_max || 
rscsi_disks
>== NULL) {
>
>
-
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

* Re: Should sd REALLY allocate a device for an offline device
  2003-03-14 16:50 Should sd REALLY allocate a device for an offline device Steve Brueggeman
@ 2003-03-14 19:33 ` Luben Tuikov
  0 siblings, 0 replies; 3+ messages in thread
From: Luben Tuikov @ 2003-03-14 19:33 UTC (permalink / raw)
  To: Steve Brueggeman; +Cc: linux-scsi

Steve Brueggeman wrote:
> There's a managed storage device that reports 0x20 in byte 0 of the
> Inquiry data, which means it's a SCSI_DISK, but the LUN is detached.

The physical device is not currently attached to the LU, but the device
is supported and we know a fait bit about it from the INQUIRY data.

> scan_scsis_single() acknowledgs this, and marks the device as not
> online, and lets the upper level device drivers decide what to do.

This is the right thing to do.

> It is my belief that if a device is not online, the scsi disk driver
> should not allocate a device slot for it.  See the following simple
> patch.  Any thoughts?  It seems obvious to me, but maybe I'm missing
> something.

As was already answered, a device being ``offline'' doesn't mean that's
it's not there.  In the simplest terms it means that the LU device server
cannot process any commands addressed to the physical device at this moment.

-- 
Luben



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-14 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-14 16:50 Should sd REALLY allocate a device for an offline device Steve Brueggeman
2003-03-14 19:33 ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2003-03-14 18:17 David.Egolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox