Skip to contentSkip to conversation

aacraid: Add module param to export disks as 'fixed' instead of 'removable'

PATCH In review Ankit Jain 3 participants 5 messages May 17, 2011 – May 20, 2011

Subsystems (2)
lore
Share & tools
lore

Ankit Jain

author
#0 lore raw

PATCH 1/1 aacraid: Add module param to export disks as 'fixed' instead of 'removable'

aacraid: Add 'aac_export_fixed' module param to export disks as 'fixed' instead of 'removable'.

Adaptec controllers set the removable flag on devices to allow for reconfiguration. The fear is that _not_ setting this flag would inhibit the OS from detecting any device reconfiguration.

This manifested itself in a bug where Paravirtualized NetWare was not able to boot with more than one PHY disk attached to a Xen VM. NetWare sees two removable disks (and not CD-ROM), which is an unsupported configuration. Details can be found at -
https://bugzilla.novell.com/show_bug.cgi?id=667226 .

The module parameter allows overriding that flag.

---

drivers/scsi/aacraid/aachba.c +11 -4
index 7e26ebc..7f1b3e7 100644
@@ -224,6 +224,11 @@ MODULE_PARM_DESC(wwn, "Select a WWN type for the arrays:\n"
 	"\t1 - Array Meta Data Signature (default)\n"
 	"\t2 - Adapter Serial Number");
 
+int aac_export_fixed;
+module_param_named(export_fixed, aac_export_fixed, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(export_fixed, "Export disks as 'fixed' instead of"
+		 " removable.");
+
 
 static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
 		struct fib *fibptr) {
@@ -2212,8 +2217,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 			scsi_set_resid(scsicmd,
 				       scsi_bufflen(scsicmd) - alloc_len);
 
-		/* Do not cache partition table for arrays */
-		scsicmd->device->removable = 1;
+		if (!aac_export_fixed)
+			/* Do not cache partition table for arrays */
+			scsicmd->device->removable = 1;
 
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
 		scsicmd->scsi_done(scsicmd);
@@ -2241,8 +2247,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 		cp[6] = 2;
 		cp[7] = 0;
 		scsi_sg_copy_from_buffer(scsicmd, cp, sizeof(cp));
-		/* Do not cache partition table for arrays */
-		scsicmd->device->removable = 1;
+		if (!aac_export_fixed)
+			/* Do not cache partition table for arrays */
+			scsicmd->device->removable = 1;
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
 		  SAM_STAT_GOOD;
 		scsicmd->scsi_done(scsicmd);
drivers/scsi/aacraid/aacraid.h +1 -0
index 929cf67..a68c973 100644
@@ -1913,3 +1913,4 @@ extern int aac_commit;
 extern int update_interval;
 extern int check_interval;
 extern int aac_check_reset;
+extern int aac_export_fixed;
drivers/scsi/aacraid/linit.c +1 -1
index e9373a2..a5a4f81 100644
@@ -408,7 +408,7 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
 static int aac_slave_configure(struct scsi_device *sdev)
 {
 	struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;
-	if (aac->jbod && (sdev->type == TYPE_DISK))
+	if (!aac_export_fixed && aac->jbod && (sdev->type == TYPE_DISK))
 		sdev->removable = 1;
 	if ((sdev->type == TYPE_DISK) &&
 			(sdev_channel(sdev) != CONTAINER_CHANNEL) &&
#1 lore raw
Quoted 6 lines · Ankit Jain

aacraid: Add 'aac_export_fixed' module param to export disks as 'fixed' instead of 'removable'.

Adaptec controllers set the removable flag on devices to allow for reconfiguration. The fear is that _not_ setting this flag would inhibit the OS from detecting any device reconfiguration.

The flag should not be set at all and just be removed.

Quoted 5 lines

This manifested itself in a bug where Paravirtualized NetWare was not able to boot with more than one PHY disk attached to a Xen VM. NetWare sees two removable disks (and not CD-ROM), which is an unsupported configuration. Details can be found at -
https://bugzilla.novell.com/show_bug.cgi?id=667226 .

But if you can't get aacraid fixed entirely the next best work around is to stop Xen from blindly copying flags to the guest disk.

#2 lore raw
Quoted 7 lines · Ankit Jain
Quoted 5 lines

aacraid: Add 'aac_export_fixed' module param to export disks as 'fixed' instead of 'removable'.
Adaptec controllers set the removable flag on devices to allow for reconfiguration. The fear is that _not_ setting this flag would inhibit the OS from detecting any device reconfiguration.

The flag should not be set at all and just be removed.

This will break the RAID Management Software, and various Firmware features (snapshot, thin-provisioning etc)

Sincerely -- Mark Salyzyn
______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.

Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.

Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.

The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________

author
#3 lore raw
Quoted 10 lines · Mark Salyzyn
Quoted 7 lines · Ankit Jain
Quoted 5 lines

aacraid: Add 'aac_export_fixed' module param to export disks as 'fixed' instead of 'removable'.
Adaptec controllers set the removable flag on devices to allow for reconfiguration. The fear is that _not_ setting this flag would inhibit the OS from detecting any device reconfiguration.

The flag should not be set at all and just be removed.

This will break the RAID Management Software, and various Firmware features (snapshot, thin-provisioning etc)

I'm trying to get a better understanding. How do the RAID management software and firmware features depend on this?

Signature · 2 lines
Ankit Jain
SUSE Labs
#4 lore raw

There are several places where the transition from one RAID state to another results in Capacity changes, or partition table changes. Each change in state would walk the device nodes, and quite frankly, at a rapid pace.

There are several steps when creating an array, each step requires the updated information to be part of the system. These changes are initiated asynchronously by the Firmware (only access to kernel space), and not the Management Software (user space). The events that trigger these changes are reported as AIF (Adapter Initiated FIB) and trigger the rescan and target determination via APIs in the kernel. In one of the more critical states of array creation the partition table of the original targets can show on the array, then be cleared as the build starts.

Hotspares have a similar action where the legacy partition table information is erased, and this needs to be reflected on the system, without a node walk (the alternative to re-reading the partition tables, WWN and Capacity information is a node walk).

It is obvious the effect thin-provisioning would have on node-walking, snapshot is less obvious. The Firmware actually creates a new R/O device, but the original R/W device is replaced internally with the R/O device with a Journal to track and manage the R/W nature. There is a 'glitch' where the device changes state three times and one of those states resulted in a momentary increase in Capacity. They were not going to fix this, but no bother, the fact that the device is listed as Removable hid this problem from Linux.

Adaptec RAID controllers are not the only ones with this problem.

I am sure, given time, I can provide some additional cases.

Sincerely -- Mark Salyzyn

-----Original Message-----
From: Ankit Jain [mailto:[email protected]]
Sent: Friday, May 20, 2011 9:00 AM
To: Mark Salyzyn
Cc: Christoph Hellwig; [email protected]; [email protected]; Hannes Reinecke
Subject: Re: [PATCH] aacraid: Add module param to export disks as 'fixed' instead of 'removable'

Quoted 10 lines · Mark Salyzyn
Quoted 7 lines · Ankit Jain
Quoted 5 lines

aacraid: Add 'aac_export_fixed' module param to export disks as 'fixed' instead of 'removable'.
Adaptec controllers set the removable flag on devices to allow for reconfiguration. The fear is that _not_ setting this flag would inhibit the OS from detecting any device reconfiguration.

The flag should not be set at all and just be removed.

This will break the RAID Management Software, and various Firmware features (snapshot, thin-provisioning etc)

I'm trying to get a better understanding. How do the RAID management software and firmware features depend on this?

Signature · 11 lines
Ankit Jain
SUSE Labs
______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.
 
Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.
 
Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
 
The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________