Bug 1253833
Summary: | renaming logical volumes to previously existing volume names causes confusion when lvresize calls fsadm | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> |
Component: | lvm2 | Assignee: | Zdenek Kabelac <zkabelac> |
lvm2 sub component: | Command-line tools | QA Contact: | cluster-qe <cluster-qe> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | low | ||
Priority: | unspecified | CC: | agk, cluster-qe, cmarthal, heinzm, jbrassow, jwaterwo, lmiksik, loberman, lvm-team, mcsontos, msnitzer, prajnoha, prockai, thornber, zkabelac |
Version: | 7.2 | ||
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | lvm2-2.02.171-2.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1196910 | Environment: | |
Last Closed: | 2017-08-01 21:47:18 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: | 1196910 | ||
Bug Blocks: | 1298243, 1385242 |
Description
Corey Marthaler
2015-08-14 20:17:23 UTC
Exists in 7.2 as well. 3.10.0-302.el7.x86_64 lvm2-2.02.127-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 lvm2-libs-2.02.127-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 lvm2-cluster-2.02.127-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 device-mapper-1.02.104-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 device-mapper-libs-1.02.104-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 device-mapper-event-1.02.104-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 device-mapper-event-libs-1.02.104-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 device-mapper-persistent-data-0.5.4-1.el7 BUILT: Fri Jul 17 08:56:22 CDT 2015 cmirror-2.02.127-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 sanlock-3.2.4-1.el7 BUILT: Fri Jun 19 12:48:49 CDT 2015 sanlock-lib-3.2.4-1.el7 BUILT: Fri Jun 19 12:48:49 CDT 2015 lvm2-lockd-2.02.127-1.el7 BUILT: Mon Aug 10 03:22:35 CDT 2015 [root@host-115 ~]# lvs -a -o +devices LV Attr LSize Cpy%Sync Devices resizeA mwi-aom--- 200.00m 100.00 resizeA_mimage_0(0),resizeA_mimage_1(0) [resizeA_mimage_0] iwi-aom--- 200.00m /dev/sdd2(0) [resizeA_mimage_1] iwi-aom--- 200.00m /dev/sdd1(0) resizeB mwi-aom--- 200.00m 100.00 resizeB_mimage_0(0),resizeB_mimage_1(0) [resizeB_mimage_0] iwi-aom--- 200.00m /dev/sdd2(50) [resizeB_mimage_1] iwi-aom--- 200.00m /dev/sdd1(50) [root@host-115 ~]# mount /dev/mapper/mirror_sanity-resizeA on /mnt/resizeA type ext4 (rw,relatime,seclabel,data=ordered) /dev/mapper/mirror_sanity-resizeB on /mnt/resizeB type ext4 (rw,relatime,seclabel,data=ordered) [root@host-115 ~]# lvrename /dev/mirror_sanity/resizeA /dev/mirror_sanity/resizeC Renamed "resizeA" to "resizeC" in volume group "mirror_sanity" [root@host-115 ~]# lvrename /dev/mirror_sanity/resizeB /dev/mirror_sanity/resizeA Renamed "resizeB" to "resizeA" in volume group "mirror_sanity" [root@host-115 ~]# lvs -a -o +devices LV Attr LSize Cpy%Sync Devices resizeA mwi-aom--- 200.00m 100.00 resizeA_mimage_0(0),resizeA_mimage_1(0) [resizeA_mimage_0] iwi-aom--- 200.00m /dev/sdd2(50) [resizeA_mimage_1] iwi-aom--- 200.00m /dev/sdd1(50) resizeC mwi-aom--- 200.00m 100.00 resizeC_mimage_0(0),resizeC_mimage_1(0) [resizeC_mimage_0] iwi-aom--- 200.00m /dev/sdd2(0) [resizeC_mimage_1] iwi-aom--- 200.00m /dev/sdd1(0) [root@host-115 ~]# lvextend -r -n -f -L 400M /dev/mirror_sanity/resizeA Extending 2 mirror images. Size of logical volume mirror_sanity/resizeA changed from 200.00 MiB (50 extents) to 400.00 MiB (100 extents). Logical volume resizeA successfully resized resize2fs 1.42.9 (28-Dec-2013) resize2fs: Device or resource busy while trying to open /dev/mapper/mirror_sanity-resizeA Couldn't find valid filesystem superblock. fsadm: Resize ext4 failed fsadm failed: 1 [root@host-115 ~]# lvs -a -o +devices LV Attr LSize Cpy%Sync Devices resizeA mwi-aom--- 400.00m 100.00 resizeA_mimage_0(0),resizeA_mimage_1(0) [resizeA_mimage_0] iwi-aom--- 400.00m /dev/sdd2(50) [resizeA_mimage_1] iwi-aom--- 400.00m /dev/sdd1(50) resizeC mwi-aom--- 200.00m 100.00 resizeC_mimage_0(0),resizeC_mimage_1(0) [resizeC_mimage_0] iwi-aom--- 200.00m /dev/sdd2(0) [resizeC_mimage_1] iwi-aom--- 200.00m /dev/sdd1(0) Yep - this will need some more tricky behaviour from fsadm size, since renamed LVs are unfortunately remembered under the old name in kernel. So this bug is getting a bit more complicated. There are couple connected troubles. fsadm needs to provide better detection of mounted volume - as it appears most tools do a very basic detect from /etc/mtab content which keeps the old name. New systems may use /proc/self/mountinfo - but it's not giving all the needed info either (i.e. cgroups) but the advantage here is the we get major:minor. We can get a similar info in somewhat complicated way also via 'stat'. So the fix will try to address couple issues accross mutliple different tools. I'm aiming ATM to prevent and filesystem damage by disallowing overrides for cases were fsadm failed to recognize mounted filesystem. But few more related bugs will need to be opened against tools: resize2fs, reiser_resizefs, xfs_growfs - which needs to provide smarter logic to handle renamed device better. So the approach for 7.4 is to update fsdam with additional checks to detect situations that the current code handles incorrectly and provide clear error messages. Beyond that, wider changes will be covered by separate bugzillas. Fixed by several upstream fsadm commits: https://www.redhat.com/archives/lvm-devel/2017-May/msg00061.html this one was the most important - ensuring lvm2 will not use renamed mounted LV for filesystem utils. Is this the fix for this scenario? This behavior is now in the latest rpms and causing this case to "fail". lvreduce -y -r -n -f -L 500M /dev/snapper_thinp/other1 fsadm: Cannot RESIZE device "/dev/mapper/snapper_thinp-other1" without umounting filesystem /mnt/other2 first. fsadm: Mounted filesystem is using device snapper_thinp-other1, but referenced device is snapper_thinp-other2. fsadm: Filesystem utilities currently do not support renamed devices. /usr/sbin/fsadm failed: 1 Filesystem resize failed. couldn't resize thin and filesystem on host-126 3.10.0-666.el7.x86_64 lvm2-2.02.171-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 lvm2-libs-2.02.171-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 lvm2-cluster-2.02.171-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 device-mapper-1.02.140-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 device-mapper-libs-1.02.140-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 device-mapper-event-1.02.140-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 device-mapper-event-libs-1.02.140-2.el7 BUILT: Wed May 24 09:02:34 CDT 2017 device-mapper-persistent-data-0.7.0-0.1.rc6.el7 BUILT: Mon Mar 27 10:15:46 CDT 2017 Yes - that's currently intended behavior - since filesystem utils needs quite some fixes to be able to handle this case. I'll attach created individual BZ here for tracking. Once utils are fixed - lvm2 will need to detect proper/fixed version of tools being present in system and let them proceed with operation in this case. Marking verified in the latest rpms. Based on comment #11, checked that these reduce/extend operations are no longer allowed until the devices have been remounted. 3.10.0-672.el7.x86_64 lvm2-2.02.171-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 lvm2-libs-2.02.171-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 lvm2-cluster-2.02.171-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 device-mapper-1.02.140-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 device-mapper-libs-1.02.140-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 device-mapper-event-1.02.140-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 device-mapper-event-libs-1.02.140-3.el7 BUILT: Wed May 31 08:36:29 CDT 2017 device-mapper-persistent-data-0.7.0-0.1.rc6.el7 BUILT: Mon Mar 27 10:15:46 CDT 2017 # extend lvextend -r -n -f -L 1.5G /dev/snapper_thinp/other1 WARNING: Sum of all thin volume sizes (6.50 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB)! fsadm: Cannot RESIZE device "/dev/mapper/snapper_thinp-other1" without umounting filesystem /mnt/other2 first. fsadm: Mounted filesystem is using device snapper_thinp-other1, but referenced device is snapper_thinp-other2. fsadm: Filesystem utilities currently do not support renamed devices. /usr/sbin/fsadm failed: 1 # reduce lvreduce -y -r -n -f -L 500M /dev/snapper_thinp/other1 fsadm: Cannot RESIZE device "/dev/mapper/snapper_thinp-other1" without umounting filesystem /mnt/other2 first. fsadm: Mounted filesystem is using device snapper_thinp-other1, but referenced device is snapper_thinp-other2. fsadm: Filesystem utilities currently do not support renamed devices. /usr/sbin/fsadm failed: 1 Filesystem resize failed. 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-2017:2222 |