diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-09-18 14:27:26 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 10:58:12 +0200 |
commit | 65f72f2a2fe89f072d6a88e5cd69a64270b9c436 (patch) | |
tree | 05da71cdc92fcb9ea0888fdd2316c340ac89baf9 /drivers/scsi/raid_class.c | |
parent | [SCSI] scsi_debug: factor out copying PI from dif_storep to prot_sglist (diff) | |
download | linux-65f72f2a2fe89f072d6a88e5cd69a64270b9c436.tar.xz linux-65f72f2a2fe89f072d6a88e5cd69a64270b9c436.zip |
[SCSI] scsi_debug: avoid partial copying PI from prot_sglist to dif_storep
If data integrity support is enabled, prot_verify_write() is called in
response to WRITE commands and it verifies protection info from
prot_sglist by comparing against data sglist, and copies protection info
to dif_storep.
When multiple blocks are transfered by a WRITE command, it verifies and
copies these blocks one by one. So if it fails to verify protection
info in the middle of blocks, the actual data transfer to fake_storep
isn't proceeded at all although protection info for some blocks are
already copied to dif_storep. Therefore, it breaks the data integrity
between fake_storep and dif_storep.
This fixes it by ensuring that copying protection info to dif_storep is
done after all blocks are successfully verified. Reusing dif_copy_prot()
with supporting the opposite direction simplifies this fix.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/raid_class.c')
0 files changed, 0 insertions, 0 deletions