gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] qa39 crash


From: Emmanuel Dreyfus
Subject: Re: [Gluster-devel] qa39 crash
Date: Wed, 2 May 2012 09:30:32 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

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
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]