summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient-internals.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-07-30 12:04:26 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-30 12:01:00 -0700
commitc8765d4d807cc9e63c8d96a568fc05002fa7cbd3 (patch)
tree2ac11050289d4262c338d2b2e1f070a6419e4b56 /libglusterfsclient/src/libglusterfsclient-internals.h
parentbf93ef3c5d352f68d718e48ab2b5037b8b369413 (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 09acf33e8..bdbdd744b 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;