Can you try with disabling 'write-behind' and 'quick-read' ? 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"><<a href="mailto:manu@netbsd.org">manu@netbsd.org</a>></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 <stdio.h><br>
#include <unistd.h><br>
#include <fcntl.h><br>
#include <err.h><br>
#include <sysexits.h><br>
<br>
int<br>
main(void)<br>
{<br>
int fd1, fd2;<br>
char buf[] = "abcdefgh";<br>
char buf2[] = "xxxxxxxx";<br>
<br>
(void)unlink("tmp");<br>
(void)unlink("tmp2");<br>
<br>
if ((fd1 = open("tmp", O_CREAT|O_RDWR, 0644)) == -1)<br>
err(EX_OSERR, "cannot open tmp");<br>
<br>
if (write(fd1, buf, sizeof(buf)) != sizeof(buf))<br>
err(EX_OSERR, "write failed");<br>
<br>
if (rename("tmp", "tmp2") == -1)<br>
err(EX_OSERR, "rename failed");<br>
<br>
/* No bug if fd1 is closed or fsync'ed before rename */<br>
(void)close(fd1);<br>
<br>
if ((fd2 = open("tmp2", O_RDONLY, 0)) == -1)<br>
err(EX_OSERR, "cannot open tmp2");<br>
<br>
if (read(fd2, buf2, sizeof(buf2)) != sizeof(buf2))<br>
err(EX_OSERR, "read failed");<br>
<br>
(void)close(fd2);<br>
<br>
printf("buf = \"%s\"\nbuf2 = \"%s\"\n", 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>