From a316fcde7b7ba622eff14d13eed187ab05f2cbb3 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Thu, 13 Feb 2014 12:16:54 +0530 Subject: features/changelog: fix possible missed UNLOCK() Change-Id: I6d53c8fcbfdc1f80cd6ef9fb6bb6c7b32541116b Signed-off-by: Venky Shankar --- .../changelog/src/policy/changelog-policy-replication.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'xlators/features') 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 { -- cgit