summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-10-13 23:15:48 -0700
committerVijay Bellur <vbellur@redhat.com>2013-11-26 10:38:26 -0800
commita15edf06b1cf481b459bfc4ee346624b688f6b7d (patch)
tree584d3f38d4d5f2ab90fcb38f5be797b009c0ec25
parent5874eb6facb3e19cad035f4f3e30ff3b2111fec2 (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/6323 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-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 3179af22c2d..52b95c960f1 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;
}
@@ -662,6 +664,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;
}