[PATCH] mpt2sas: Fix for data corruption issue in the routine sd_prep_fn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix for data corruption issue in the routine sd_prep_fn which can
occur for 4kb sector support.

The issue is that, the routine sd_prep_fn is sharing the same parameter called
this_count for setting the LBA count and the underflow. When this routine
converts this_count so the LBA count is in 4kb units, it is not converted back 
to 512 bytes units when setting the underflow. Thus underflow is off by a 
multiple of 8.   

This patch will set the underflow to the data transfer size in bytes.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@xxxxxxx>
Cc: stable@xxxxxxxxxx
---

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c 
index fa3a591..3c4ad14 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -895,7 +895,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
 	 * this many bytes between each connect / disconnect.
 	 */
 	SCpnt->transfersize = sdp->sector_size;
-	SCpnt->underflow = this_count << 9;
+	SCpnt->underflow = blk_rq_bytes(rq);
 	SCpnt->allowed = SD_MAX_RETRIES;
 
 	/*

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux