scsi: core: Fix the scsi_set_resid() documentation
authorBart Van Assche <bvanassche@acm.org>
Fri, 21 Jul 2023 16:01:32 +0000 (09:01 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 23 Jul 2023 20:35:56 +0000 (16:35 -0400)
Because scsi_finish_command() subtracts the residual from the buffer
length, residual overflows must not be reported. Reflect this in the SCSI
documentation. See also commit 9237f04e12cc ("scsi: core: Fix
scsi_get/set_resid() interface")

Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230721160154.874010-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Documentation/scsi/scsi_mid_low_api.rst

index 6fa3a62795016494280c4a49adac72cc4d4b6af4..022198c513506b2618fcf2803af7082b46604be3 100644 (file)
@@ -1190,11 +1190,11 @@ Members of interest:
                 - pointer to scsi_device object that this command is
                    associated with.
     resid
-                - an LLD should set this signed integer to the requested
+                - an LLD should set this unsigned integer to the requested
                    transfer length (i.e. 'request_bufflen') less the number
                    of bytes that are actually transferred. 'resid' is
                    preset to 0 so an LLD can ignore it if it cannot detect
-                   underruns (overruns should be rare). If possible an LLD
+                   underruns (overruns should not be reported). An LLD
                    should set 'resid' prior to invoking 'done'. The most
                    interesting case is data transfers from a SCSI target
                    device (e.g. READs) that underrun.