kernel_optimize_test/drivers/s390
Jan Höppner 6c7c0e131e s390/dasd: Fix read inconsistency for ESE DASD devices
commit b9c10f68e23c13f56685559a0d6fdaca9f838324 upstream.

Read requests that return with NRF error are partially completed in
dasd_eckd_ese_read(). The function keeps track of the amount of
processed bytes and the driver will eventually return this information
back to the block layer for further processing via __dasd_cleanup_cqr()
when the request is in the final stage of processing (from the driver's
perspective).

For this, blk_update_request() is used which requires the number of
bytes to complete the request. As per documentation the nr_bytes
parameter is described as follows:
   "number of bytes to complete for @req".

This was mistakenly interpreted as "number of bytes _left_ for @req"
leading to new requests with incorrect data length. The consequence are
inconsistent and completely wrong read requests as data from random
memory areas are read back.

Fix this by correctly specifying the amount of bytes that should be used
to complete the request.

Fixes: 5e6bdd37c5 ("s390/dasd: fix data corruption for thin provisioned devices")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20220505141733.1989450-5-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-12 12:25:34 +02:00
..
block s390/dasd: Fix read inconsistency for ESE DASD devices 2022-05-12 12:25:34 +02:00
char s390/tape: fix timer initialization in tape_std_assign() 2021-11-18 14:04:30 +01:00
cio s390/cio: make ccw_device_dma_* more robust 2021-11-18 14:04:30 +01:00
crypto s390/ap: Fix hanging ioctl caused by orphaned replies 2021-11-18 14:04:30 +01:00
net s390/qeth: fix NULL deref in qeth_clear_working_pool_list() 2021-09-30 10:11:03 +02:00
scsi scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices 2022-02-01 17:25:39 +01:00
virtio virtio/s390: implement virtio-ccw revision 2 correctly 2021-03-04 11:38:42 +01:00
Makefile