<div dir="ltr"><div class="gmail_extra">My below mail didn&#39;t make it to the list, hence resending...<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 5, 2013 at 8:04 PM, Bharata B Rao <span dir="ltr">&lt;<a href="mailto:bharata@linux.vnet.ibm.com" target="_blank">bharata@linux.vnet.ibm.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Oct 30, 2013 at 11:26:48PM +0530, Bharata B Rao wrote:<br>
&gt; On Tue, Oct 29, 2013 at 1:21 PM, Anand Avati &lt;<a href="mailto:avati@gluster.org">avati@gluster.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Looks like what is happening is that qemu performs ioctls() on the backend<br>
&gt; &gt; to query logical_block_size (for direct IO alignment). That works on XFS,<br>
&gt; &gt; but fails on FUSE (hence qemu ends up performing IO with default 512<br>
&gt; &gt; alignment rather than 4k).<br>
&gt; &gt;<br>
&gt; &gt; Looks like this might be something we can enhance gluster driver in qemu.<br>
&gt; &gt; Note that glusterfs does not have an ioctl() FOP, but we could probably<br>
&gt; &gt; wire up a virtual xattr call for this purpose.<br>
&gt; &gt;<br>
&gt; &gt; Copying Bharata to check if he has other solutions in mind.<br>
&gt; &gt;<br>
&gt;<br>
&gt; I see alignment issues and subsequent QEMU failure (pread() failing with<br>
&gt; EINVAL) when I use a file from XFS mount point (with sectsz=4k) as a virtio<br>
&gt; disk with cache=none QEMU option. However this failure isn&#39;t seen when I<br>
&gt; have sectsz=512. And all this is w/o gluster. So there seems to be some<br>
&gt; alignment issues even w/o gluster, I will debug more and get back.<br>
<br>
</div>I gather that QEMU block layer and SeaBIOS don&#39;t yet support 4k sectors.<br>
So this is not a QEMU-GlusterFS specific issue.<br>
<br>
You could either not use cache=none option which results in O_DIRECT<br>
or use the below something like below which explicitly sets the sector size<br>
and min io size for the guest.<br>
<br>
-drive file=/mnt/xfs.img,if=none,cache=none,format=raw,id=mydisk -device virtio-blk,drive=mydisk,logical_block_size=4096,physical_block_size=4096,min_io_size=4096<br>
<br>
Ref: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=997839" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=997839</a><br>
<br>
Regards,<br>
Bharata.<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><a href="http://raobharata.wordpress.com/" target="_blank">http://raobharata.wordpress.com/</a>
</div></div>