summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-03-28 11:29:41 +0530
committerAnand Avati <avati@redhat.com>2013-03-28 08:49:55 -0700
commitca6a3d1e396a65d25e54d331bef966178cd55375 (patch)
treede1243d7f23cb6381b5cb684df8ee3849fb73f51 /xlators/cluster/afr
parent8909c28c1173e10fd2f10706bd8a0f2ca5b5d685 (diff)
cluster/afr: piggyback and fsync resume changes
1) pre_op_piggyback should always be decremented. 2) Move fsync resume to just after post_op. 3) fsync stub should be created from afr's local not from the final response. Change-Id: I220bb532eb03bea584292f4dd2e816ad0c3e0cf7 BUG: 927146 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4741 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-common.c11
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c22
2 files changed, 18 insertions, 15 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index c55adc1ee9c..0eca21309a8 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -852,11 +852,6 @@ afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this)
loc_wipe (&local->transaction.new_parent_loc);
GF_FREE (local->transaction.postop_piggybacked);
-
- if (local->transaction.resume_stub) {
- call_resume (local->transaction.resume_stub);
- local->transaction.resume_stub = NULL;
- }
}
@@ -2692,8 +2687,10 @@ afr_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
post-op. This guarantee is expected by FUSE graph switching
for example.
*/
- stub = fop_fsync_cbk_stub (frame, default_fsync_cbk, op_ret,
- op_errno, prebuf, postbuf, xdata);
+ stub = fop_fsync_cbk_stub (frame, default_fsync_cbk,
+ local->op_ret, local->op_errno,
+ &local->cont.fsync.prebuf,
+ &local->cont.fsync.postbuf, xdata);
if (!stub) {
AFR_STACK_UNWIND (fsync, frame, -1, ENOMEM, 0, 0, 0);
return 0;
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index f632a2b701a..e54f9c2cbec 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -398,6 +398,11 @@ afr_changelog_post_op_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
UNLOCK (&frame->lock);
if (call_count == 0) {
+ if (local->transaction.resume_stub) {
+ call_resume (local->transaction.resume_stub);
+ local->transaction.resume_stub = NULL;
+ }
+
if (afr_lock_server_count (priv, local->transaction.type) == 0) {
local->transaction.done (frame, this);
} else {
@@ -1370,12 +1375,6 @@ is_piggyback_post_op (call_frame_t *frame, fd_t *fd)
local = frame->local;
fdctx = afr_fd_ctx_get (fd, frame->this);
- if (!afr_txn_nothing_failed (frame, frame->this))
- /* something failed in this transaction,
- we will be performing a hard post-op
- */
- return _gf_false;
-
LOCK(&fd->lock);
{
piggyback = _gf_true;
@@ -1398,7 +1397,14 @@ is_piggyback_post_op (call_frame_t *frame, fd_t *fd)
}
UNLOCK(&fd->lock);
- return piggyback;
+ if (!afr_txn_nothing_failed (frame, frame->this)) {
+ /* something failed in this transaction,
+ we will be performing a hard post-op
+ */
+ return _gf_false;
+ }
+
+ return piggyback;
}
@@ -1619,7 +1625,7 @@ unlock:
local = prev_frame->local;
local->transaction.resume_stub = stub;
afr_changelog_post_op_safe (prev_frame, this);
- } else {
+ } else if (stub) {
call_resume (stub);
}
}