Files
linux/drivers/scsi
John Garry d28d17a845 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: 84f3a3c01d ("scsi: scsi_debug: Atomic write support")
Reported-by: Colin Ian King <colin.i.king@gmail.com>
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20241018101655.4207-1-john.g.garry@oracle.com
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-10-25 14:48:27 -04:00
..
2024-03-10 18:15:48 -04:00
2024-08-12 22:05:50 -04:00
2024-08-12 22:05:50 -04:00
2024-06-20 15:19:17 -06:00
2024-06-11 21:14:54 -04:00
2024-06-20 15:19:17 -06:00
2024-09-27 08:18:43 -07:00