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 1595500 - lvresize in test mode sends BLKDISCARD to SSD block devices, this will result in the file system corruption
Summary: lvresize in test mode sends BLKDISCARD to SSD block devices, this will result...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.7-Alt
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-27 02:38 UTC by Gang He
Modified: 2021-09-03 12:56 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.180-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:03:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3193 0 None None None 2018-10-30 11:04:28 UTC

Description Gang He 2018-06-27 02:38:55 UTC
Description of problem:
lvresize in test mode sends BLKDISCARD to SSD block devices, this will result in the file system corruption.

Version-Release number of selected component (if applicable):
lvm2-2.02.178

How reproducible:
Can reproduce this problem stably with the below steps.

Steps to Reproduce:
1) create a LV on a SSD based partition, then format this LV with ext4 file system, and mount this LV. 
e.g.
linux-cy2k:/ # lsblk
...
sdc                               8:32   0  37.3G  0 disk
├─sdc1                            8:33   0     2G  0 part [SWAP]
├─sdc2                            8:34   0  14.7G  0 part
│ └─cluster--vg1-test--lv       254:20   0    14G  0 lvm  /mnt/ext4  <<= this LV
└─sdc3                            8:35   0  20.6G  0 part

2) enable issue discards to a logical volumes's underlying physical volume via edit "/etc/lvm/lvm.conf" file.
e.g.
linux-cy2k:/ # vi /etc/lvm/lvm.conf 
set "issue_discards = 1"

3) run lvresize command in test mode.
e.g.
inux-cy2k:/ # lvresize -v -n -L -10GB /dev/cluster-vg1/test-lv --test

4) unmount this LV, then mount this LV again.
You will probably encounter the file system on this LV is corrupted.
e.g. 
linux-cy2k:~ # mount /dev/cluster-vg1/test-lv /mnt/ext4/
mount: wrong fs type, bad option, bad superblock on /dev/mapper/cluster--vg1-test--lv,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

linux-cy2k:~ # dmesg
[3711112.342424] JBD2: no valid journal superblock found
[3711112.342429] EXT4-fs (dm-20): error loading journal


Actual results:
lvresize in test mode sends BLKDISCARD to SSD block devices, this will result in the file system corruption.

Expected results:
lvresize in test mode should not do anything about changing the block device.

Additional info:

Comment 2 Gang He 2018-07-16 02:30:32 UTC
Hello Zdenek,

Do you have time to look at this issue? our users is still pinging this problem.


Thanks
Gang

Comment 3 Zdenek Kabelac 2018-07-17 20:57:32 UTC
Patches committed into upstream and stable branch:

https://www.redhat.com/archives/lvm-devel/2018-July/msg00013.html
https://www.redhat.com/archives/lvm-devel/2018-July/msg00018.html

Comment 4 Gang He 2018-07-18 09:11:46 UTC
(In reply to Zdenek Kabelac from comment #3)
> Patches committed into upstream and stable branch:
> 
> https://www.redhat.com/archives/lvm-devel/2018-July/msg00013.html
> https://www.redhat.com/archives/lvm-devel/2018-July/msg00018.html

Hello Zdenek,

Thank for your efforts, the patch works well.

-Gang

Comment 8 errata-xmlrpc 2018-10-30 11:03:47 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, 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/RHBA-2018:3193


Note You need to log in before you can comment on or make changes to this bug.