summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-06-23 01:15:14 +0000
committerAnand Avati <avati@gluster.com>2011-07-01 01:27:01 -0700
commit3aaa84fcbcacdb4001c78303a794d8c6b9743d0e (patch)
tree1e8b15210ee2e45f17e6bed3749a69ae9f964577
parent1faa643bd0c1b99bf8a250cf108681e1e53846c5 (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
-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 a369da6de..b54dfaf46 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -493,8 +493,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);
@@ -684,8 +684,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);