Bug 748902 - qemu fails on disk with 4k sectors and cache=off
qemu fails on disk with 4k sectors and cache=off
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
Depends On:
Blocks: 748906 749122
  Show dependency treegraph
Reported: 2011-10-25 10:29 EDT by Matthew Booth
Modified: 2015-02-27 22:14 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 748906 (view as bug list)
Last Closed: 2012-05-28 20:32:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Matthew Booth 2011-10-25 10:29:08 EDT
Description of problem:
qemu returns numerous read errors when run with a file-backed disk which is stored on a disk with 4k physical sectors. The underlying cause of these read errors is pread() returning EINVAL in handle_aiocb_rw_linear(). Configuring the appliance to not use cache=off makes the problem go away.

By default, qemu seems to be aligning reads to 512 bytes. This fails for a file opened with O_DIRECT when the sector size is 4096 bytes. Disks with 4k sectors are only just starting to come to the market.

# fdisk -l /dev/vg_dellper30001/lv_home
Note: sector size is 4096 (not 512)

Disk /dev/vg_dellper30001/lv_home: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 81 cylinders, total 1310720 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

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

How reproducible:

Steps to Reproduce:
I hit the problem with libguestfs. If you have a libguestfs source tree, and a physical disk with 4k sectors, after configure and make, run:

make -C images check
Actual results:
This will fail almost immediately in pvcreate.

Expected results:
qemu should check the sector size with the appropriate ioctl rather than using a hard-coded value of 512 bytes. It should Just Work(TM).
Comment 1 Fedora Admin XMLRPC Client 2012-03-15 13:54:20 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Cole Robinson 2012-05-28 20:32:29 EDT
Hmm, according to bug 608548, upstream has fixes and they should be in F15's qemu version. Maybe there was a missing piece?

Either way F15 is end of life pretty soon, so closing. mbooth, if this is still an issue in newer fedora, please reopen and we can go from there.

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