Bug 1140128 - When thin pool creation is aborted, a left-over linear LV appears in the system.
Summary: When thin pool creation is aborted, a left-over linear LV appears in the system.
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
Depends On:
TreeView+ depends on / blocked
Reported: 2014-09-10 10:56 UTC by Nenad Peric
Modified: 2015-07-22 07:35 UTC (History)
8 users (show)

Fixed In Version: lvm2-2.02.117-1.el6
Doc Type: Bug Fix
Doc Text:
When volume list prohibited activation of volumes during thin pool creation on error code path some volumes could have been left in device mapper table active without proper lock being held. All such volumes are now properly deactivated first before tool exits.
Clone Of:
Last Closed: 2015-07-22 07:35:28 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1411 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2015-07-20 18:06:52 UTC

Description Nenad Peric 2014-09-10 10:56:03 UTC
Description of problem:

When a thin pool is prevented from being activated, the creation fails (as expected) but a non-expected side effects happen. There are two abort messages, and a leftover of a linear 4 MB LV (a failed pool metadata LV creation attempt) is present on the system. 

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


How reproducible:


Steps to Reproduce:
1. Edit volume_list in such a way that a new pool cannot be activated.
2. Create (or attempt to) a new thin pool:
lvcreate -T vg/thin_pool2 -L1G

Actual results:
Two "Aborting.." messages displayed:

[root@virt-147 ~]# lvcreate -T vg/thin_pool2 -L1G
  Volume "vg/thin_pool2" is not active locally.
  Aborting. Failed to wipe pool metadata thin_pool2.
  Aborting. Could not deactivate pool thin_pool2.

[root@virt-147 ~]# lvs -a
  LV                VG         Attr       LSize   Pool      Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data              vg         Vwi---tz--   1.00g thin_pool                                               
  [lvol0_pmspare]   vg         ewi-------   4.00m                                                         
  newpool           vg         -wi-------   4.00m                                                         
  other             vg         -wi-a-----   1.00g                                                         
  thin_pool         vg         twi---tz--   1.00g                                                         
  thin_pool2        vg         -wi-------   4.00m                                                         
  [thin_pool_tdata] vg         Twi-------   1.00g                                                         
  [thin_pool_tmeta] vg         ewi-------   4.00m                                                         
  lv_root           vg_virt147 -wi-ao----   6.71g                                                         
  lv_swap           vg_virt147 -wi-ao---- 816.00m                          

Pool creation fails and a linear LV is there with its name instead.

Expected results:

If a thin pool creation fails, or is not permitted by configuration any leftover devices should be removed, especially the ones which hold the name of a thin pool which was expected to be created in the first place. 

Additional info:

This may not be an isolated case to thin pools though, maybe other parts of LV creation are affected, but it is easiest to reproduce with thin pools.

Comment 2 Zdenek Kabelac 2014-09-10 11:19:28 UTC
Yep - Just needs another test for active device after activation - easy to fix in this particular place - it's just how many other cases needs the similar test

Comment 3 Zdenek Kabelac 2014-09-15 12:01:08 UTC
Fixed upstream:


Comment 6 Corey Marthaler 2015-04-27 21:26:15 UTC
Fix verified in the latest rpms.

lvm2-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
lvm2-libs-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
lvm2-cluster-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
udev-147-2.61.el6    BUILT: Mon Mar  2 05:08:11 CST 2015
device-mapper-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-libs-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-event-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-event-libs-1.02.95-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.118-2.el6    BUILT: Wed Apr 15 06:34:08 CDT 2015

SCENARIO - [aborted_create_attempt]
Aborted thin pool creation check
Editing volume_list tag section
Making origin volume
lvcreate  --thinpool POOL  --zero n -L 1G snapper_thinp
  Volume "snapper_thinp/lvol0" is not active locally.
  Aborting. Failed to wipe start of new LV.
couldn't create thinpool
Check for left over devices...
Restoring default volume_list section

Comment 7 errata-xmlrpc 2015-07-22 07:35:28 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.


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