summaryrefslogtreecommitdiffstats
path: root/cli/src/input.c
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2012-04-02 12:47:55 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-06 02:35:05 -0700
commit7768d700a18f5bdb1e4640070ec5dd380384c7a9 (patch)
treefe4fbec7d64cd919f68832c7aa7c3fcabf2e3c69 /cli/src/input.c
parentf132cc666ba4aa5e804de1c4529674618ca0d875 (diff)
hadoop-glusterfs: Fix IndexOutOfBounds Exception
Fix IndexOutOfBounds Exception which is hit when one of the replica pair is down. Problematic code existed in assuming a uniform size for each replica in pathinfo string. Change-Id: I85377ba5549e0603fe86e8d787115004f50e0c6a BUG: 808009 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.com/3087 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: M S Vishwanath Bhat <vishwanath@gluster.com> Reviewed-by: M S Vishwanath Bhat <vishwanath@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src/input.c')
0 files changed, 0 insertions, 0 deletions
erfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -89,6 +89,8 @@ synctask_yield (struct synctask *task)
task->proc->sched.uc_flags &= ~_UC_TLSBASE;
#endif
+ if (task->state != SYNCTASK_DONE)
+ task->state = SYNCTASK_SUSPEND;
if (swapcontext (&task->ctx, &task->proc->sched) < 0) {
gf_log ("syncop", GF_LOG_ERROR,
"swapcontext failed (%s)", strerror (errno));
@@ -238,6 +240,7 @@ synctask_new (struct syncenv *env, synctask_fn_t fn, synctask_cbk_t cbk,
newtask->gid = newtask->opframe->root->gid;
INIT_LIST_HEAD (&newtask->all_tasks);
+ INIT_LIST_HEAD (&newtask->waitq);
if (getcontext (&newtask->ctx) < 0) {
gf_log ("syncop", GF_LOG_ERROR,
@@ -530,6 +533,7 @@ __synclock_lock (struct synclock *lock)
/* called within a synctask */
list_add_tail (&task->waitq, &lock->waitq);
pthread_mutex_unlock (&lock->guard);
+ synctask_yawn (task);
synctask_yield (task);
/* task is removed from waitq in unlock,
* under lock->guard.*/
@@ -686,6 +690,7 @@ __syncbarrier_wait (struct syncbarrier *barrier, int waitfor)
list_add_tail (&task->waitq, &barrier->waitq);
{
pthread_mutex_unlock (&barrier->guard);
+ synctask_yawn (task);
synctask_yield (task);
pthread_mutex_lock (&barrier->guard);
}
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index f6eb423a4..d27c19d70 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -208,8 +208,6 @@ struct syncargs {
\
STACK_WIND_COOKIE (frame, cbk, (void *)stb, subvol, \
op, params); \
- if (task) \
- task->state = SYNCTASK_SUSPEND; \
\
__yield (stb); \
if (task) \