Commit 9cccde93fed1ca988eb2fb17ab9194bf7b5ed1b0

Authored by Rajashekhara, Mahesh
Committed by James Bottomley
1 parent da3cc679b2

[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>

Showing 2 changed files with 11 additions and 1 deletions Side-by-side Diff

drivers/scsi/aacraid/aacraid.h
... ... @@ -12,7 +12,7 @@
12 12 *----------------------------------------------------------------------------*/
13 13  
14 14 #ifndef AAC_DRIVER_BUILD
15   -# define AAC_DRIVER_BUILD 26000
  15 +# define AAC_DRIVER_BUILD 26400
16 16 # define AAC_DRIVER_BRANCH "-ms"
17 17 #endif
18 18 #define MAXIMUM_NUM_CONTAINERS 32
... ... @@ -25,6 +25,8 @@
25 25  
26 26 #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
27 27 #define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)256)
  28 +
  29 +#define AAC_DEBUG_INSTRUMENT_AIF_DELETE
28 30  
29 31 /*
30 32 * These macros convert from physical channels to virtual channels
drivers/scsi/aacraid/commsup.c
... ... @@ -1133,6 +1133,9 @@
1133 1133 if (device) {
1134 1134 switch (device_config_needed) {
1135 1135 case DELETE:
  1136 +#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
  1137 + scsi_remove_device(device);
  1138 +#else
1136 1139 if (scsi_device_online(device)) {
1137 1140 scsi_device_set_state(device, SDEV_OFFLINE);
1138 1141 sdev_printk(KERN_INFO, device,
... ... @@ -1141,6 +1144,7 @@
1141 1144 "array deleted" :
1142 1145 "enclosure services event");
1143 1146 }
  1147 +#endif
1144 1148 break;
1145 1149 case ADD:
1146 1150 if (!scsi_device_online(device)) {
1147 1151  
... ... @@ -1155,12 +1159,16 @@
1155 1159 case CHANGE:
1156 1160 if ((channel == CONTAINER_CHANNEL)
1157 1161 && (!dev->fsa_dev[container].valid)) {
  1162 +#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
  1163 + scsi_remove_device(device);
  1164 +#else
1158 1165 if (!scsi_device_online(device))
1159 1166 break;
1160 1167 scsi_device_set_state(device, SDEV_OFFLINE);
1161 1168 sdev_printk(KERN_INFO, device,
1162 1169 "Device offlined - %s\n",
1163 1170 "array failed");
  1171 +#endif
1164 1172 break;
1165 1173 }
1166 1174 scsi_rescan_device(&device->sdev_gendev);