From a96375c180901756753246cb00b42f44fd8b4fd7 Mon Sep 17 00:00:00 2001 From: Anuradha Date: Tue, 30 Dec 2014 18:54:33 +0530 Subject: afr: Fixes to commit 85427a23c238499137cbfaafdb7b6ad27f67506a * Fixed a dict leak * Re-added 'return on failure' check Change-Id: I07edd03e4608fd2b7c4a91019a0e43033e6e78b2 BUG: 1163804 Signed-off-by: Anuradha Reviewed-on: http://review.gluster.org/9368 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-self-heal-data.c | 3 +++ xlators/cluster/afr/src/afr-self-heal-entry.c | 3 +++ xlators/cluster/afr/src/afr-self-heal-metadata.c | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src') diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 0a43d128634..a434b9e6ba1 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -586,6 +586,9 @@ __afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this, ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid, replies); + if (ret) + return ret; + witness = alloca0(priv->child_count * sizeof (*witness)); ret = afr_selfheal_find_direction (frame, this, replies, AFR_DATA_TRANSACTION, diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 34784fff0e6..6af9488f9a4 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -382,6 +382,9 @@ __afr_selfheal_entry_prepare (call_frame_t *frame, xlator_t *this, ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid, replies); + if (ret) + return ret; + witness = alloca0 (sizeof (*witness) * priv->child_count); ret = afr_selfheal_find_direction (frame, this, replies, AFR_ENTRY_TRANSACTION, diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index c09f19ac5fd..7c0d5cb08c6 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -311,8 +311,11 @@ __afr_selfheal_metadata_prepare (call_frame_t *frame, xlator_t *this, inode_t *i ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid, replies); + if (ret) + return ret; + witness = alloca0 (sizeof (*witness) * priv->child_count); - ret = afr_selfheal_find_direction (frame, this, replies, + ret = afr_selfheal_find_direction (frame, this, replies, AFR_METADATA_TRANSACTION, locked_on, sources, sinks, witness); if (ret) -- cgit