From 450a7be2cede5a44c74f5f74224292af0c81a45f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 18 Apr 2011 21:53:45 +0000 Subject: marker: fixes to bypass marker fops in case features are enabled mainly in unlink and rename Signed-off-by: Amar Tumballi Signed-off-by: Anand Avati BUG: 2801 (glusterfsd process crash while running rebalance on simple volume) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2801 --- xlators/features/marker/src/marker.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index dcda5c70d04..640e6faf51e 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -792,7 +792,7 @@ marker_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc) priv = this->private; if (priv->feature_enabled == 0) - goto wind; + goto unlink_wind; ALLOCATE_OR_GOTO (local, marker_local_t, err); @@ -802,10 +802,14 @@ marker_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc) if (ret == -1) goto err; -wind: + STACK_WIND (frame, marker_unlink_stat_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->stat, loc); + return 0; +unlink_wind: + STACK_WIND (frame, marker_unlink_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->unlink, loc); return 0; err: STACK_UNWIND_STRICT (unlink, frame, -1, ENOMEM, NULL, NULL); @@ -951,11 +955,15 @@ marker_quota_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, unwind: STACK_UNWIND_STRICT (rename, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); - local->oplocal = NULL; - marker_local_unref (local); - marker_local_unref (oplocal); - GF_FREE (local); - GF_FREE (oplocal); + if (local) { + local->oplocal = NULL; + marker_local_unref (local); + GF_FREE (local); + } + if (oplocal) { + marker_local_unref (oplocal); + GF_FREE (oplocal); + } return 0; } @@ -973,7 +981,7 @@ marker_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, priv = this->private; if (priv->feature_enabled == 0) - goto wind; + goto rename_wind; GET_CONTRI_KEY (contri_key, oldloc->parent->gfid, ret); if (ret < 0) @@ -998,11 +1006,16 @@ marker_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, ret = loc_copy (&oplocal->loc, oldloc); if (ret == -1) goto err; -wind: STACK_WIND (frame, marker_quota_removexattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->removexattr, oldloc, contri_key); return 0; + +rename_wind: + STACK_WIND (frame, marker_rename_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->rename, oldloc, newloc); + + return 0; err: STACK_UNWIND_STRICT (rename, frame, -1, ENOMEM, NULL, NULL, NULL, NULL, NULL); -- cgit