]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
s390/dasd: fix data corruption for ESE devices
authorStefan Haberland <sth@linux.ibm.com>
Thu, 5 May 2022 14:17:29 +0000 (16:17 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:23:12 +0000 (14:23 +0200)
commit51e646824512a810731af815a8c0946c9525c6f3
tree931126cd07e7f869e5aa645348f1bc88c151372a
parent92190af3d7deb175b50556f7367af134f9779026
s390/dasd: fix data corruption for ESE devices

BugLink: https://bugs.launchpad.net/bugs/1978240
commit 5b53a405e4658580e1faf7c217db3f55a21ba849 upstream.

For ESE devices we get an error when accessing an unformatted track.
The handling of this error will return zero data for read requests and
format the track on demand before writing to it. To do this the code needs
to distinguish between read and write requests. This is done with data from
the blocklayer request. A pointer to the blocklayer request is stored in
the CQR.

If there is an error on the device an ERP request is built to do error
recovery. While the ERP request is mostly a copy of the original CQR the
pointer to the blocklayer request is not copied to not accidentally pass
it back to the blocklayer without cleanup.

This leads to the error that during ESE handling after an ERP request was
built it is not possible to determine the IO direction. This leads to the
formatting of a track for read requests which might in turn lead to data
corruption.

Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes")
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Link: https://lore.kernel.org/r/20220505141733.1989450-2-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/s390/block/dasd.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_int.h