diff options
author | John Garry <john.g.garry@oracle.com> | 2024-10-18 10:16:55 +0000 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2024-10-25 14:48:27 -0400 |
commit | d28d17a845600dd9f7de241de9b1528a1b138716 (patch) | |
tree | 2b718c2f42a486cb1d0c21b0eb816ffb6c0b7d3d /rust/helpers/task.c | |
parent | fca6caeb4a61d240f031914413fcc69534f6dc03 (diff) | |
download | linux-d28d17a845600dd9f7de241de9b1528a1b138716.tar.gz linux-d28d17a845600dd9f7de241de9b1528a1b138716.tar.bz2 linux-d28d17a845600dd9f7de241de9b1528a1b138716.zip |
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 <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>
Diffstat (limited to 'rust/helpers/task.c')
0 files changed, 0 insertions, 0 deletions