linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] scsilun_to_int should ignore the highest 2 bits
@ 2013-06-06  8:18 Jan Vesely
  2013-06-06  8:42 ` Hannes Reinecke
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Vesely @ 2013-06-06  8:18 UTC (permalink / raw)
  To: linux-scsi, linux-kernel; +Cc: James Bottomley, Dan Williams

From: Jan Vesely <jvesely@redhat.com>

The comment says the function does this but it does not.
Reported luns change from weirdly high numbers (like 16640)
to something saner (256), when using flat space addressing.

CC: James Bottomley <JBottomley@Parallels.com>
CC: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jan Vesely <jvesely@redhat.com>
---
 drivers/scsi/scsi_scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 3e58b22..38dc093 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1244,7 +1244,7 @@ int scsilun_to_int(struct scsi_lun *scsilun)
 
 	lun = 0;
 	for (i = 0; i < sizeof(lun); i += 2)
-		lun = lun | (((scsilun->scsi_lun[i] << 8) |
+		lun = lun | ((((scsilun->scsi_lun[i] & 0x3f) << 8) |
 			      scsilun->scsi_lun[i + 1]) << (i * 8));
 	return lun;
 }
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-06  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06  8:18 [PATCH] [SCSI] scsilun_to_int should ignore the highest 2 bits Jan Vesely
2013-06-06  8:42 ` Hannes Reinecke
2013-06-06  9:46   ` Jan Vesely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).