]> www.infradead.org Git - users/jedix/linux-maple.git/commit
target: Handle 0 correctly in transport_get_sectors_6()
authorRoland Dreier <roland@purestorage.com>
Tue, 22 Nov 2011 21:51:33 +0000 (13:51 -0800)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Tue, 10 Jan 2012 21:00:11 +0000 (13:00 -0800)
commit70ca36fe843ead8b96f46ece64632a959fbe182d
treec03f5367aa7b21f815a463d957c6415c1c40411a
parent5bb7fb71ba56a01b5a13aab072a19cbf05a8b58e
target: Handle 0 correctly in transport_get_sectors_6()

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 <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/target/target_core_transport.c