Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] ps3rom: fix wrong resid calculation bug
@ 2008-02-24 23:25 FUJITA Tomonori
  2008-02-25 13:22 ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: FUJITA Tomonori @ 2008-02-24 23:25 UTC (permalink / raw)
  To: linux-scsi; +Cc: tomof, FUJITA Tomonori, Geert Uytterhoeven, James Bottomley

sg driver rounds up the length in struct scatterlist to be a multiple
of 512 in some conditions. So LLDs can't use the data length in a sg
list to calculate residual. Instead, the length in struct scsi_cmnd
should be used.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/ps3rom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index 0cd614a..6944bda 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
 		}
 		req_len += sgpnt->length;
 	}
-	scsi_set_resid(cmd, req_len - act_len);
+	scsi_set_resid(cmd, scsi_bufflen(cmd) - act_len);
 	return 0;
 }
 
-- 
1.5.3.7


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

end of thread, other threads:[~2008-02-25 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-24 23:25 [PATCH] ps3rom: fix wrong resid calculation bug FUJITA Tomonori
2008-02-25 13:22 ` Geert Uytterhoeven
2008-02-25 13:23   ` [PATCH 1/2] " Geert Uytterhoeven
2008-02-25 13:24   ` [PATCH 2/2] ps3rom: Simplify fill_from_dev_buffer() Geert Uytterhoeven
2008-02-25 15:39     ` FUJITA Tomonori
2008-02-25 16:19       ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox