fix
diff --git a/ChangeLog b/ChangeLog
index f50db1d..2f34cd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-14 Miklos Szeredi <miklos@szeredi.hu>
+
+ * libfuse: add debug for write result and warnings for too large
+ read/write result.
+
2005-10-11 Miklos Szeredi <miklos@szeredi.hu>
* Spelling fixes, thanks to Ioannis Barkas
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 49a1b81..2d81fb0 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -14,7 +14,7 @@
helper.c \
mount.c
-libfuse_la_LDFLAGS = -lpthread -version-number 2:4:0 \
+libfuse_la_LDFLAGS = -lpthread -version-number 2:4:1 \
-Wl,--version-script,fuse_versionscript
EXTRA_DIST = fuse_versionscript
diff --git a/lib/fuse.c b/lib/fuse.c
index 8555c45..e44b9f2 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -1056,6 +1056,8 @@
printf(" READ[%lu] %u bytes\n", fi->fh, res);
fflush(stdout);
}
+ if ((size_t) res > size)
+ fprintf(stderr, "fuse: read too many bytes");
fuse_reply_buf(req, buf, res);
} else
reply_err(req, res);
@@ -1087,9 +1089,16 @@
}
pthread_rwlock_unlock(&f->tree_lock);
- if (res >= 0)
+ if (res >= 0) {
+ if (f->flags & FUSE_DEBUG) {
+ printf(" WRITE%s[%lu] %u bytes\n",
+ fi->writepage ? "PAGE" : "", fi->fh, res);
+ fflush(stdout);
+ }
+ if ((size_t) res > size)
+ fprintf(stderr, "fuse: wrote too many bytes");
fuse_reply_write(req, res);
- else
+ } else
reply_err(req, res);
}