Public bug reported:

Description:   s390/dasd: Fix data corruption for ESE devices

Symptom:       Filesystem errors and data inconsistency.
Problem:       Wrong tracks are formatted or the same track is formatted twice.

               1. 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

               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.

               2. When using alias devices a track might be accessed by
               multiple requests simultaneously and there is a race window that
               a track gets formatted twice resulting in data loss.

Solution:      1. Return the callback data of the original request in case
               there are ERP requests build on top of it and thus determine the
               correct IO direction.
               2. Prevent the double format by remembering the amount of
               formatted tracks when starting a request and comparing this
               number before actually formatting a track on the fly. If the
               number has changed there is a chance that the current track was
               finally formatted in between. As a result do not format the
               track and restart the current IO to check.
Reproduction:  Prepare an ESE DASD device using dasdfmt and fdasd. Install any
               filesystem on the prepared partitions and issue regular I/O
               using dd or any other tool while Alias DASD devices are set
               online as well.

Upstream-ID:   5b53a405e4658580e1faf7c217db3f55a21ba849

Problem-ID:    198418

Preventive:    yes

Date:          2022-06-01
Component:     kernel

** Affects: ubuntu-z-systems
     Importance: High
     Assignee: Skipper Bug Screeners (skipper-screen-team)
         Status: New

** Affects: linux (Ubuntu)
     Importance: High
     Assignee: Skipper Bug Screeners (skipper-screen-team)
         Status: New

** Tags: architecture-s39064 bugnameltc-198422 severity-high 

** Tags added: architecture-s39064 bugnameltc-198422 severity-high

** Changed in: ubuntu
     Assignee: (unassigned) => Skipper Bug Screeners (skipper-screen-team)

** Package changed: ubuntu => linux (Ubuntu)

You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

  [UBUNTU 20.04] s390/DASD: Fix data corruption for ESE devices

To manage notifications about this bug go to:

ubuntu-bugs mailing list

Reply via email to