The fid offset is getting incremented on ixp_pwrite and 
incremented twice on ixp_write.  I believe the attached patch is 
a fix.

- Silas
diff -r 70ea59334d41 libixp/client.c
--- a/libixp/client.c   Mon Nov  5 14:52:11 2007
+++ b/libixp/client.c   Thu Nov 22 03:50:21 2007
@@ -415,7 +415,7 @@
 }
 
 static long
-_pwrite(IxpCFid *f, void *buf, long count, vlong offset) {
+_pwrite(const IxpCFid *f, void *buf, long count, vlong offset) {
        Fcall fcall;
        int n, len;
 
@@ -424,13 +424,12 @@
                n = min(count-len, f->iounit);
                fcall.type = TWrite;
                fcall.fid = f->fid;
-               fcall.offset = f->offset;
+               fcall.offset = f->offset + len;
                fcall.data = buf + len;
                fcall.count = n;
                if(dofcall(f->client, &fcall) == 0)
                        return -1;
 
-               f->offset += fcall.count;
                len += fcall.count;
 
                ixp_freefcall(&fcall);

Reply via email to