Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2183559

Summary: dm: discard IOs on striped or snap LVs can trigger data corruption [RHEL-8.9]
Product: Red Hat Enterprise Linux 8 Reporter: Ben Marzinski <bmarzins>
Component: kernelAssignee: Ben Marzinski <bmarzins>
kernel sub component: Device Mapper QA Contact: Filip Suba <fsuba>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: agk, fsuba, jpittman, msnitzer, nweddle, storage-qe, vdo-internal
Version: 8.9Keywords: Regression, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-4.18.0-489.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2183556 Environment:
Last Closed: 2023-11-14 15:41:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2183556    
Bug Blocks:    

Description Ben Marzinski 2023-03-31 16:05:28 UTC
+++ This bug was initially created as a clone of Bug #2183556 +++

Description of problem:
DM is improperly processing of duplicate abnormal bios, such as discards, write zeros and secure erase. This can cause dm-stripe and dm-snap to send IO to the wrong disk or wrong part of a disk, potentially causing data corruption

Version-Release number of selected component (if applicable):
kernel-5.14.0-124.el9

How reproducible:
Always

Steps to Reproduce:
1. # vgcreate vg <dev1> <dev2> <dev3> <dev4>
2. # lvcreate -l 100%VG  --stripes 2 vg -n lv
3. # blkdiscard /dev/vg/lv

Actual results:
blkdiscard: /dev/vg/lv: BLKDISCARD ioctl failed: Input/output error

[  875.631996] blkdiscard: attempt to access beyond end of device
[  875.631996] loop0: rw=2051, sector=2048, nr_sectors = 147456 limit=81920
[  875.632009] blkdiscard: attempt to access beyond end of device
[  875.632009] loop1: rw=2051, sector=2048, nr_sectors = 147456 limit=81920

Expected results:
No error

Additional info:

Comment 1 Ben Marzinski 2023-03-31 17:26:58 UTC
The fix for this issue is in the following linux-dm commits:

f7b58a69fad9 dm: fix improper splitting for abnormal bios
666eed46769d dm: fix __send_duplicate_bios() to always allow for splitting IO

The upstream kernel bug for this issue is here:
https://bugzilla.kernel.org/show_bug.cgi?id=217273

Comment 10 Filip Suba 2023-05-01 13:07:36 UTC
Verified with kernel-4.18.0-489.el8.

Comment 12 errata-xmlrpc 2023-11-14 15:41:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: kernel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:7077