summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-10-13 23:15:48 -0700
committerAnand Avati <avati@redhat.com>2013-10-22 09:33:39 -0700
commit7ebcf96c94c1292dcc7155c74b49257a9952b8d4 (patch)
tree23ff027fc2f3e3b365ff3f2d844e32ad0fb01029 /api
parente6bf83dbf781877d185057b3339ed81d7ec150e6 (diff)
gfapi: wake migration waiters after migration
Wake call threads which are waiting on migration to complete with a cond_broadcast. Else if any call which arrives right when migration is attempted will end up hanging indefinitely. Change-Id: I7df5298f93998d9a54fb12c16654e62333018ece BUG: 953694 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6111 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-resolve.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 98ef6a946..20fda3eff 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -67,6 +67,7 @@ __glfs_first_lookup (struct glfs *fs, xlator_t *subvol)
}
pthread_mutex_lock (&fs->mutex);
fs->migration_in_progress = 0;
+ pthread_cond_broadcast (&fs->cond);
return ret;
}
@@ -128,6 +129,7 @@ __glfs_refresh_inode (struct glfs *fs, xlator_t *subvol, inode_t *inode)
}
pthread_mutex_lock (&fs->mutex);
fs->migration_in_progress = 0;
+ pthread_cond_broadcast (&fs->cond);
return newinode;
}
@@ -665,6 +667,7 @@ __glfs_migrate_fd (struct glfs *fs, xlator_t *newsubvol, struct glfs_fd *glfd)
}
pthread_mutex_lock (&fs->mutex);
fs->migration_in_progress = 0;
+ pthread_cond_broadcast (&fs->cond);
return newfd;
}