Bug 761910 (GLUSTER-178) - libglusterfsclient: Data corruption on using write-behind in translator tree
Summary: libglusterfsclient: Data corruption on using write-behind in translator tree
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-178
Product: GlusterFS
Classification: Community
Component: libglusterfsclient
Version: mainline
Hardware: All
OS: All
low
high
Target Milestone: ---
Assignee: Raghavendra G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-30 10:42 UTC by Shehjar Tikoo
Modified: 2009-08-12 05:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTP
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Shehjar Tikoo 2009-07-30 07:44:18 UTC
Raghu is working on a fix.

Comment 1 Shehjar Tikoo 2009-07-30 10:42:01 UTC
There is a reproduceable data corruption while using unfs3booster over libglusterfsclient with write-behind as a translator in the tree.

The simplest way to reproduce is to run dd with various block sizes and counts. The input should be /dev/zero. Once the dd run is complete, use the hexdump -x <filename> command. It'll show that not all bytes in the file are zero.


The cause of the corruption is the way we handle writes in libglusterfsclient.
Libglusterfsclient hands the references to users data to write-behind, which writes that data at a later point in time. After submitting the write, libglusterfsclient returns the write call back to the application.

When the write actually takes place, it is possible that the buffer handed to write-behind has already been over-written by other data or freed if it was allocated from heap.

Comment 2 Anand Avati 2009-07-30 16:00:55 UTC
PATCH: http://patches.gluster.com/patch/838 in master (libglusterfsclient: Use iobufs for storing application write data)

Comment 3 Anand Avati 2009-07-30 16:01:02 UTC
PATCH: http://patches.gluster.com/patch/839 in release-2.0 (libglusterfsclient: Use iobufs for storing application write data)


Note You need to log in before you can comment on or make changes to this bug.