linux-stable/drivers/s390/block
Jan Höppner 1bfbce9966 s390/dasd: Fix read inconsistency for ESE DASD devices
commit b9c10f68e2 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:32:24 +02:00
..
Kconfig dax: remove CONFIG_DAX_DRIVER 2021-12-04 08:58:51 -08:00
Makefile s390: remove xpram device driver 2021-09-07 13:38:42 +02:00
dasd.c s390/dasd: Fix read inconsistency for ESE DASD devices 2022-05-12 12:32:24 +02:00
dasd_3990_erp.c s390/dasd: handle request magic consistently as unsigned int 2021-10-20 08:10:41 -06:00
dasd_alias.c s390/dasd: fix list corruption of lcu list 2020-12-17 13:41:30 -07:00
dasd_devmap.c s390/dasd: use default_groups in kobj_type 2022-01-08 17:44:05 +01:00
dasd_diag.c dasd: use bvec_virt 2021-08-16 10:50:33 -06:00
dasd_diag.h
dasd_eckd.c s390/dasd: Fix read for ESE with blksize < 4k 2022-05-12 12:32:24 +02:00
dasd_eckd.h s390/dasd: summarize dasd configuration data in a separate structure 2021-10-20 08:10:42 -06:00
dasd_eer.c
dasd_erp.c s390/dasd: handle request magic consistently as unsigned int 2021-10-20 08:10:41 -06:00
dasd_fba.c dasd: use bvec_virt 2021-08-16 10:50:33 -06:00
dasd_fba.h
dasd_genhd.c s390 updates for the 5.16 merge window 2021-11-06 14:48:06 -07:00
dasd_int.h s390/dasd: prevent double format of tracks for ESE devices 2022-05-12 12:32:24 +02:00
dasd_ioctl.c s390/dasd: fix kernel doc comment 2021-10-20 08:10:41 -06:00
dasd_proc.c
dcssblk.c dax: remove the copy_from_iter and copy_to_iter methods 2021-12-18 08:04:53 -08:00
scm_blk.c s390/block/scm_blk: add error handling support for add_disk() 2021-10-04 09:49:37 +02:00
scm_blk.h
scm_drv.c s390/scm: Make struct scm_driver::remove return void 2021-07-21 11:53:42 +02:00