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 1834281 - qemu-img convert abort when converting image with unaligned size
Summary: qemu-img convert abort when converting image with unaligned size
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: qemu-kvm
Version: 8.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.3
Assignee: Kevin Wolf
QA Contact: Xueqiang Wei
URL:
Whiteboard:
Depends On: 1834646
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-11 12:59 UTC by Xueqiang Wei
Modified: 2021-12-07 22:45 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-4.2.0-44.module+el8.4.0+9776+c5744f20
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1834646 (view as bug list)
Environment:
Last Closed: 2021-05-18 15:21:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xueqiang Wei 2020-05-11 12:59:50 UTC
Description of problem:

# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
qemu-img: block/io.c:1871: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
Aborted (core dumped)



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

kernel-4.18.0-194.el8.x86_64
qemu-kvm-4.2.0-19.module+el8.3.0+6478+69f490bb
qemu-img-4.2.0-19.module+el8.3.0+6478+69f490bb


How reproducible:
100%

Steps to Reproduce:
1. # mount -t nfs -o soft,vers=4.2 10.66.61.132:/home/nfs_server/ /home/kvm_autotest_root/images/
2. # cd /home/kvm_autotest_root/images/
3. # truncate -s 11136 test.img
4. # qemu-io -c 'write -P 1 0 10K' test.img -f raw
5. # qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc


Actual results:
after step5:
# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
qemu-img: block/io.c:1871: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
Aborted (core dumped)

Expected results:
# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
    (100.00/100%)



Additional info:
It works well on rhel8.1.0 slow train and rhel8.1.0 fast train.
It doesn't work on rhel.2.0 slow train and rhel8.2.0 fast train.

Details:
1. according to https://bugzilla.redhat.com/show_bug.cgi?id=1678979#c19, it had been fixed on rhel8.1.0 slow train.

Tested with qemu-kvm-2.12.0-83.module+el8.1.0+3852+0ba8aef0, it works well.
# truncate -s 11136 test.img
# qemu-io -c 'write -P 1 0 10K' test.img -f raw
wrote 10240/10240 bytes at offset 0
10 KiB, 1 ops; 0.0346 sec (288.218 KiB/sec and 28.8218 ops/sec)
# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
    (100.00/100%)

2. according to https://bugzilla.redhat.com/show_bug.cgi?id=1588356#c16, it had been fixed on rhel8.1.0 fast train.

Tested with qemu-kvm-4.0.0-5.module+el8.1.0+3622+5812d9bf, it works well.
# truncate -s 11136 test.img
# qemu-io -c 'write -P 1 0 10K' test.img -f raw
wrote 10240/10240 bytes at offset 0
10 KiB, 1 ops; 0.0278 sec (359.557 KiB/sec and 35.9557 ops/sec)
# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
    (100.00/100%)

3. Tested on rhel8.2.0 slow train, it doesn't work.

Tested with qemu-kvm-2.12.0-99.module+el8.2.0+5827+8c39933c, qemu core dumped.

# truncate -s 11136 test.img
# qemu-io -c 'write -P 1 0 10K' test.img -f raw
wrote 10240/10240 bytes at offset 0
10 KiB, 1 ops; 0.0453 sec (220.386 KiB/sec and 22.0386 ops/sec)
# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
qemu-img: block/io.c:1646: bdrv_aligned_pwritev: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
Aborted (core dumped)

4. Tested on rhel8.2.0 fast train, it doesn't work.

Tested with qemu-kvm-4.2.0-19.module+el8.2.0+6296+6b821950, qemu core dumped

# truncate -s 11136 test.img
# qemu-io -c 'write -P 1 0 10K' test.img -f raw
wrote 10240/10240 bytes at offset 0
10 KiB, 1 ops; 00.04 sec (236.864 KiB/sec and 23.6864 ops/sec)
# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
qemu-img: block/io.c:1871: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
Aborted (core dumped)

Comment 2 John Ferlan 2020-05-15 14:36:38 UTC
Adjusting dependency order - fix goes into RHEL AV first, then RHEL.

Comment 3 John Ferlan 2020-05-19 20:43:53 UTC
Assigned to Ademar for initial triage per bz process and age of bug created or assigned to virt-maint without triage.

Not sure if this would be Kevin or Max. If bug 1834646 makes it into RHEL AV 8.2.1, then this bug would pick up change when rebase occurs

Comment 12 Xueqiang Wei 2021-01-26 10:55:21 UTC
Tested it on rhel8.4 slow train, hit this issue.

Versions:
kernel-4.18.0-277.el8.x86_64
qemu-kvm-4.2.0-41.module+el8.4.0+9504+ab2393e6


steps:
1. # mkdir -p /home/kvm_autotest_root/images/
   # mount -t nfs -o soft,vers=4.2 10.66.61.132:/home/nfs_server/ /home/kvm_autotest_root/images/

2. # cd /home/kvm_autotest_root/images/

3. # truncate -s 11136 test.img

4. # qemu-io -c 'write -P 1 0 10K' test.img -f raw
wrote 10240/10240 bytes at offset 0
10 KiB, 1 ops; 00.04 sec (247.197 KiB/sec and 24.7197 ops/sec)

5. # qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
qemu-img: block/io.c:1871: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
Aborted (core dumped)

Comment 15 Xueqiang Wei 2021-02-02 23:07:07 UTC
Tested it with qemu-kvm-4.2.0-44.module+el8.4.0+9776+c5744f20, not hit this issue.

Versions:
kernel-4.18.0-280.el8.x86_64
qemu-kvm-4.2.0-44.module+el8.4.0+9776+c5744f20


steps:
1. # mkdir -p /home/kvm_autotest_root/images/
   # mount -t nfs -o soft,vers=4.2 10.66.61.132:/home/nfs_server/ /home/kvm_autotest_root/images/

2. # cd /home/kvm_autotest_root/images/

3. # truncate -s 11136 test.img

4. # qemu-io -c 'write -P 1 0 10K' test.img -f raw
wrote 10240/10240 bytes at offset 0
10 KiB, 1 ops; 00.03 sec (293.422 KiB/sec and 29.3422 ops/sec)

5. # qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=falloc
    (100.00/100%)
  # echo $?
  0

# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=full
    (100.00/100%)
# echo $?
  0

# qemu-img convert -f raw -O raw -p -t none -T none test.img tgt.img -o preallocation=off
    (100.00/100%)
# echo $?
  0

Comment 16 Xueqiang Wei 2021-02-03 16:05:50 UTC
Hi Danilo,

Shall we add this bug to errata and change it to ON_QA status? Thanks.

Comment 20 Xueqiang Wei 2021-02-04 01:52:10 UTC
According to Comment 15, set status to VERIFIED. Thanks.

Comment 22 errata-xmlrpc 2021-05-18 15:21:14 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 (Moderate: virt:rhel and virt-devel:rhel 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-2021:1762


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