All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ankit Jain <jankit@suse.de>
To: linux-scsi@vger.kernel.org, aacraid@adaptec.com
Cc: Hannes Reinecke <hare@suse.de>
Subject: [PATCH] aacraid: Add module param to export disks as 'fixed' instead of 'removable'
Date: Wed, 18 May 2011 01:05:29 +0530	[thread overview]
Message-ID: <4DD2CE01.9090403@suse.de> (raw)

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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 7e26ebc..7f1b3e7 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -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);
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 929cf67..a68c973 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -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;
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index e9373a2..a5a4f81 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -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) &&

             reply	other threads:[~2011-05-17 19:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 19:35 Ankit Jain [this message]
2011-05-17 19:35 ` [PATCH] aacraid: Add module param to export disks as 'fixed' instead of 'removable' Christoph Hellwig
2011-05-18 20:21   ` Mark Salyzyn
2011-05-20 12:59     ` Ankit Jain
2011-05-20 13:31       ` Mark Salyzyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DD2CE01.9090403@suse.de \
    --to=jankit@suse.de \
    --cc=aacraid@adaptec.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.