Skip to content

Commit 9cccde9

Browse files
Rajashekhara, MaheshJames Bottomley
authored andcommitted
[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>
1 parent da3cc67 commit 9cccde9

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎drivers/scsi/aacraid/aacraid.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*----------------------------------------------------------------------------*/
1313

1414
#ifndef AAC_DRIVER_BUILD
15-
# define AAC_DRIVER_BUILD 26000
15+
# define AAC_DRIVER_BUILD 26400
1616
# define AAC_DRIVER_BRANCH "-ms"
1717
#endif
1818
#define MAXIMUM_NUM_CONTAINERS 32
@@ -26,6 +26,8 @@
2626
#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
2727
#define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)256)
2828

29+
#define AAC_DEBUG_INSTRUMENT_AIF_DELETE
30+
2931
/*
3032
* These macros convert from physical channels to virtual channels
3133
*/

‎drivers/scsi/aacraid/commsup.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
11331133
if (device) {
11341134
switch (device_config_needed) {
11351135
case DELETE:
1136+
#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
1137+
scsi_remove_device(device);
1138+
#else
11361139
if (scsi_device_online(device)) {
11371140
scsi_device_set_state(device, SDEV_OFFLINE);
11381141
sdev_printk(KERN_INFO, device,
@@ -1141,6 +1144,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
11411144
"array deleted" :
11421145
"enclosure services event");
11431146
}
1147+
#endif
11441148
break;
11451149
case ADD:
11461150
if (!scsi_device_online(device)) {
@@ -1155,12 +1159,16 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
11551159
case CHANGE:
11561160
if ((channel == CONTAINER_CHANNEL)
11571161
&& (!dev->fsa_dev[container].valid)) {
1162+
#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
1163+
scsi_remove_device(device);
1164+
#else
11581165
if (!scsi_device_online(device))
11591166
break;
11601167
scsi_device_set_state(device, SDEV_OFFLINE);
11611168
sdev_printk(KERN_INFO, device,
11621169
"Device offlined - %s\n",
11631170
"array failed");
1171+
#endif
11641172
break;
11651173
}
11661174
scsi_rescan_device(&device->sdev_gendev);

0 commit comments

Comments
 (0)