summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjeet Jha <ajha@redhat.com>2014-06-19 17:37:18 +0530
committerVenky Shankar <vshankar@redhat.com>2014-06-22 22:56:10 -0700
commita55a2c5cc207a3050e1a37ccb574cc23a59d7294 (patch)
treecba1eb97488e3fbfae7b64ad871ee5ec9beddb1d
parentf022af610d85e7b7cc4f63bf0491a738b5a6f082 (diff)
features/changelog: Fix for history api issue during upgrade
On failure during history changelog availability check, there was an attempt to destory attribute (of consume thread) which was not initialised. Change-Id: Ica7a98ee70eb1303303884b01ef76ab71430a351 BUG: 1111169 Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/8118 Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
-rw-r--r--xlators/features/changelog/lib/src/gf-history-changelog.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/xlators/features/changelog/lib/src/gf-history-changelog.c b/xlators/features/changelog/lib/src/gf-history-changelog.c
index d1a6b0e9c89..e7f08b6d663 100644
--- a/xlators/features/changelog/lib/src/gf-history-changelog.c
+++ b/xlators/features/changelog/lib/src/gf-history-changelog.c
@@ -733,30 +733,35 @@ gf_history_changelog (char* changelog_dir, unsigned long start,
unsigned long end, int n_parallel,
unsigned long *actual_end)
{
- int ret = 0;
- int len = -1;
- int fd = -1;
- int n_read = -1;
- unsigned long min_ts = 0;
- unsigned long max_ts = 0;
- unsigned long end2 = 0;
- unsigned long ts1 = 0;
- unsigned long ts2 = 0;
- unsigned long to = 0;
- unsigned long from = 0;
- unsigned long total_changelog = 0;
- xlator_t *this = NULL;
- gf_changelog_t *gfc = NULL;
- gf_changelog_t *hist_gfc = NULL;
- gf_changelog_history_data_t *hist_data = NULL;
- DIR *dirp = NULL;
- struct dirent *dp = NULL;
- pthread_t consume_th = 0;
- char htime_dir[PATH_MAX] = {0,};
- char buffer[PATH_MAX] = {0,};
+ int ret = 0;
+ int len = -1;
+ int fd = -1;
+ int n_read = -1;
+ unsigned long min_ts = 0;
+ unsigned long max_ts = 0;
+ unsigned long end2 = 0;
+ unsigned long ts1 = 0;
+ unsigned long ts2 = 0;
+ unsigned long to = 0;
+ unsigned long from = 0;
+ unsigned long total_changelog = 0;
+ xlator_t *this = NULL;
+ gf_changelog_t *gfc = NULL;
+ gf_changelog_t *hist_gfc = NULL;
+ gf_changelog_history_data_t *hist_data = NULL;
+ DIR *dirp = NULL;
+ struct dirent *dp = NULL;
+ pthread_t consume_th = 0;
+ char htime_dir[PATH_MAX] = {0,};
+ char buffer[PATH_MAX] = {0,};
pthread_attr_t attr;
+ ret = pthread_attr_init (&attr);
+ if (ret != 0) {
+ return -1;
+ }
+
this = THIS;
if (!this) {
ret = -1;
@@ -874,12 +879,6 @@ gf_history_changelog (char* changelog_dir, unsigned long start,
hist_data->len = len;
hist_data->n_parallel = n_parallel;
- ret = pthread_attr_init (&attr);
- if (ret != 0) {
- ret = -1;
- goto out;
- }
-
ret = pthread_attr_setdetachstate
(&attr, PTHREAD_CREATE_DETACHED);
if (ret != 0) {