diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2010-05-05 00:27:45 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-05-05 04:36:05 -0700 |
commit | b0ed997cda2195e9178cbaa96d26976aa6dd2acf (patch) | |
tree | 49df25d9ef9af923cb1ef18d62bf3bf7dccc3002 /xlators/cluster | |
parent | 716f4dc26097811161cbd59c919df11593cb46af (diff) |
posix: Support thread-safe vectored writes/reads
..by maintaining internal offsets and using pwrite/pread
instead of writev/read.
The recent io-threads change is causing concurrent writes to
a file from different io-threads. This results in a race between
two threads both of which are trying to call lseek-writev. The
lseek-writev sequence should be a critical section. This is where
pwrite syscall helps. pwrite also requires an offset to be given so
for supporting pwrites for multiple iovecs we maintain an offset
within posix for the duration of the write fop and pass this internal
offset to pwrite.
The same logic also applies to read, only difference is that we do
not need to read multiple iovecs but only provide an atomic
lseek-read sequence.
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 883 (Data corruption due to thread unsafe reads and writes)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=883
Diffstat (limited to 'xlators/cluster')
0 files changed, 0 insertions, 0 deletions