This is a note to let you know that I've just added the patch titled

    target: Fix 16-bit target ports for SET TARGET PORT GROUPS emulation

to the 3.2-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     target-fix-16-bit-target-ports-for-set-target-port-groups-emulation.patch
and it can be found in the queue-3.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 33395fb8a13731c7ef7b175dbf5a4d8a6738fe6c Mon Sep 17 00:00:00 2001
From: Roland Dreier <[email protected]>
Date: Thu, 23 Feb 2012 17:22:12 -0800
Subject: target: Fix 16-bit target ports for SET TARGET PORT GROUPS emulation

From: Roland Dreier <[email protected]>

commit 33395fb8a13731c7ef7b175dbf5a4d8a6738fe6c upstream.

The old code did (MSB << 8) & 0xff, which always evaluates to 0.  Just use
get_unaligned_be16() so we don't have to worry about whether our open-coded
version is correct or not.

Signed-off-by: Roland Dreier <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/target/target_core_alua.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -30,6 +30,7 @@
 #include <linux/export.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
+#include <asm/unaligned.h>
 
 #include <target/target_core_base.h>
 #include <target/target_core_device.h>
@@ -268,8 +269,7 @@ int target_emulate_set_target_port_group
                 * changed.
                 */
                if (primary) {
-                       tg_pt_id = ((ptr[2] << 8) & 0xff);
-                       tg_pt_id |= (ptr[3] & 0xff);
+                       tg_pt_id = get_unaligned_be16(ptr + 2);
                        /*
                         * Locate the matching target port group ID from
                         * the global tg_pt_gp list
@@ -313,8 +313,7 @@ int target_emulate_set_target_port_group
                         * the Target Port in question for the the incoming
                         * SET_TARGET_PORT_GROUPS op.
                         */
-                       rtpi = ((ptr[2] << 8) & 0xff);
-                       rtpi |= (ptr[3] & 0xff);
+                       rtpi = get_unaligned_be16(ptr + 2);
                        /*
                         * Locate the matching relative target port identifer
                         * for the struct se_device storage object.


Patches currently in stable-queue which might be from [email protected] are

queue-3.2/target-don-t-set-wbus16-or-sync-bits-in-inquiry-response.patch
queue-3.2/target-fix-16-bit-target-ports-for-set-target-port-groups-emulation.patch
queue-3.2/ib-iser-post-initial-receive-buffers-before-sending-the-final-login-request.patch
queue-3.2/tcm_loop-set-residual-field-for-scsi-commands.patch
queue-3.2/iscsi-target-fix-iscsit_alloc_buffs-failure-cases.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to