aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/commsup.c
diff options
context:
space:
mode:
authorRajashekhara, Mahesh <Mahesh_Rajashekhara@adaptec.com>2010-05-10 07:29:25 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-05-16 22:58:27 -0400
commit9cccde93fed1ca988eb2fb17ab9194bf7b5ed1b0 (patch)
treeec928f9197c24c147ac6ac51ba981c9ca027ca77 /drivers/scsi/aacraid/commsup.c
parentda3cc679b247a22efe0746d129074015b278e64d (diff)
[SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
Problem description: -------------------- The problem reported by one of the customer was when a logical array is deleted(from the SDK, from the GUI, from arcconf) then the corresponding physical device (/dev/sdb, for example) is not removed from the Linux namespace. So you end up with a "dead" device entry. And some of the linux tools go slightly wonky. Solution: --------- Based on the notification from FW, the driver calls "scsi_remove_device" for the DELETED drive. This call not only informs the scsi device status to the SCSI mid layer and also it will remove corresponding scsi device entries from the Linux sysfs. Signed-off-by: Mahesh Rajashekhara <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r--drivers/scsi/aacraid/commsup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 69692b050e3c..70079146e203 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1133,6 +1133,9 @@ retry_next:
1133 if (device) { 1133 if (device) {
1134 switch (device_config_needed) { 1134 switch (device_config_needed) {
1135 case DELETE: 1135 case DELETE:
1136#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
1137 scsi_remove_device(device);
1138#else
1136 if (scsi_device_online(device)) { 1139 if (scsi_device_online(device)) {
1137 scsi_device_set_state(device, SDEV_OFFLINE); 1140 scsi_device_set_state(device, SDEV_OFFLINE);
1138 sdev_printk(KERN_INFO, device, 1141 sdev_printk(KERN_INFO, device,
@@ -1141,6 +1144,7 @@ retry_next:
1141 "array deleted" : 1144 "array deleted" :
1142 "enclosure services event"); 1145 "enclosure services event");
1143 } 1146 }
1147#endif
1144 break; 1148 break;
1145 case ADD: 1149 case ADD:
1146 if (!scsi_device_online(device)) { 1150 if (!scsi_device_online(device)) {
@@ -1155,12 +1159,16 @@ retry_next:
1155 case CHANGE: 1159 case CHANGE:
1156 if ((channel == CONTAINER_CHANNEL) 1160 if ((channel == CONTAINER_CHANNEL)
1157 && (!dev->fsa_dev[container].valid)) { 1161 && (!dev->fsa_dev[container].valid)) {
1162#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
1163 scsi_remove_device(device);
1164#else
1158 if (!scsi_device_online(device)) 1165 if (!scsi_device_online(device))
1159 break; 1166 break;
1160 scsi_device_set_state(device, SDEV_OFFLINE); 1167 scsi_device_set_state(device, SDEV_OFFLINE);
1161 sdev_printk(KERN_INFO, device, 1168 sdev_printk(KERN_INFO, device,
1162 "Device offlined - %s\n", 1169 "Device offlined - %s\n",
1163 "array failed"); 1170 "array failed");
1171#endif
1164 break; 1172 break;
1165 } 1173 }
1166 scsi_rescan_device(&device->sdev_gendev); 1174 scsi_rescan_device(&device->sdev_gendev);