summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2014-02-13 12:16:54 +0530
committerVenky Shankar <vshankar@redhat.com>2014-02-13 12:19:30 +0530
commita316fcde7b7ba622eff14d13eed187ab05f2cbb3 (patch)
tree8e7956488324a181a60a11ed25173fd4d8216343
parent0d92798e88c5444fb2cc23663b4ea9a345887756 (diff)
features/changelog: fix possible missed UNLOCK()
Change-Id: I6d53c8fcbfdc1f80cd6ef9fb6bb6c7b32541116b Signed-off-by: Venky Shankar <vshankar@redhat.com>
-rw-r--r--xlators/features/changelog/src/policy/changelog-policy-replication.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/xlators/features/changelog/src/policy/changelog-policy-replication.c b/xlators/features/changelog/src/policy/changelog-policy-replication.c
index 19492e2c6..529c5c822 100644
--- a/xlators/features/changelog/src/policy/changelog-policy-replication.c
+++ b/xlators/features/changelog/src/policy/changelog-policy-replication.c
@@ -123,13 +123,19 @@ changelog_fix_term(xlator_t *this,
if (old_term != recon_term) {
LOCK (&priv->lock);
- priv->term = recon_term;
- (void) snprintf (crd.crd_changelog_name, PATH_MAX, "%s.%d", JOURNAL_NAME, priv->term);
- crd.crd_prealloc_size = 1<<29;
- if (changelog_open(this, priv, local, &crd) != 0)
- return _gf_false;
+ {
+ priv->term = recon_term;
+ (void) snprintf (crd.crd_changelog_name,
+ PATH_MAX, "%s.%d",
+ JOURNAL_NAME, priv->term);
+ crd.crd_prealloc_size = 1<<29;
+ ret = changelog_open(this, priv, local, &crd);
+ }
UNLOCK (&priv->lock);
+ if (ret != 0)
+ return _gf_false;
}
+
local->nr_bytes = 0;
local->lu.val = recon_index;
} else {