summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient-internals.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-07-30 12:04:05 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-30 12:00:52 -0700
commit83ef3c8211282a9ef66659bfbde25116e4949b71 (patch)
tree44b3540043d22ee171e03657ccb9a6ca7e09f36d /libglusterfsclient/src/libglusterfsclient-internals.h
parent9beaccbee6b9e3356e04887c2f3e3f6e8d781228 (diff)
libglusterfsclient: Use iobufs for storing application write data
Till now we've been creating an iovec, storing references in it to the application data and simply passing it on to the translator tree. This means that the buffer being passed to the translators is not at all associated with the memory ref'd by the iobref argument to write fop. This is a problem when write-behind is a translator in the tree since it assumes that the memory in the iovecs passed to write fops is already refcounted by the iobref and so it simply copies the address of the application data. The problem is that the application can continue using this buffer, free it or over-write it destroying the data that write-behind may write at a later time. The solution involves copying the application's write buffer into an iobuf which will be referred to by the iobref. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 178 (libglusterfsclient: Data corruption on using write-behind in translator tree) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=178
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient-internals.h')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient-internals.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient-internals.h b/libglusterfsclient/src/libglusterfsclient-internals.h
index 09acf33e8c5..bdbdd744ba3 100755
--- a/libglusterfsclient/src/libglusterfsclient-internals.h
+++ b/libglusterfsclient/src/libglusterfsclient-internals.h
@@ -33,6 +33,7 @@
#include <fd.h>
#include <dirent.h>
+#define LIBGF_IOBUF_SIZE (128 *GF_UNIT_KB)
typedef void (*sighandler_t) (int);
typedef struct list_head list_head_t;