1
0
Fork 0
alistair23-linux/drivers/s390
Stefan Haberland fbbacd0dcb s390/dasd: fix data corruption for thin provisioned devices
commit 5e6bdd37c5 upstream.

Devices are formatted in multiple of tracks.
For an Extent Space Efficient (ESE) volume we get errors when accessing
unformatted tracks. In this case the driver either formats the track on
the flight for write requests or returns zero data for read requests.

In case a request spans multiple tracks, the indication of an unformatted
track presented for the first track is incorrectly applied to all tracks
covered by the request. As a result, tracks containing data will be handled
as empty, resulting in zero data being returned on read, or overwriting
existing data with zero on write.

Fix by determining the track that gets the NRF error.
For write requests only format the track that is surely not formatted.
For Read requests all tracks before have returned valid data and should not
be touched.
All tracks after the unformatted track might be formatted or not. Those are
returned to the blocklayer to build a new request.

When using alias devices there is a chance that multiple write requests
trigger a format of the same track which might lead to data loss. Ensure
that a track is formatted only once by maintaining a list of currently
processed tracks.

Fixes: 5e2b17e712 ("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>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-18 07:17:52 +01:00
..
block s390/dasd: fix data corruption for thin provisioned devices 2020-03-18 07:17:52 +01:00
char s390 updates for the 5.4 merge window 2019-09-17 14:04:43 -07:00
cio s390/qdio: fill SL with absolute addresses 2020-03-12 13:00:15 +01:00
crypto s390/zcrypt: fix card and queue total counter wrap 2020-03-05 16:43:36 +01:00
net s390/qdio: fill SL with absolute addresses 2020-03-12 13:00:15 +01:00
scsi scsi: zfcp: trace channel log even for FCP command responses 2019-12-17 19:55:26 +01:00
virtio virtio/s390: fix race on airq_areas[] 2019-07-26 13:36:18 +02:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00