summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-06-23 01:17:46 +0000
committerAnand Avati <avati@gluster.com>2011-07-01 01:26:29 -0700
commit4784318f02af5f113c7917f96807838588ab1c0c (patch)
tree3c9da9aa1b5d32a5ffc6f001c8e39658bd8cd6a2 /xlators
parentd339dc07aee155e65e0ab7c36a8c658a9e1db178 (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')
-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 050a4f0..603966b 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -507,8 +507,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);
@@ -703,8 +703,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);