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

    [SCSI] target: Fix volume size misreporting for volumes > 2TB

to the 2.6.38-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-volume-size-misreporting-for-volumes-2tb.patch
and it can be found in the queue-2.6.38 subdirectory.

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


>From 904f0bc482201fa86e75c330d79dfd11be494cf8 Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <[email protected]>
Date: Wed, 2 Mar 2011 15:52:51 -0800
Subject: [SCSI] target: Fix volume size misreporting for volumes > 2TB

From: Nicholas Bellinger <[email protected]>

commit 904f0bc482201fa86e75c330d79dfd11be494cf8 upstream.

the target infrastructure fails to send the correct conventional size
to READ_CAPACITY that force a retry with READ_CAPACITY_16, which reads
the capacity for devices > 2TB.  Fix by adding the correct return to
trigger RC(16).

Reported-by: Ben Jarvis <[email protected]>
Signed-off-by: Signed-off-by: Nicholas A. Bellinger <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/target/target_core_cdb.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/target/target_core_cdb.c
+++ b/drivers/target/target_core_cdb.c
@@ -667,7 +667,13 @@ target_emulate_readcapacity(struct se_cm
 {
        struct se_device *dev = SE_DEV(cmd);
        unsigned char *buf = cmd->t_task->t_task_buf;
-       u32 blocks = dev->transport->get_blocks(dev);
+       unsigned long long blocks_long = dev->transport->get_blocks(dev);
+       u32 blocks;
+
+       if (blocks_long >= 0x00000000ffffffff)
+               blocks = 0xffffffff;
+       else
+               blocks = (u32)blocks_long;
 
        buf[0] = (blocks >> 24) & 0xff;
        buf[1] = (blocks >> 16) & 0xff;


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

queue-2.6.38/target-fix-volume-size-misreporting-for-volumes-2tb.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to