lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120119200109.17835.48500.stgit@beardog.cce.hp.com>
Date:	Thu, 19 Jan 2012 14:01:09 -0600
From:	"Stephen M. Cameron" <scameron@...rdog.cce.hp.com>
To:	james.bottomley@...senpartnership.com
Cc:	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
	mikem@...rdog.cce.hp.com, stephenmcameron@...il.com,
	thenzl@...hat.com, scott.teel@...com, akpm@...ux-foundation.org,
	stable@...nel.org
Subject: [PATCH 06/10] hpsa: make target and lun match what SCSI REPORT LUNs
	returns

From: Stephen M. Cameron <scameron@...rdog.cce.hp.com>

Some distros have a "rescan-scsi-bus.sh" script which depends on
SCSI REPORT LUNs not reporting something different than what the
driver tells the kernel, even if the driver uses scan_start and
scan_finished methods of the SCSI host template to override the
usual SCSI midlayer discovery code.  Previously, 1 was added to
the LUN to make room to insert the RAID controller device at
LUN 0.  Now, the RAID controller is moved to bus 3, and 1 is no
longer added to the LUN.  However, SCSI REPORT LUNS on Smart Array
doesn't report physical devices like tape drives or auto-loaders
as it turns out, so those particular device types still won't match.
Generally the logical drives are reported first however, so at
least those should match.

Signed-off-by: Stephen M. Cameron <scameron@...rdog.cce.hp.com>
---
 drivers/scsi/hpsa.c |   25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index b30033b..c52bc76 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1645,30 +1645,15 @@ static void figure_bus_target_lun(struct ctlr_info *h,
 			*target = (lunid >> 16) & 0x3fff;
 			*lun = lunid & 0x00ff;
 		} else {
-			if (likely(is_scsi_rev_5(h))) {
-				/* All current smart arrays (circa 2011) */
-				*bus = 0;
-				*target = 0;
-				*lun = (lunid & 0x3fff) + 1;
-			} else {
-				/* Traditional old smart array way. */
-				*bus = 0;
-				*target = lunid & 0x3fff;
-				*lun = 0;
-			}
+			*bus = 0;
+			*target = 0;
+			*lun = (lunid & 0x3fff);
 		}
 	} else {
-		/* physical device */
 		if (is_hba_lunid(lunaddrbytes))
-			if (unlikely(is_scsi_rev_5(h))) {
-				*bus = 0; /* put p1210m ctlr at 0,0,0 */
-				*target = 0;
-				*lun = 0;
-				return;
-			} else
-				*bus = 3; /* traditional smartarray */
+			*bus = 3; /* controller */
 		else
-			*bus = 2; /* physical disk */
+			*bus = 2; /* physical device */
 		*target = -1;
 		*lun = -1; /* we will fill these in later. */
 	}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ