Commit 3809d56d authored by Bart Van Assche's avatar Bart Van Assche Committed by sanglipeng
Browse files

scsi: core: Fix the scsi_set_resid() documentation

stable inclusion
from stable-v5.10.195
commit 5d27baee6cd9ddb2c0af14c4ca8b309d0f1bda98
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I95JOC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5d27baee6cd9ddb2c0af14c4ca8b309d0f1bda98



--------------------------------

commit f669b8a6 upstream.

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 9237f04e ("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: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230721160154.874010-2-bvanassche@acm.org


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent dc907643
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1195,11 +1195,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.