[Gluster-devel] NULL loc in posix_acl_truncate

Emmanuel Dreyfus manu at netbsd.org
Sun May 27 05:17:51 UTC 2012

Emmanuel Dreyfus <manu at netbsd.org> wrote:

> In frame 10, loc->path and loc->inode are NULL.

Here is the investigation so far:
xlators/features/locks/src/posix.c:truncate_stat_cbk() has a NULL
loc->inode, and this leads to the acl check that fails.

As I understand this is a FUSE implentation problem. fchmod() produces a
FUSE SETATTR. If the file is being written, NetBSD FUSE will set mode,
size, atime, mtime, and fh in this operation. I suspect Linux FUSE only
sets mode and fh and this is why the bug does not appear on Linux: the
truncate code path is probably not involved.

Can someone confirm? If this is the case, it suggests the code path may
have never been tested. I suspect there are bugs there, for instance, in
pl_truncate_cbk, local is erased after being retreived, which does not
look right:

        local = frame->local; 
        local = mem_get0 (this->local_pool);
        if (local->op == TRUNCATE)
                loc_wipe (&local->loc);

I tried fixing that one without much improvments. There may be other

About fchmod() setting size: is it a reasonable behavior? FUSE does not
specify what must happens, so if glusterfs rely on the Linux kernel not
doing it may be begging for future bugs if that behavior change.

Emmanuel Dreyfus
manu at netbsd.org

More information about the Gluster-devel mailing list