[Gluster-devel] write-behind bug with ftruncate

Anand Avati anand.avati at gmail.com
Sun Jul 17 13:31:26 UTC 2011

On Sun, Jul 17, 2011 at 5:43 PM, Emmanuel Dreyfus <manu at netbsd.org> wrote:

> Emmanuel Dreyfus <manu at netbsd.org> wrote:
> > The sin is therefore to set FATTR_ATIME | FATTR_MTIME, while glusterfs
> > assumes this is a ftruncate() calls because only FATTR_SIZE is set. Am I
> > correct?
> I "fixed" NetBSD FUSE so that FATTR_ATIME | FATTR_MTIME are removed when
> FATTR_SIZE is set but not FATTR_UID, FATTR_GID and FATTR_MODE. It seems
> to work.

This only seems like a fix of the symptom. Even if FATTR_ATIME | FATTR_MTIME
were set along with FATTR_SIZE, the entire setattr should not have had an
effect on the ordering of ftruncate w.r.t the other writes. I believe that
the issue can show up if you were to load io-threads and write-behind right
below fuse. You need synchronization within your FUSE port to make sure
further writes are not sent up (or truncate() syscall not returned) till the
FUSE filesystem completes the setattr call.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20110717/6f4f8089/attachment-0003.html>

More information about the Gluster-devel mailing list