From: Roland Dreier Date: Tue, 17 Jul 2012 00:10:17 +0000 (-0700) Subject: target: Fix range calculation in WRITE SAME emulation when num blocks == 0 X-Git-Tag: v3.5~12^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1765fe5edcb83f53fc67edeb559fcf4bc82c6460;p=pandora-kernel.git target: Fix range calculation in WRITE SAME emulation when num blocks == 0 When NUMBER OF LOGICAL BLOCKS is 0, WRITE SAME is supposed to write all the blocks from the specified LBA through the end of the device. However, dev->transport->get_blocks(dev) (perhaps confusingly) returns the last valid LBA rather than the number of blocks, so the correct number of blocks to write starting with lba is dev->transport->get_blocks(dev) - lba + 1 (nab: Backport roland's for-3.6 patch to for-3.5) Signed-off-by: Roland Dreier Cc: Cc: Signed-off-by: Nicholas Bellinger --- Reading git-diff-tree failed