Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Instead of forbidding concurrent truncations, file-posix does the opposite. Because qemu always needs other permissions for truncation besides RESIZE itself, this still means concurrent truncations are effectively disallowed. But it also means that valid concurrent uses are disallowed as well.
Furthermore, the file locks are not released before the FD is closed. This may lead to locks staying applied when working with fdsets.
Steps to Reproduce:
$ qemu-img create -f raw -o preallocation=full foo.img 1G &; qemu-io -c info -c close -r foo.img
Actual results:
Formatting 'foo.img', fmt=raw size=1073741824 preallocation=full
can't open device foo.img: Failed to get "consistent read" lock
Is another process using the image?
Expected results:
Formatting 'foo.img', fmt=raw size=1073741824 preallocation=full
format name: raw
cluster size: 0 bytes
vm state offset: 0 bytes
Correction for the reproduction step:
$ qemu-img create -f raw -o preallocation=full foo.img 1G &; sleep 0.5; qemu-io -c info -c close -r foo.img
(Otherwise, the image file may or may not exist before qemu-io runs)
Max, we are not able to reproduce this bz by using the steps you provided:
# qemu-img create -f raw -o preallocation=full foo.img 1G & sleep 0.5; qemu-io -c info -c close -r foo.img
[1] 16582
Formatting 'foo.img', fmt=raw size=1073741824 preallocation=full
format name: raw
cluster size: 0 bytes
vm state offset: 0 bytes
# rpm -qa |grep qemu-img
qemu-img-rhev-2.12.0-1.el7.x86_64
Based on my testing results, this bz should be a regression since qemu-kvm-rhev-2.12.0-7.el7.
# qemu-img --version
qemu-img version 2.12.0 (qemu-kvm-rhev-2.12.0-6.el7)
# qemu-img create -f raw -o preallocation=full foo.img 1G & sleep 0.5; qemu-io -c info -c close -r foo.img
[1] 19257
Formatting 'foo.img', fmt=raw size=1073741824 preallocation=full
format name: raw
cluster size: 0 bytes
vm state offset: 0 bytes
# qemu-img --version
qemu-img version 2.12.0 (qemu-kvm-rhev-2.12.0-7.el7)
# qemu-img create -f raw -o preallocation=full foo.img 1G & sleep 0.5; qemu-io -c info -c close -r foo.img
[1] 19485
Formatting 'foo.img', fmt=raw size=1073741824 preallocation=full
can't open device foo.img: Failed to get "consistent read" lock
Is another process using the image?
Yes, that is correct. This is an issue with the backport for BZ 1519144, which was included in 2.12.0-7.
Sorry I did not specify the downstream version.
Max
Comment 7Miroslav Rezanina
2018-07-24 14:40:43 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.
https://access.redhat.com/errata/RHBA-2018:3443