mbox series

[v4,0/4] scsi: target: COMPARE AND WRITE miscompare sense

Message ID 20201031233211.5207-1-ddiss@suse.de
Headers show
Series scsi: target: COMPARE AND WRITE miscompare sense | expand

Message

David Disseldorp Oct. 31, 2020, 11:32 p.m. UTC
This patchset adds missing functionality to return the offset of
non-matching read/compare data in the sense INFORMATION field on
COMPARE AND WRITE miscompare.

The functionality can be tested using the libiscsi
CompareAndWrite.MiscompareSense test proposed via:
  https://github.com/sahlberg/libiscsi/pull/344

Changes since v3:
- (4/4) optimize for equality, as suggested by Doug
  + perform byte-by-byte offset check only after memcmp() failure
  + drop Mike's RB tag due to this rework

Changes since v2:
- perform bad_sector->sense_info rename in overlooked ib_isert
- drop scatterlist change queued via Jens' tree
- add Mike's reviewed-by tag
- rebase against Martin's 5.11/scsi-queue branch

Changes since v1:
- drop unnecessary WARN_ON()
- fix two checkpatch warnings
- drop single-use nlbas variable
- avoid compare_len recalculation

Cheers, David

 drivers/infiniband/ulp/isert/ib_isert.c |   4 +-
 drivers/target/target_core_sbc.c        | 138 ++++++++++++++----------
 drivers/target/target_core_transport.c  |  33 +++---
 include/target/target_core_base.h       |   2 +-
 4 files changed, 104 insertions(+), 73 deletions(-)

Comments

Martin K. Petersen Nov. 5, 2020, 3:03 a.m. UTC | #1
David,

> This patchset adds missing functionality to return the offset of
> non-matching read/compare data in the sense INFORMATION field on
> COMPARE AND WRITE miscompare.

Applied to 5.11/scsi-staging, thanks!
Martin K. Petersen Nov. 11, 2020, 2:58 a.m. UTC | #2
On Sun, 1 Nov 2020 00:32:07 +0100, David Disseldorp wrote:

> This patchset adds missing functionality to return the offset of

> non-matching read/compare data in the sense INFORMATION field on

> COMPARE AND WRITE miscompare.

> 

> The functionality can be tested using the libiscsi

> CompareAndWrite.MiscompareSense test proposed via:

>   https://github.com/sahlberg/libiscsi/pull/344

> 

> [...]


Applied to 5.11/scsi-queue, thanks!

[1/4] scsi: target: Rename struct sense_info to sense_detail
      https://git.kernel.org/mkp/scsi/c/b455233dcc40
[2/4] scsi: target: Rename cmd.bad_sector to cmd.sense_info
      https://git.kernel.org/mkp/scsi/c/8dd992fb67f3
[3/4] scsi: target: Split out COMPARE AND WRITE memcmp into helper
      https://git.kernel.org/mkp/scsi/c/ab628b9fc8c2
[4/4] scsi: target: Return COMPARE AND WRITE miscompare offsets
      https://git.kernel.org/mkp/scsi/c/749c226cf56e

-- 
Martin K. Petersen	Oracle Linux Engineering