From: Greg Kroah-Hartman Date: Fri, 9 Dec 2011 22:03:00 +0000 (-0800) Subject: 3.0 patches X-Git-Tag: v3.0.14~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e56e27e5101739060b9b5710dea4573681cf22c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0 patches added patches: target-handle-0-correctly-in-transport_get_sectors_6.patch --- diff --git a/queue-3.0/series b/queue-3.0/series index f3ed1d216f4..b170960c6f3 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -13,3 +13,4 @@ ptp-fix-clock_getres-implementation.patch mm-ensure-that-pfn_valid-is-called-once-per-pageblock-when-reserving-pageblocks.patch mm-vmalloc-check-for-page-allocation-failure-before-vmlist-insertion.patch fix-apparmor-dereferencing-potentially-freed-dentry-sanitize-__d_path-api.patch +target-handle-0-correctly-in-transport_get_sectors_6.patch diff --git a/queue-3.0/target-handle-0-correctly-in-transport_get_sectors_6.patch b/queue-3.0/target-handle-0-correctly-in-transport_get_sectors_6.patch new file mode 100644 index 00000000000..b8ccf1d324a --- /dev/null +++ b/queue-3.0/target-handle-0-correctly-in-transport_get_sectors_6.patch @@ -0,0 +1,46 @@ +From 9b5cd7f37e1e018432111333e2a67f78ba41edfe Mon Sep 17 00:00:00 2001 +From: Roland Dreier +Date: Tue, 22 Nov 2011 13:51:33 -0800 +Subject: target: Handle 0 correctly in transport_get_sectors_6() + +From: Roland Dreier + +commit 9b5cd7f37e1e018432111333e2a67f78ba41edfe upstream. + +SBC-3 says: + + A TRANSFER LENGTH field set to zero specifies that 256 logical + blocks shall be written. Any other value specifies the number + of logical blocks that shall be written. + +The old code was always just returning the value in the TRANSFER LENGTH +byte. Fix this to return 256 if the byte is 0. + +Signed-off-by: Roland Dreier +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/target/target_core_transport.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/target/target_core_transport.c ++++ b/drivers/target/target_core_transport.c +@@ -2777,10 +2777,15 @@ static inline u32 transport_get_sectors_ + + /* + * Everything else assume TYPE_DISK Sector CDB location. +- * Use 8-bit sector value. ++ * Use 8-bit sector value. SBC-3 says: ++ * ++ * A TRANSFER LENGTH field set to zero specifies that 256 ++ * logical blocks shall be written. Any other value ++ * specifies the number of logical blocks that shall be ++ * written. + */ + type_disk: +- return (u32)cdb[4]; ++ return cdb[4] ? : 256; + } + + static inline u32 transport_get_sectors_10(