path: root/xlators/nfs/server/src
diff options
authorKaleb S. KEITHLEY <>2014-07-08 08:25:36 -0400
committerKaleb KEITHLEY <>2014-07-08 11:35:19 -0700
commite311014d94c7fcfd8c5e7abe3aca7d99f43e0d91 (patch)
tree6fda013f3616e9df43f5c8728784b2574a676b32 /xlators/nfs/server/src
parentb3bf2cfaa8e932f02a10a42e0281290a7cbdc960 (diff)
nfs: prevent assertion error with MOUNT over UDPv3.4.5beta2
see,; and BZs 1116997, 1116503, respectively. The MOUNT service over UDP runs in a separate thread. This thread does not have the correct *THIS xlator set. *THIS points to the global (base) xlator structure, but GF_CALLOC() requires it to be the NFS-xlator so that assertions can get validated correctly. This is solved by passing the NFS-xlator to the pthread function, and setting the *THIS pointer explicitly in the new thread. It seems that on occasion (needs further investigation) MOUNT over UDP does not unregister itself. There can also be issues when the kernel NLM implementation has been registered at portmap/rpcbind, so adding some unregister procedures in the cleanup of the test-cases. Change-Id: Iea3bafd65bf480f2b12da91875c73571594d52d3 BUG: 1117256 Signed-off-by: Kaleb S. KEITHLEY <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Niels de Vos <> Reviewed-by: Santosh Pradhan <>
Diffstat (limited to 'xlators/nfs/server/src')
2 files changed, 10 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index cab6184..c4884e0 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -1922,7 +1922,7 @@ mnt3svc_init (xlator_t *nfsx)
if (nfs->mount_udp) {
- pthread_create (&udp_thread, NULL, mount3udp_thread, NULL);
+ pthread_create (&udp_thread, NULL, mount3udp_thread, nfsx);
return &mnt3prog;
diff --git a/xlators/nfs/server/src/mount3udp_svc.c b/xlators/nfs/server/src/mount3udp_svc.c
index fb59e28..e49d50e 100644
--- a/xlators/nfs/server/src/mount3udp_svc.c
+++ b/xlators/nfs/server/src/mount3udp_svc.c
@@ -170,8 +170,17 @@ mountudp_program_3(struct svc_req *rqstp, register SVCXPRT *transp)
void *
mount3udp_thread (void *argv)
+ xlator_t *nfsx = NULL;
register SVCXPRT *transp = NULL;
+ GF_ASSERT (nfsx);
+ if (glusterfs_this_set(nfsx)) {
+ gf_log (GF_MNT, GF_LOG_ERROR, "failed to set xlator, "
+ "nfs.mount-udp will not work");
+ return NULL;
+ }
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
gf_log (GF_MNT, GF_LOG_ERROR, "svcudp_create error");