58 lines
1.7 KiB
Diff
58 lines
1.7 KiB
Diff
From 1e49f78505b2c4df193614d774bf46d067cda7d8 Mon Sep 17 00:00:00 2001
|
|
From: Douglas Gilbert <dgilbert@interlog.com>
|
|
Date: Thu, 29 Oct 2009 01:48:31 -0400
|
|
Subject: [PATCH] [SCSI] scsi_debug: fix Thin provisioning support
|
|
|
|
While testing scsi_debug with these patches I found a
|
|
problem with the Block Limits VPD page function. The
|
|
length returned by the inquiry_evpd_b0() function was
|
|
too short. A patch to fix that and a cosmetic change
|
|
(that the form factor of scsi_debug is less than 1.8
|
|
inches) is attached.
|
|
|
|
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
|
|
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
|
|
---
|
|
drivers/scsi/scsi_debug.c | 13 +++++++++----
|
|
1 files changed, 9 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
|
|
index cb4bf16..0b575c8 100644
|
|
--- a/drivers/scsi/scsi_debug.c
|
|
+++ b/drivers/scsi/scsi_debug.c
|
|
@@ -685,10 +685,12 @@ static int inquiry_evpd_89(unsigned char * arr)
|
|
}
|
|
|
|
|
|
+/* Block limits VPD page (SBC-3) */
|
|
static unsigned char vpdb0_data[] = {
|
|
- /* from 4th byte */ 0,0,0,4,
|
|
- 0,0,0x4,0,
|
|
- 0,0,0,64,
|
|
+ /* from 4th byte */ 0,0,0,4, 0,0,0x4,0, 0,0,0,64,
|
|
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
};
|
|
|
|
static int inquiry_evpd_b0(unsigned char * arr)
|
|
@@ -731,11 +733,14 @@ static int inquiry_evpd_b0(unsigned char * arr)
|
|
return sizeof(vpdb0_data);
|
|
}
|
|
|
|
+/* Block device characteristics VPD page (SBC-3) */
|
|
static int inquiry_evpd_b1(unsigned char *arr)
|
|
{
|
|
memset(arr, 0, 0x3c);
|
|
arr[0] = 0;
|
|
- arr[1] = 1;
|
|
+ arr[1] = 1; /* non rotating medium (e.g. solid state) */
|
|
+ arr[2] = 0;
|
|
+ arr[3] = 5; /* less than 1.8" */
|
|
|
|
return 0x3c;
|
|
}
|
|
--
|
|
1.6.5
|
|
|