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 976045 - extension of external thin origin volume attempts to access beyond the disk
Summary: extension of external thin origin volume attempts to access beyond the disk
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-19 19:48 UTC by Corey Marthaler
Modified: 2023-03-08 07:25 UTC (History)
8 users (show)

Fixed In Version: lvm2-2.02.105-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:02:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2013-06-19 19:48:45 UTC
Description of problem:
Are external origin volumes even supposed to be modified?

# FROM LVCONVERT MAN PAGE:
--originname NewExternalOriginVolumeName
  The new name for original logical volume, which becomes external origin volume.
  Without  this  option a default names of "lvol#" will be generated where # is the LVM internal number of the logical volume.  This volume will be read-only and cannot be further modified as long, as it is being used as external origin.


[root@qalvm-01 ~]# df -h
Filesystem                        Size  Used Avail Use% Mounted on
[...]
/dev/mapper/snapper_thinp-origin 1014M   33M  982M   4% /mnt/origin


[root@qalvm-01 ~]# mount
[...]
/dev/mapper/snapper_thinp-origin on /mnt/origin type xfs (rw,relatime,attr2,inode64,noquota)


[root@qalvm-01 ~]# lvs -a -o +devices
  LV            VG            Attr      LSize  Pool Origin    Data%  Devices
  POOL          snapper_thinp twi-a-tz-  1.00g                  1.06 POOL_tdata(0)
  [POOL_tdata]  snapper_thinp Twi-ao---  1.00g                       /dev/vdh1(0)
  [POOL_tmeta]  snapper_thinp ewi-ao---  4.00m                       /dev/vdd1(0)
  extorigin     snapper_thinp ori------  1.00g                       /dev/vdg1(0)
  online_resize snapper_thinp Vwi-a-tz-  1.00g POOL origin      1.04
  origin        snapper_thinp Vwi-aotz-  1.00g POOL extorigin   1.04
  other1        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other2        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other3        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other4        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other5        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00


[root@qalvm-01 ~]# lvextend -L +500M -r /dev/snapper_thinp/origin
  Extending logical volume origin to 1.49 GiB
  Logical volume origin successfully resized
meta-data=/dev/mapper/snapper_thinp-origin isize=256    agcount=8, agsize=32768 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=262144, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Input/output error
fsadm: Resize xfs failed
  fsadm failed: 1


[root@qalvm-01 ~]# lvs -a -o +devices
  /dev/snapper_thinp/origin: read failed after 0 of 512 at 1597964288: Input/output error
  /dev/snapper_thinp/origin: read failed after 0 of 512 at 1598021632: Input/output error
  LV            VG            Attr      LSize  Pool Origin    Data%  Devices
  POOL          snapper_thinp twi-a-tz-  1.00g                  1.06 POOL_tdata(0)
  [POOL_tdata]  snapper_thinp Twi-ao---  1.00g                       /dev/vdh1(0)
  [POOL_tmeta]  snapper_thinp ewi-ao---  4.00m                       /dev/vdd1(0)
  extorigin     snapper_thinp ori------  1.00g                       /dev/vdg1(0)
  online_resize snapper_thinp Vwi-a-tz-  1.00g POOL origin      1.04
  origin        snapper_thinp Vwi-aotz-  1.49g POOL extorigin   0.70   <-- ### EXTENDED TO 1.5G ###
  other1        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other2        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other3        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other4        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other5        snapper_thinp Vwi-a-tz-  1.00g POOL             0.00


Jun 19 13:21:49 qalvm-01 kernel: [171929.896439] dm-7: rw=0, want=3121149, limit=2097152
Jun 19 13:21:49 qalvm-01 kernel: [171929.897239] attempt to access beyond end of device
Jun 19 13:21:49 qalvm-01 kernel: [171929.897903] dm-7: rw=0, want=3121150, limit=2097152
Jun 19 13:21:49 qalvm-01 kernel: [171929.898733] attempt to access beyond end of device
Jun 19 13:21:49 qalvm-01 kernel: [171929.899500] dm-7: rw=0, want=3121151, limit=2097152
Jun 19 13:21:49 qalvm-01 kernel: [171929.900226] attempt to access beyond end of device



Version-Release number of selected component (if applicable):
3.8.0-0.40.el7.x86_64
lvm2-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
lvm2-libs-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
lvm2-cluster-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-libs-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-event-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
device-mapper-event-libs-1.02.78-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013
cmirror-2.02.99-0.57.el7    BUILT: Mon Jun 17 08:28:21 CDT 2013


How reproducible:
Everytime

Comment 1 Corey Marthaler 2013-06-19 19:51:24 UTC
Here's just a simple volume resize, should lvm be allowing this attempt?

[root@qalvm-01 ~]# lvresize -L +500 snapper_thinp/origin
  Extending logical volume origin to 1.49 GiB
  Logical volume origin successfully resized

[root@qalvm-01 ~]# lvs -a -o +devices
  /dev/snapper_thinp/origin: read failed after 0 of 4096 at 1597964288: Input/output error
  /dev/snapper_thinp/origin: read failed after 0 of 4096 at 1598021632: Input/output error
  LV           VG            Attr      LSize  Pool Origin    Data%  Devices
  POOL         snapper_thinp twi-a-tz-  1.00g                  0.00 POOL_tdata(0)
  [POOL_tdata] snapper_thinp Twi-ao---  1.00g                       /dev/vdh1(0)
  [POOL_tmeta] snapper_thinp ewi-ao---  4.00m                       /dev/vdd1(0)
  extorigin    snapper_thinp ori------  1.00g                       /dev/vdg1(0)
  origin       snapper_thinp Vwi-a-tz-  1.49g POOL extorigin   0.00
  other1       snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other2       snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other3       snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other4       snapper_thinp Vwi-a-tz-  1.00g POOL             0.00
  other5       snapper_thinp Vwi-a-tz-  1.00g POOL             0.00

Comment 2 Zdenek Kabelac 2013-08-02 13:12:23 UTC
lvm2 tool needs to disable this for now - and kernel target needs to provide improved target to allow this operation. When the new version will be ready,
this feature which would support extension of thin volume using thin external origin volume could be enabled.

Comment 3 Alasdair Kergon 2013-08-02 23:19:17 UTC
The kernel target does not look at the size of the external origin at the moment.

I think we should keep this bug for fixing lvm2 not to allow this operation with the current version of the kernel target.

Then split off a kernel bugzilla.
E.g. record the external origin size on table load

tc->origin_dev_size = i_size_read(origin_dev->bdev->bd_inode) >> SECTOR_SHIFT;

and check the end of the bio data against this in process_bio() when deciding whether to remap or provision.

I think it's OK to require that the external origin is not reduced in size and this case does not need handling in the kernel.

We may also need to check what happens at the end of the device if the external origin is not an exact multiple of the pool block size.

Comment 4 Alasdair Kergon 2013-11-14 14:30:18 UTC
Use bug 1030411 for the kernel fix.  It might be the snapshot or the origin that is resized.

Comment 5 Corey Marthaler 2014-01-24 22:40:49 UTC
This still exists in the latest rpms.

[root@host-050 ~]# lvextend -L +500M -r /dev/snapper_thinp/origin
  Extending logical volume origin to 1.49 GiB
  Logical volume origin successfully resized
meta-data=/dev/mapper/snapper_thinp-origin isize=256    agcount=8, agsize=32768 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0
data     =                       bsize=4096   blocks=262144, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=12800, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Input/output error
fsadm: Resize xfs failed
  fsadm failed: 1

[92925.770555] attempt to access beyond end of device
[92925.770978] dm-7: rw=32, want=3121152, limit=2097152


lvm2-2.02.105-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
lvm2-libs-2.02.105-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
lvm2-cluster-2.02.105-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
device-mapper-1.02.84-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
device-mapper-libs-1.02.84-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
device-mapper-event-1.02.84-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
device-mapper-event-libs-1.02.84-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014
device-mapper-persistent-data-0.2.8-3.el7    BUILT: Fri Dec 27 13:40:56 CST 2013
cmirror-2.02.105-1.el7    BUILT: Wed Jan 22 07:34:15 CST 2014

Comment 6 Zdenek Kabelac 2014-01-28 10:47:46 UTC
Enhanced support introduced in couple upstream commits.

https://www.redhat.com/archives/lvm-devel/2014-January/msg00048.html
https://www.redhat.com/archives/lvm-devel/2014-January/msg00050.html
https://www.redhat.com/archives/lvm-devel/2014-January/msg00063.html

lvm2 with todays thin pool kernel targets (1.10) will support reduction of thin volume with external origin, but it will not allow extension with 2 different errors. Extension of lv with the same size as external origin will fail on unsupported kernel target feature. But if the LV has been already reduced, it will error on unsupported re-extension - since this would require a new type of nontrivial mapping to be created in dm-table.

Comment 8 Corey Marthaler 2014-02-06 22:56:10 UTC
The extension of external thin origins are no longer allowed in the latest rpms, however the error given is "Thin target does not support external origin smaller then thin volume." Shouldn't the error just say it's not allowed like when attempting to extend the actual origin volume? I think that may be more clear. Marking this bug verified and will open a low prior bug on the error message.

[root@host-003 ~]# lvs -a -o +devices
  LV              Attr       LSize   Pool Origin     Data%  Devices       
  POOL            twi-a-tz--   1.00g                 1.70   POOL_tdata(0) 
  [POOL_tdata]    Twi-ao----   1.00g                        /dev/sdg1(1)  
  [POOL_tmeta]    ewi-ao----   4.00m                        /dev/sdf1(0)  
  extorigin       ori------- 852.00m                        /dev/sdg1(257)
  [lvol0_pmspare] ewi-------   4.00m                        /dev/sdg1(0)  
  online_resize   Vwi-a-tz-k 852.00m POOL origin     2.03                 
  origin          Vwi-aotz-- 852.00m POOL extorigin  2.03                 
  other1          Vwi-a-tz-- 600.00m POOL            0.00                 
  other2          Vwi-a-tz-- 600.00m POOL            0.00                 
  other3          Vwi-a-tz-- 600.00m POOL            0.00                 
  other4          Vwi-a-tz-- 600.00m POOL            0.00                 
  other5          Vwi-a-tz-- 600.00m POOL            0.00                 

# thin extension attempt
[root@host-003 ~]# lvextend -L +100M -r /dev/snapper_thinp/origin
  Thin target does not support external origin smaller then thin volume.
  Run `lvextend --help' for more information.

# ext origin attempt
[root@host-003 ~]# lvextend -L +100M -r /dev/snapper_thinp/extorigin
  Cannot resize external origin "extorigin".
  Run `lvextend --help' for more information.


3.10.0-80.el7.x86_64
lvm2-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
lvm2-libs-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
lvm2-cluster-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-libs-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-event-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-event-libs-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-persistent-data-0.2.8-3.el7    BUILT: Fri Dec 27 13:40:56 CST 2013
cmirror-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014

Comment 9 Zdenek Kabelac 2014-02-07 11:48:31 UTC
(In reply to Corey Marthaler from comment #8)
> The extension of external thin origins are no longer allowed in the latest
> rpms, however the error given is "Thin target does not support external
> origin smaller then thin volume." Shouldn't the error just say it's not
> allowed like when attempting to extend the actual origin volume? I think
> that may be more clear. Marking this bug verified and will open a low prior
> bug on the error message.

In the future we will support more freedom in the size of thinly provisioned volumes with external origin. It will be detected and enabled once the thin pool targets works properly in this case.

Comment 10 Ludek Smid 2014-06-13 12:02:06 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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