path: root/xlators/nfs/server
diff options
authorXiubo Li <>2019-07-26 12:34:52 +0800
committerAmar Tumballi <>2019-07-29 04:43:56 +0000
commit799edc73c3d4f694c365c6a7c27c9ab8eed5f260 (patch)
tree2c135042a67ffc04091fa2adfa1ea5fdf582cd16 /xlators/nfs/server
parent26b9c85861f058a4a8335b28f49410ba061e7c1a (diff)
event: rename event_XXX with gf_ prefixed
I hit one crash issue when using the libgfapi. In the libgfapi it will call glfs_poller() --> event_dispatch() in file api/src/glfs.c:721, and the event_dispatch() is defined by libgluster locally, the problem is the name of event_dispatch() is the extremly the same with the one from libevent package form the OS. For example, if a executable program Foo, which will also use and link the libevent and the libgfapi at the same time, I can hit the crash, like: kernel: glfs_glfspoll[68486]: segfault at 1c0 ip 00007fef006fd2b8 sp 00007feeeaffce30 error 4 in[7fef006ed000+46000] The link for Foo is: lib_foo_LADD = -levent $(GFAPI_LIBS) It will crash. This is because the glfs_poller() is calling the event_dispatch() from the libevent, not the libglsuter. The gfapi link info : GFAPI_LIBS = -lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid If I link Foo like: lib_foo_LADD = $(GFAPI_LIBS) -levent It will works well without any problem. And if Foo call one private lib, such as, and the will link the GFAPI_LIBS directly, while the Foo won't and it will dlopen(, then the crash will be hit everytime. The link info will be: foo_LADD = -levent libhandler_glfs_LIBADD = $(GFAPI_LIBS) I can avoid the crash temporarily by linking the GFAPI_LIBS in Foo too like: foo_LADD = $(GFAPI_LIBS) -levent libhandler_glfs_LIBADD = $(GFAPI_LIBS) But this is ugly since the Foo won't use any APIs from the GFAPI_LIBS. And in some cases when the --as-needed link option is added(on many dists it is added as default), then the crash is back again, the above workaround won't work. Fixes: #699 Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa Signed-off-by: Xiubo Li <>
Diffstat (limited to 'xlators/nfs/server')
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index aef88ac..cab57bb 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -1115,7 +1115,7 @@ nfs_init_state(xlator_t *this)
GF_OPTION_INIT("nfs.event-threads", nfs->event_threads, uint32,
- event_reconfigure_threads(this->ctx->event_pool, nfs->event_threads);
+ gf_event_reconfigure_threads(this->ctx->event_pool, nfs->event_threads);
this->private = (void *)nfs;
@@ -1338,7 +1338,7 @@ nfs_reconfigure_state(xlator_t *this, dict_t *options)
GF_OPTION_RECONF("nfs.event-threads", nfs->event_threads, options, uint32,
- event_reconfigure_threads(this->ctx->event_pool, nfs->event_threads);
+ gf_event_reconfigure_threads(this->ctx->event_pool, nfs->event_threads);
ret = 0;