[Gluster-devel] regarding fsetattr

Pranith Kumar Karampuri pkarampu at redhat.com
Thu May 29 09:38:33 UTC 2014


hi,
   When I run the following program on fuse mount it fails with ENOENT. When I look at the mount logs, it prints error for setattr instead of fsetattr. Wondering anyone knows why the fop comes as setattr instead of fsetattr.

Log:
[2014-05-29 09:33:38.658023] W [fuse-bridge.c:1056:fuse_setattr_cbk] 0-glusterfs-fuse: 2569: SETATTR() <gfid:ae44dd74-ff45-42a8-886e-b4ce2373a267> => -1 (No such file or directory)

Program:
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>


int
main ()
{
        int ret = 0;
        int fd=open("a.txt", O_CREAT|O_RDWR);

        if (fd < 0)
                printf ("open failed: %s\n", strerror(errno));
        ret = unlink("a.txt");
        if (ret < 0)
                printf ("unlink failed: %s\n", strerror(errno));
        if (write (fd, "abc", 3) < 0)
                printf ("Not able to print %s\n", strerror (errno));
        ret = fchmod (fd, S_IRUSR|S_IWUSR|S_IXUSR);
        if (ret < 0)
                printf ("fchmod failed %s\n", strerror(errno));
        return 0;
}

Pranith


More information about the Gluster-devel mailing list