[stgt] [PATCH] Fix ModeSense. ModeSense never returns residuals. Additionally fix the two arguments that were swapped in set_byte_safe.

Ronnie Sahlberg ronniesahlberg at gmail.com
Fri May 31 07:30:32 CEST 2013

Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>
 usr/spc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index 074fdad..197e611 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -622,7 +622,7 @@ static int build_mode_page(uint8_t *data, struct mode_pg *pg,
  * Set a byte at the given index within dst buffer to val,
  * not exceeding dst_len bytes available at dst.
-void set_byte_safe(uint8_t *dst, uint32_t dst_len, uint32_t index, int val)
+void set_byte_safe(uint8_t *dst, uint32_t index, uint32_t dst_len, int val)
 	if (index < dst_len)
 		dst[index] = (uint8_t)val;
@@ -713,10 +713,8 @@ int spc_mode_sense(int host_no, struct scsi_cmd *cmd)
 		set_byte_safe(data, 7, alloc_len, blk_desc_len & 0xff);
-	scsi_set_in_resid_by_actual(cmd, actual_len);
 	return SAM_STAT_GOOD;
-	scsi_set_in_resid_by_actual(cmd, 0);
 	sense_data_build(cmd, key, asc);

To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list