Преглед на файлове

[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>
Rajashekhara, Mahesh преди 15 години
родител
ревизия
9cccde93fe
променени са 2 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 3 1
      drivers/scsi/aacraid/aacraid.h
  2. 8 0
      drivers/scsi/aacraid/commsup.c

+ 3 - 1
drivers/scsi/aacraid/aacraid.h

@@ -12,7 +12,7 @@
  *----------------------------------------------------------------------------*/
  *----------------------------------------------------------------------------*/
 
 
 #ifndef AAC_DRIVER_BUILD
 #ifndef AAC_DRIVER_BUILD
-# define AAC_DRIVER_BUILD 26000
+# define AAC_DRIVER_BUILD 26400
 # define AAC_DRIVER_BRANCH "-ms"
 # define AAC_DRIVER_BRANCH "-ms"
 #endif
 #endif
 #define MAXIMUM_NUM_CONTAINERS	32
 #define MAXIMUM_NUM_CONTAINERS	32
@@ -26,6 +26,8 @@
 #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
 #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
 #define AAC_MAX_32BIT_SGBCOUNT	((unsigned short)256)
 #define AAC_MAX_32BIT_SGBCOUNT	((unsigned short)256)
 
 
+#define AAC_DEBUG_INSTRUMENT_AIF_DELETE
+
 /*
 /*
  * These macros convert from physical channels to virtual channels
  * These macros convert from physical channels to virtual channels
  */
  */

+ 8 - 0
drivers/scsi/aacraid/commsup.c

@@ -1133,6 +1133,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 	if (device) {
 	if (device) {
 		switch (device_config_needed) {
 		switch (device_config_needed) {
 		case DELETE:
 		case DELETE:
+#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
+			scsi_remove_device(device);
+#else
 			if (scsi_device_online(device)) {
 			if (scsi_device_online(device)) {
 				scsi_device_set_state(device, SDEV_OFFLINE);
 				scsi_device_set_state(device, SDEV_OFFLINE);
 				sdev_printk(KERN_INFO, device,
 				sdev_printk(KERN_INFO, device,
@@ -1141,6 +1144,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 						"array deleted" :
 						"array deleted" :
 						"enclosure services event");
 						"enclosure services event");
 			}
 			}
+#endif
 			break;
 			break;
 		case ADD:
 		case ADD:
 			if (!scsi_device_online(device)) {
 			if (!scsi_device_online(device)) {
@@ -1155,12 +1159,16 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 		case CHANGE:
 		case CHANGE:
 			if ((channel == CONTAINER_CHANNEL)
 			if ((channel == CONTAINER_CHANNEL)
 			 && (!dev->fsa_dev[container].valid)) {
 			 && (!dev->fsa_dev[container].valid)) {
+#if (defined(AAC_DEBUG_INSTRUMENT_AIF_DELETE))
+				scsi_remove_device(device);
+#else
 				if (!scsi_device_online(device))
 				if (!scsi_device_online(device))
 					break;
 					break;
 				scsi_device_set_state(device, SDEV_OFFLINE);
 				scsi_device_set_state(device, SDEV_OFFLINE);
 				sdev_printk(KERN_INFO, device,
 				sdev_printk(KERN_INFO, device,
 					"Device offlined - %s\n",
 					"Device offlined - %s\n",
 					"array failed");
 					"array failed");
+#endif
 				break;
 				break;
 			}
 			}
 			scsi_rescan_device(&device->sdev_gendev);
 			scsi_rescan_device(&device->sdev_gendev);