]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: Fix truncated PR-in ReadKeys response
authorDavid Disseldorp <ddiss@suse.de>
Tue, 19 Jun 2018 15:58:24 +0000 (17:58 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 20 Jun 2018 01:36:37 +0000 (21:36 -0400)
commitf391101bd1e6f4ac64c3205d3b4384858e58f411
treeda14e747825914e3118cc764f49fe1548dab69f3
parent71984f6606c9b4bc791b8fd0eb7cb69dcc7a4be2
scsi: target: Fix truncated PR-in ReadKeys response

SPC5r17 states that the contents of the ADDITIONAL LENGTH field are not
altered based on the allocation length, so always calculate and pack the
full key list length even if the list itself is truncated.

According to Maged:

  Yes it fixes the "Storage Spaces Persistent Reservation" test in the
  Windows 2016 Server Failover Cluster validation suites when having
  many connections that result in more than 8 registrations. I tested
  your patch on 4.17 with iblock.

This behaviour can be tested using the libiscsi PrinReadKeys.Truncate test.

Cc: stable@vger.kernel.org
Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Tested-by: Maged Mokhtar <mmokhtar@petasan.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_pr.c