Bug 761910 (GLUSTER-178)

Summary: libglusterfsclient: Data corruption on using write-behind in translator tree
Product: [Community] GlusterFS Reporter: Shehjar Tikoo <shehjart>
Component: libglusterfsclientAssignee: Raghavendra G <raghavendra>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTP Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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)