Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Rajashekhara, Mahesh and committed by
James Bottomley
9cccde93 da3cc679

+11 -1
+3 -1
drivers/scsi/aacraid/aacraid.h
··· 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 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
+8
drivers/scsi/aacraid/commsup.c
··· 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, ··· 1144 1141 "array deleted" : 1145 1142 "enclosure services event"); 1146 1143 } 1144 + #endif 1147 1145 break; 1148 1146 case ADD: 1149 1147 if (!scsi_device_online(device)) { ··· 1159 1155 case CHANGE: 1160 1156 if ((channel == CONTAINER_CHANNEL) 1161 1157 && (!dev->fsa_dev[container].valid)) { 1158 + #if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE)) 1159 + scsi_remove_device(device); 1160 + #else 1162 1161 if (!scsi_device_online(device)) 1163 1162 break; 1164 1163 scsi_device_set_state(device, SDEV_OFFLINE); 1165 1164 sdev_printk(KERN_INFO, device, 1166 1165 "Device offlined - %s\n", 1167 1166 "array failed"); 1167 + #endif 1168 1168 break; 1169 1169 } 1170 1170 scsi_rescan_device(&device->sdev_gendev);