target/iscsi: Fix endianness in an error message
authorBart Van Assche <bart.vanassche@wdc.com>
Tue, 31 Oct 2017 18:03:15 +0000 (11:03 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 4 Nov 2017 22:15:56 +0000 (15:15 -0700)
Since hdr->offset is a big endian number, convert it to CPU endian
before printing it.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Christie <mchristi@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target.c

index 5001261f5d69d759dd25161401510551d35c3da7..37bc8a37401d1a1dec8b6db256f0f62a0b8d7906 100644 (file)
@@ -1460,9 +1460,9 @@ __iscsit_check_dataout_hdr(struct iscsi_conn *conn, void *buf,
        iscsit_mod_dataout_timer(cmd);
 
        if ((be32_to_cpu(hdr->offset) + payload_length) > cmd->se_cmd.data_length) {
-               pr_err("DataOut Offset: %u, Length %u greater than"
-                       " iSCSI Command EDTL %u, protocol error.\n",
-                       hdr->offset, payload_length, cmd->se_cmd.data_length);
+               pr_err("DataOut Offset: %u, Length %u greater than iSCSI Command EDTL %u, protocol error.\n",
+                      be32_to_cpu(hdr->offset), payload_length,
+                      cmd->se_cmd.data_length);
                return iscsit_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_INVALID, buf);
        }