[stgt] [PATCH] Fix modesense commands. Two arguments were swapped causing mode sense data-in buffer to be garbage.
Ronnie Sahlberg
ronniesahlberg at gmail.com
Sat Jun 1 17:03:46 CEST 2013
This is fixed here, and to ensure we dont get regressions I have added
a test to the testsuite that will detect this:
./bin/iscsi-test-cu iscsi://127.0.0.1/iqn.ronnie.test/1 --test SCSI.ModeSense6.AllPages -V
Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>
---
usr/spc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/usr/spc.c b/usr/spc.c
index 074fdad..1f97ca6 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;
--
1.7.3.1
--
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