]> Git Repo - linux.git/commit
scsi: scsi_debug: Fix do_device_access() handling of unexpected SG copy length
authorJohn Garry <[email protected]>
Fri, 18 Oct 2024 10:16:55 +0000 (10:16 +0000)
committerMartin K. Petersen <[email protected]>
Fri, 25 Oct 2024 18:48:27 +0000 (14:48 -0400)
commitd28d17a845600dd9f7de241de9b1528a1b138716
tree2b718c2f42a486cb1d0c21b0eb816ffb6c0b7d3d
parentfca6caeb4a61d240f031914413fcc69534f6dc03
scsi: scsi_debug: Fix do_device_access() handling of unexpected SG copy length

If the sg_copy_buffer() call returns less than sdebug_sector_size, then
we drop out of the copy loop. However, we still report that we copied
the full expected amount, which is not proper.

Fix by keeping a running total and return that value.

Fixes: 84f3a3c01d70 ("scsi: scsi_debug: Atomic write support")
Reported-by: Colin Ian King <[email protected]>
Suggested-by: Dan Carpenter <[email protected]>
Signed-off-by: John Garry <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Dan Carpenter <[email protected]>
Reviewed-by: Colin Ian King <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/scsi_debug.c
This page took 0.080308 seconds and 4 git commands to generate.