* [Qemu-devel] [PATCH] Fix incorrect calculation of iscsi number of blocks
@ 2012-05-04 8:15 Ronnie Sahlberg
2012-05-04 8:15 ` [Qemu-devel] [PATCH] ISCSI: Readcapacity retruned the lba of the last sector. Total number of sectors is one more Ronnie Sahlberg
0 siblings, 1 reply; 3+ messages in thread
From: Ronnie Sahlberg @ 2012-05-04 8:15 UTC (permalink / raw)
To: kwolf, pbonzini, qemu-devel
List,
READCAPACITY16 returns the LBA of the last accessible block.
Number of blocks is one greater than this.
This patch fixes the incorrect calculation of total sectors that Paolo spotted and reported. Sorry,
regards
ronnie sahlberg
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH] ISCSI: Readcapacity retruned the lba of the last sector. Total number of sectors is one more.
2012-05-04 8:15 [Qemu-devel] [PATCH] Fix incorrect calculation of iscsi number of blocks Ronnie Sahlberg
@ 2012-05-04 8:15 ` Ronnie Sahlberg
2012-05-04 8:37 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Ronnie Sahlberg @ 2012-05-04 8:15 UTC (permalink / raw)
To: kwolf, pbonzini, qemu-devel; +Cc: Ronnie Sahlberg
Thanks to Paolo for spotting.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
---
block/iscsi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index eb49093..7c1970d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -482,7 +482,7 @@ iscsi_readcapacity16_cb(struct iscsi_context *iscsi, int status,
itask->iscsilun->block_size = rc16->block_length;
itask->iscsilun->num_blocks = rc16->returned_lba;
- itask->bs->total_sectors = rc16->returned_lba *
+ itask->bs->total_sectors = (rc16->returned_lba + 1) *
rc16->block_length / BDRV_SECTOR_SIZE ;
itask->status = 0;
--
1.7.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-04 8:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-04 8:15 [Qemu-devel] [PATCH] Fix incorrect calculation of iscsi number of blocks Ronnie Sahlberg
2012-05-04 8:15 ` [Qemu-devel] [PATCH] ISCSI: Readcapacity retruned the lba of the last sector. Total number of sectors is one more Ronnie Sahlberg
2012-05-04 8:37 ` Paolo Bonzini
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).