From 4784318f02af5f113c7917f96807838588ab1c0c Mon Sep 17 00:00:00 2001 From: Pranith K Date: Thu, 23 Jun 2011 01:17:46 +0000 Subject: cluster/afr: fix the range of the lock taken in [f]truncate Signed-off-by: Pranith Kumar K Signed-off-by: Anand Avati BUG: 3077 (afr [f]truncate locks wrong region in transaction) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3077 --- xlators/cluster/afr/src/afr-inode-write.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 050a4f0e9ef..603966b3357 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); -- cgit