diff options
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/changelog/src/policy/changelog-policy-replication.c | 16 |
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 { |