<div dir="ltr">You are seeing a side-effect of <span style="color:rgb(0,0,0)"><a href="http://review.gluster.com/3631">http://review.gluster.com/3631</a>. Which means: if your backend filesystem uses 4KB blocks, then the value reported by gluster will be at worst 7 blocks smaller (4KB / 512 - 1).</span></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 3:13 AM, Maik Kulbe <span dir="ltr">&lt;<a href="mailto:info@linux-web-development.de" target="_blank">info@linux-web-development.de</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"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So st_blocks on FUSE mount is different from st_blocks on backend for the<br>
same file?<br>
</blockquote>
<br></div>
Yes. Just a quick example: I create a file with 5 Bytes in size. I theory Gluster should report 8 x 512 Byte blocks, because the underlying XFS uses a 4K block size. Instead, it reports the minimum count of blocks the file size would fit in:<br>

<br>
client&gt; echo test &gt; /gluster/tmp/test.txt<br>
<br>
client&gt; stat /gluster/tmp/test.txt<br>
 File: `/gluster/tmp/test.txt&#39;<br>
 Size: 5                Blocks: 1          IO Block: 131072 regular file<br>
Device: 14h/20d Inode: 12072747239032953097  Links: 1<br>
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)<br>
Access: 2013-11-26 12:09:22.960828776 +0100<br>
Modify: 2013-11-26 12:09:22.964828962 +0100<br>
Change: 2013-11-26 12:09:22.964828962 +0100<br>
Birth: -<br>
<br>
gluster&gt; stat /bricks/0/tmp/test.txt<br>
 File: `/bricks/0/tmp/test.txt&#39;<br>
 Size: 5                Blocks: 8          IO Block: 4096   regular file<br>
Device: ca03h/51715d    Inode: 859069733   Links: 2<br>
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)<br>
Access: 2013-11-26 12:09:22.957683891 +0100<br>
Modify: 2013-11-26 12:09:22.961684089 +0100<br>
Change: 2013-11-26 12:09:22.961684089 +0100<br>
Birth: -<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Nov 25, 2013 8:50 AM, &quot;Maik Kulbe&quot; &lt;<a href="mailto:info@linux-web-development.de" target="_blank">info@linux-web-development.de</a><u></u>&gt;<br>
wrote:<br>
<br>
>From man (2) stat:<br>
<br>
blksize_t st_blksize; /* blocksize for file system I/O */<br>
blkcnt_t  st_blocks;  /* number of 512B blocks allocated */<br>
<br>
The 128K  you are seeing is &quot;st_blksize&quot; which is the recommended I/O<br>
transfer size. The number of consumed blocks is always reported as 512<br>
byte blocks. The actual block size with which storage allocation<br>
happens<br>
depends on the backend filesystem.<br>
<br>
This is what was confusing me. On the file systems one of our<br>
programmers tested the latter one it was always showing the blocks<br>
allocated. So if you had a 1k file and 4k block size it would report 8<br>
512-byte blocks, gluster just reports 2 blocks.<br>
<br>
Avati<br>
<br>
On Mon, Nov 25, 2013 at 7:18 AM, Maik Kulbe<br>
&lt;<a href="mailto:info@linux-web-development.de" target="_blank">info@linux-web-development.de</a><u></u>&gt; wrote:<br>
<br>
Hi,<br>
<br>
I&#39;ve come to notice that the file system block size reported from stat<br>
on a client is 128k, which is pretty high for the small files I use.<br>
On<br>
the other hand, I tested copying smaller files to the volume and it<br>
seems those 128k are not the real block size - when I copy two 64k<br>
files<br>
to the volume `df` reports only a change after both files have been<br>
copied.<br>
<br>
So my question would be what is the real block size for the Gluster<br>
volume? The block size of the underlying xfs? Or something else? And<br>
is<br>
it possible to read the real block size? We wanted to use the block<br>
size<br>
reported by stat to calculate the real file size use on disk but it<br>
seems that is not possible with Gluster..<br>
<br>
Thank you in advance,<br>
Maik<br>
______________________________<u></u>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
<a href="http://supercolony.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://supercolony.gluster.<u></u>org/mailman/listinfo/gluster-<u></u>users</a><br>
</blockquote>
</div></div></blockquote></div><br></div>