From f7627f7e674fb550659050e01d903a649fe337a9 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 11 Jun 2012 19:10:29 +0000 Subject: [PATCH] Fix recent READ CAPACITY(10) regression. Also increase NULLIO devices size to be able to test it. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4341 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index e6a158fa5..cc53ff2de 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -111,7 +111,7 @@ static struct scst_trace_log vdisk_local_trace_tbl[] = { #define DEF_ROTATIONAL 1 #define DEF_THIN_PROVISIONED 0 -#define VDISK_NULLIO_SIZE (3LL*1024*1024*1024*1024/2) +#define VDISK_NULLIO_SIZE (5LL*1024*1024*1024*1024/2) #define DEF_TST SCST_CONTR_MODE_SEP_TASK_SETS @@ -2994,9 +2994,9 @@ static enum compl_status_e vdisk_exec_read_capacity(struct vdisk_cmd_params *p) } } - /* Last block on the virt_dev is (nblocks-1) */ memset(buffer, 0, sizeof(buffer)); + /* Last block on the virt_dev is (nblocks-1) */ #if 0 /* we don't need this workaround anymore */ /* * If we are thinly provisioned, we must ensure that the initiator @@ -3005,6 +3005,8 @@ static enum compl_status_e vdisk_exec_read_capacity(struct vdisk_cmd_params *p) */ put_unaligned_be32(nblocks >> 32 || virt_dev->thin_provisioned ? 0xffffffffU : nblocks - 1, &buffer[0]); +#else + put_unaligned_be32((nblocks >> 32) ? 0xffffffffU : nblocks - 1, &buffer[0]); #endif put_unaligned_be32(blocksize, &buffer[4]);