[Gluster-devel] qa39 crash

Emmanuel Dreyfus manu at netbsd.org
Wed May 2 09:30:32 UTC 2012


On Tue, May 01, 2012 at 10:29:22PM -0700, Anand Avati wrote:
> Can you confirm if this fixes (obvious bug) -

I do not crash anymore, but I spotted another bug, I do not know if
it is related: removing owner write access to a non empty file open 
with write access fails with EPERMo

Here is my test case. It works fine with glusterfs-3.2.6 but fchmod()
fails with EPERM on 3.3.0qa39

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <err.h>
#include <sysexits.h>
#include <sys/stat.h>

int
main(void)
{
        int fd;
        char buf[16];

        if ((fd = open("test.tmp", O_RDWR|O_CREAT, 0644)) == -1)
                err(EX_OSERR, "fopen failed");

        if (write(fd, buf, sizeof(buf)) != sizeof(buf))
                err(EX_OSERR, "write failed");

        if (fchmod(fd, 0444) == -1)
                err(EX_OSERR, "fchmod failed");

        if (close(fd) == -1)
                err(EX_OSERR, "close failed");

        return EX_OK;
}



-- 
Emmanuel Dreyfus
manu at netbsd.org




More information about the Gluster-devel mailing list