From 7ebcf96c94c1292dcc7155c74b49257a9952b8d4 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sun, 13 Oct 2013 23:15:48 -0700 Subject: 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 Reviewed-on: http://review.gluster.org/6111 Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat Reviewed-by: Shyamsundar Ranganathan --- api/src/glfs-resolve.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'api') 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; } -- cgit