Bug 1534898 - qemu-img should give meaningful error messages when create 16TB luks format image on ext4
Summary: qemu-img should give meaningful error messages when create 16TB luks format i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: ---
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Maxim Levitsky
QA Contact: Xueqiang Wei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-16 08:59 UTC by Ping Li
Modified: 2020-11-17 17:45 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-5.1.0-2.module+el8.3.0+7652+b30e6901
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-17 17:44:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ping Li 2018-01-16 08:59:56 UTC
Description of problem:
Enterprise Linux 7 can support a maximum individual file size of 16TB. When create a 16 TB raw image, qemu-img reports the image size is too large. However, when create a 16Tb luks image, the error prompt is a little different. qemu-img should give meaningful error messages like creating raw image does.
Can reproduce the issue with qemu-kvm-rhev-2.9.0-14.el7.

Version-Release number of selected component (if applicable):
kernel-3.10.0-829.el7.x86_64
qemu-kvm-rhev-2.10.0-16.el7

How reproducible:
100%

Steps to Reproduce:
1. Mount an ext4 file system 
# mount -t ext4 /dev/sdc /home/tests/ext4
# df -Th /home/tests/ext4/
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sdc       ext4   40G   49M   38G   1% /home/tests/ext4

2. Create a luks image specified image size as 16TB
# qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0 test.luks 16T
Formatting 'test.luks', fmt=luks size=17592186044416 key-secret=sec0
qemu-img: test.luks: Could not resize file: File too large

# qemu-img info test.luks 
image: test.luks
file format: raw
virtual size: 0 (0 bytes)
disk size: 0

3. Create a raw image specified image size as 16TB
# qemu-img create -f raw test.img 16T
Formatting 'test.img', fmt=raw size=17592186044416
qemu-img: test.img: The image size is too large for file format 'raw'

# qemu-img info test.img 
image: test.img
file format: raw
virtual size: 0 (0 bytes)
disk size: 0

Actual results:
Report that image size is too large

Expected results:
Report that could not resize file, and image is created in raw format

Additional info:

Comment 3 John Ferlan 2019-08-02 13:27:37 UTC
Upstream patch:

https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg04779.html

Comment 4 Tingting Mao 2019-08-06 07:46:09 UTC
Reproduced this issue in latest qemu package.


Steps:
# qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0  test.luks 16T
Formatting 'test.luks', fmt=luks size=17592186044416 key-secret=sec0
qemu-img: test.luks: Could not resize file: File too large

# qemu-img info test.luks 
image: test.luks
file format: raw
virtual size: 0 (0 bytes)
disk size: 0

# df -T test.luks 
Filesystem     Type 1K-blocks  Used Available Use% Mounted on
/dev/loop0     ext4   5095040 20472   4796040   1% /mnt


# qemu-img --version
qemu-img version 4.0.0 (qemu-kvm-4.0.0-6.module+el8.1.0+3736+a2aefea3)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

Comment 5 Ademar Reis 2020-02-05 22:46:32 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks

Comment 9 Xueqiang Wei 2020-08-13 13:55:06 UTC
Tested with qemu-kvm-5.1.0-2.module+el8.3.0+7652+b30e6901, not hit this issue. So set status to VERIFIED.

Versions:
kernel-4.18.0-232.el8.x86_64
qemu-kvm-5.1.0-2.module+el8.3.0+7652+b30e6901


create 16TB luks format image on ext4

# qemu-img create -f raw loop_img 50G
# losetup /dev/loop0 loop_img 
# mkfs.ext4  /dev/loop0 
# mkdir /home/luks_test
# mount /dev/loop0 /home/luks_test/
# df -T
Filesystem                                      Type           1K-blocks      Used Available Use% Mounted on
/dev/loop0                                      ext4            51343840     53272  48652744   1% /home/luks_test


# qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0  /home/luks_test/test.luks 16T
Formatting '/home/luks_test/test.luks', fmt=luks size=17592186044416 key-secret=sec0
qemu-img: /home/luks_test/test.luks: The requested file size is too large

# ls /home/luks_test/*
#


I also try to create 8EiB luks image on xfs file system, it work well too.

# umount /home/luks_test 
# mkfs.xfs -f /dev/loop0 
# mount /dev/loop0 /home/luks_test/

# df -T
Filesystem                                      Type           1K-blocks      Used Available Use% Mounted on
/dev/loop0                                      xfs             52403200    398400  52004800   1% /home/luks_test

# qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0  /home/luks_test/test.luks 8E
qemu-img: Invalid image size specified. Must be between 0 and 9223372036854775807.

# ls /home/luks_test/
#

Comment 12 errata-xmlrpc 2020-11-17 17:44:45 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 (virt:8.3 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/RHBA-2020:5137


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