[..]
Removing the performance/write-behind xlator on the client fixes the problem. Nobody else got this problem? It may be NetBSD-specific, since the ftruncate() come from FUSE SETATTR issued by the NetBSD kernel to update the file size. I could filter out such messages, but I am not sure it would not have side effects.
If your version of NetBSD has dtrace ported and enabled, you can check if the reordering of the calls is happening within fuse at runtime without modifying fuse. Let me know if this line of debugging helps. I need to understand the details of the conversion of ftruncate() to FUSE SETATTR. A pointer to the corresponding NetBSD code will help.
Pavan