diff options
| author | Rajesh Joseph <rjoseph@redhat.com> | 2016-11-22 22:25:42 +0530 |
|---|---|---|
| committer | Niels de Vos <ndevos@redhat.com> | 2017-01-07 05:58:33 -0800 |
| commit | e5dceb2e43fb1c7268516941950607edbfe3ecb1 (patch) | |
| tree | 77201d258de13b7acdc6dcb76ede4aeeee3fdfaa /api/src/glfs.c | |
| parent | 97e97f10a40358a2bb1f2f50cc1a149f491b18ff (diff) | |
gfapi: glfs_subvol_done should NOT wait for graph migration.
In graph_setup function glfs_subvol_done is called which
is executed in an epoll thread. glfs_lock waits on other
thread to finish graph migration. This can lead to dead lock
if we consume all the epoll threads.
In general any call-back function executed in epoll thread
should not call any blocking call which waits on a network
reply either directly or indirectly, e.g. syncop functions
should not be called in these threads.
As a fix we should not wait for migration in the call-back path.
> Reviewed-on: http://review.gluster.org/15913
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Niels de Vos <ndevos@redhat.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
(cherry picked from commit 17d10b42fc4041442e6cd0bfda45944edea498c6)
Change-Id: If96d0689fe1b4d74631e383048cdc30b01690dc2
BUG: 1399916
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/15978
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api/src/glfs.c')
| -rw-r--r-- | api/src/glfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c index 66d30a12f3c..e25c52612c1 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -592,7 +592,7 @@ glfs_fd_destroy (void *data) glfd = (struct glfs_fd *)data; - glfs_lock (glfd->fs); + glfs_lock (glfd->fs, _gf_true); { list_del_init (&glfd->openfds); } @@ -635,7 +635,7 @@ glfs_fd_bind (struct glfs_fd *glfd) fs = glfd->fs; - glfs_lock (fs); + glfs_lock (fs, _gf_true); { list_add_tail (&glfd->openfds, &fs->openfds); } @@ -925,7 +925,7 @@ glfs_init_wait (struct glfs *fs) int ret = -1; /* Always a top-down call, use glfs_lock() */ - glfs_lock (fs); + glfs_lock (fs, _gf_true); { while (!fs->init) pthread_cond_wait (&fs->cond, @@ -1302,7 +1302,7 @@ pub_glfs_get_volfile (struct glfs *fs, void *buf, size_t len) DECLARE_OLD_THIS; __GLFS_ENTRY_VALIDATE_FS (fs, invalid_fs); - glfs_lock(fs); + glfs_lock(fs, _gf_true); if (len >= fs->oldvollen) { gf_msg_trace ("glfs", 0, "copying %zu to %p", len, buf); memcpy(buf,fs->oldvolfile,len); |
