Can you try with disabling &#39;write-behind&#39; and &#39;quick-read&#39; ? We have these type of tests in our QA which works fine on master branch as of now. Will reconfirm the behavior with master on GNU/Linux.<br><br>-Amar<br>
<br><div class="gmail_quote">On Sat, Mar 31, 2012 at 10:32 AM, Emmanuel Dreyfus <span dir="ltr">&lt;<a href="mailto:manu@netbsd.org">manu@netbsd.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have hit a bug in glusterfs on NetBSD, but I wonder if NetBSD FUSE is<br>
the culprit, or if the problem is in glusterfs itself. If I rename and<br>
open file, the unsync data get lost (it is replaced by a chunk of<br>
zeroes).<br>
<br>
The test case below exhibit the bug. Does it happens on Linux too, or is<br>
it a problem in NetBSD FUSE?<br>
<br>
#include &lt;stdio.h&gt;<br>
#include &lt;unistd.h&gt;<br>
#include &lt;fcntl.h&gt;<br>
#include &lt;err.h&gt;<br>
#include &lt;sysexits.h&gt;<br>
<br>
int<br>
main(void)<br>
{<br>
        int fd1, fd2;<br>
        char buf[] = &quot;abcdefgh&quot;;<br>
        char buf2[] = &quot;xxxxxxxx&quot;;<br>
<br>
        (void)unlink(&quot;tmp&quot;);<br>
        (void)unlink(&quot;tmp2&quot;);<br>
<br>
        if ((fd1 = open(&quot;tmp&quot;, O_CREAT|O_RDWR, 0644)) == -1)<br>
                err(EX_OSERR, &quot;cannot open tmp&quot;);<br>
<br>
        if (write(fd1, buf, sizeof(buf)) != sizeof(buf))<br>
                err(EX_OSERR, &quot;write failed&quot;);<br>
<br>
        if (rename(&quot;tmp&quot;, &quot;tmp2&quot;) == -1)<br>
                err(EX_OSERR, &quot;rename failed&quot;);<br>
<br>
        /* No bug if fd1 is closed or fsync&#39;ed before rename */<br>
        (void)close(fd1);<br>
<br>
        if ((fd2 = open(&quot;tmp2&quot;, O_RDONLY, 0)) == -1)<br>
                err(EX_OSERR, &quot;cannot open tmp2&quot;);<br>
<br>
        if (read(fd2, buf2, sizeof(buf2)) != sizeof(buf2))<br>
                err(EX_OSERR, &quot;read failed&quot;);<br>
<br>
        (void)close(fd2);<br>
<br>
        printf(&quot;buf  = \&quot;%s\&quot;\nbuf2 = \&quot;%s\&quot;\n&quot;, buf, buf2);<br>
<br>
        return 0;<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Emmanuel Dreyfus<br>
<a href="http://hcpnet.free.fr/pubz" target="_blank">http://hcpnet.free.fr/pubz</a><br>
<a href="mailto:manu@netbsd.org">manu@netbsd.org</a><br>
<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
</font></span></blockquote></div><br>