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.
The libguestfs utilities were not able to use disk images on XFS file systems with 4-kilobyte sector size. This update introduces the "cachemode" parameter for the add_drive API, which controls drive caching and has a default value which allows disk images stored on the described file systems to be usable.
Description of problem:
libguestfs using cache type equivalent to quemu's cache=none option.
Basically it means disk images will be opened with O_DIRECT option.
xfs requires all I/O operation count/size needs to be integer multiple of the sector size.
If my sector size is 4k, the 512 byte read is invalid:
strace -Ff -e pread,read,open,write,read guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run
...
[pid 18605] open("Fedora-x86_64-19-20130627-sda.qcow2", O_RDWR|O_DIRECT|O_CLOEXEC) = 6
[pid 18616] pread(6, 0x7fce10000a00, 512, 0) = -1 EINVAL (Invalid argument)
....
Version-Release number of selected component (if applicable):
qemu-img-0.12.1.2-2.415.el6_5.3.x86_64
qemu-kvm-0.12.1.2-2.415.el6_5.3.x86_64
gpxe-roms-qemu-0.9.7-6.10.el6.noarch
libguestfs-1.20.11-2.el6.x86_64
libguestfs-tools-c-1.20.11-2.el6.x86_64
How reproducible:
always
Steps to Reproduce:
1. mkfs.xfs -f -s size=4096 /dev/vdb
2. mkdir /mnt/4k
3. mount /dev/vdb /mnt/4k
4. cd /mnt/4k
5. wget http://download.fedoraproject.org/pub/fedora/linux/releases/19/Images/x86_64/Fedora-x86_64-19-20130627-sda.qcow2
6. guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run
Actual results:
[root@xfs 4k]# guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run
libguestfs: error: /usr/libexec/qemu-kvm exited with error status 1.
To see full error messages you may need to enable debugging.
See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
libguestfs: error: guestfs_launch failed.
See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
and/or run 'libguestfs-test-tool'.
Expected results:
[root@xfs 512b]# guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run
[root@xfs 512b]#
Do not use O_DIRECT.
Additional info:
The O_DIRECT is not used when the file-system refusing to open the image with O_DIRECT (like on tmpfs), but in the above situation it is failing on the read/write alignment and size requirements.
Newer version of the libguestfs are allowing to use the "writeback" mode.
(Disk with 4k physical sector size are very common in the market, probably in 2014 several now disk will also have 4k logical sector size.)
Comment 1Richard W.M. Jones
2013-12-06 09:55:33 UTC
Comment 2Richard W.M. Jones
2014-03-24 08:13:02 UTC
Pino: Fixing this involves backporting all the cachemode
stuff to RHEL 6. Up to you if you can do this or think it
is too risky for an old stable RHEL release.
Comment 3Richard W.M. Jones
2014-06-20 13:21:20 UTC
We decided not to fix this in RHEL 6. However it has been
fixed in RHEL 7.0 and above.
Comment 4Richard W.M. Jones
2014-08-04 09:27:22 UTC
I'm reopening this on the basis that two people have reported this
bug in RHOS when using XFS as a backing store for disk images.
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://rhn.redhat.com/errata/RHBA-2015-1444.html
Description of problem: libguestfs using cache type equivalent to quemu's cache=none option. Basically it means disk images will be opened with O_DIRECT option. xfs requires all I/O operation count/size needs to be integer multiple of the sector size. If my sector size is 4k, the 512 byte read is invalid: strace -Ff -e pread,read,open,write,read guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run ... [pid 18605] open("Fedora-x86_64-19-20130627-sda.qcow2", O_RDWR|O_DIRECT|O_CLOEXEC) = 6 [pid 18616] pread(6, 0x7fce10000a00, 512, 0) = -1 EINVAL (Invalid argument) .... Version-Release number of selected component (if applicable): qemu-img-0.12.1.2-2.415.el6_5.3.x86_64 qemu-kvm-0.12.1.2-2.415.el6_5.3.x86_64 gpxe-roms-qemu-0.9.7-6.10.el6.noarch libguestfs-1.20.11-2.el6.x86_64 libguestfs-tools-c-1.20.11-2.el6.x86_64 How reproducible: always Steps to Reproduce: 1. mkfs.xfs -f -s size=4096 /dev/vdb 2. mkdir /mnt/4k 3. mount /dev/vdb /mnt/4k 4. cd /mnt/4k 5. wget http://download.fedoraproject.org/pub/fedora/linux/releases/19/Images/x86_64/Fedora-x86_64-19-20130627-sda.qcow2 6. guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run Actual results: [root@xfs 4k]# guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run libguestfs: error: /usr/libexec/qemu-kvm exited with error status 1. To see full error messages you may need to enable debugging. See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs libguestfs: error: guestfs_launch failed. See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs and/or run 'libguestfs-test-tool'. Expected results: [root@xfs 512b]# guestfish -a Fedora-x86_64-19-20130627-sda.qcow2 run [root@xfs 512b]# Do not use O_DIRECT. Additional info: The O_DIRECT is not used when the file-system refusing to open the image with O_DIRECT (like on tmpfs), but in the above situation it is failing on the read/write alignment and size requirements. Newer version of the libguestfs are allowing to use the "writeback" mode. (Disk with 4k physical sector size are very common in the market, probably in 2014 several now disk will also have 4k logical sector size.)