summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-06-23 01:12:48 +0000
committerAnand Avati <avati@gluster.com>2011-07-01 01:25:57 -0700
commit935d7744674ec961dd967133721de1429460c91f (patch)
treea293b4664feeaf0867dc3c6873439a3fc7d21e73 /xlators/cluster/afr/src/afr-inode-write.c
parent91086a2a7dcbfa30cdb5c188e9268ae4379bd28e (diff)
cluster/afr: fix the range of the lock taken in [f]truncate
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3077 (afr [f]truncate locks wrong region in transaction) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3077
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 019eecf4101..8b82add6276 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -487,8 +487,8 @@ afr_truncate (call_frame_t *frame, xlator_t *this,
loc_copy (&local->loc, loc);
local->transaction.main_frame = frame;
- local->transaction.start = 0;
- local->transaction.len = offset;
+ local->transaction.start = offset;
+ local->transaction.len = 0;
afr_transaction (transaction_frame, this, AFR_DATA_TRANSACTION);
@@ -675,8 +675,8 @@ afr_do_ftruncate (call_frame_t *frame, xlator_t *this)
local->transaction.main_frame = frame;
- local->transaction.start = 0;
- local->transaction.len = local->cont.ftruncate.offset;
+ local->transaction.start = local->cont.ftruncate.offset;
+ local->transaction.len = 0;
afr_transaction (transaction_frame, this, AFR_DATA_TRANSACTION);