]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix handling of small allocation lengths in REPORT LUNS
authorRoland Dreier <roland@purestorage.com>
Fri, 14 Aug 2015 04:59:19 +0000 (21:59 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 19 Aug 2015 04:51:54 +0000 (21:51 -0700)
commit2eeff5bc3213d502057e38c4636a63881194a501
treedb21d5dc214d0dd9793dfee813e0e358d16013f5
parent85cbfdc018180dfbe7bb9c0aa1206e4e538240db
target: Fix handling of small allocation lengths in REPORT LUNS

REPORT LUNS should not fail just because the allocation length is less
than 16.  The relevant section of SPC-4 is:

  4.2.5.6 Allocation length

  The ALLOCATION LENGTH field specifies the maximum number of bytes or
  blocks that an application client has allocated in the Data-In
  Buffer. The ALLOCATION LENGTH field specifies bytes unless a
  different requirement is stated in the command definition.

  An allocation length of zero specifies that no data shall be
  transferred. This condition shall not be considered an error.

So we should just truncate our response rather than return an error.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_spc.c