<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 07/17/2014 07:44 PM, Willem Jan
      Palenstijn wrote:<br>
    </div>
    <blockquote cite="mid:20140717141430.GB21107@usecode.org"
      type="cite">
      <pre wrap="">Hi,

I'm running into unexpected behaviour with symlinks on a glusterfs volume
(3.5.1 on Arch Linux), where sometimes accessing a symlink on the volume
results in ENOENT (No such file or directory).

The following consistently reproduces it for me from a shell. At the end of
this post I've also included a short snippet of C that shows this inconsistency
between repeated readlink() syscalls.


$ ln -s x y
$ ls -al
ls: cannot read symbolic link y: No such file or directory
total 16
drwxr-xr-x 2 wjp wjp 4096 Jul 17 15:40 .
drwx------ 7 wjp wjp 4096 Jul 17 15:40 ..
lrwxrwxrwx 1 wjp wjp    1 Jul 17 15:40 y
$ ls -l y
lrwxrwxrwx 1 wjp wjp 1 Jul 17 15:40 y -&gt; x


Is this indeed unexpected, and if so, what would be a good next step to
investigate this?

The setup is glusterfs 3.5.1 on Arch Linux, with a stripe glusterfs volume
consisting of two bricks.
</pre>
    </blockquote>
    <br>
    Hi Willem,<br>
    <a class="moz-txt-link-freetext" href="http://review.gluster.org/#/c/8153/">http://review.gluster.org/#/c/8153/</a> fixes the <a
      href="https://bugzilla.redhat.com/show_bug.cgi?id=1111454">issue</a>.
    It should be available in the 3.5.2 release.<br>
    Thanks,<br>
    Ravi<br>
    <br>
    <blockquote cite="mid:20140717141430.GB21107@usecode.org"
      type="cite">
      <pre wrap="">

Thanks,
Willem Jan



----

$ gcc -o t test_glusterfs_symlink.c &amp;&amp; ./t
First readlink: -1 (errno 2)
Second readlink: 1

$ cat test_glusterfs_symlink.c 
#include &lt;unistd.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;sys/stat.h&gt;
#include &lt;stdio.h&gt;
#include &lt;dirent.h&gt;
#include &lt;errno.h&gt;

int main()
{
        FILE *f;
        int r1, r2, r3, e2, e3;
        struct dirent *p;
        DIR *d;
        char buf[2];
        struct stat s;

        r1 = symlink("x", "y");
        if (r1 != 0) {
                printf("Failed to create symlink\n");
                return -1;
        }

        d = opendir(".");
        p = readdir(d);

        r2 = readlink("y", buf, 2);
        e2 = errno;
        r3 = readlink("y", buf, 2);
        e3 = errno;

        printf("First readlink: %d", r2);
        if (r2 &lt; 0) printf(" (errno %d)", e2);
        printf("\nSecond readlink: %d", r3);
        if (r3 &lt; 0) printf(" (errno %d)", e3);
        printf("\n");

        unlink("y");

        return 0;
}


_______________________________________________
Gluster-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a>
<a class="moz-txt-link-freetext" href="http://supercolony.gluster.org/mailman/listinfo/gluster-users">http://supercolony.gluster.org/mailman/listinfo/gluster-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>