+++ This bug was initially created as a clone of Bug #1116997 +++ +++ This bug was initially created as a clone of Bug #1116503 +++ Description of problem: The nfs.mount-udp option enables the MOUNT protocol over UDP in the NFS-server. Using UDP for the MOUNT protocol does not work. Version-Release number of selected component (if applicable): Current GlusterFS HEAD How reproducible: 100% Steps to Reproduce: 1. create a volume 2. enable the nfs.mount-udp volume option 3. start the volume 4. from a different system, mount the volume with this: # mount -t nfs -o mountproto=udp,proto=tcp server:/vol /mnt Actual results: Mounting times out. Error in the nfs.log: E [mem-pool.c:57:gf_mem_set_acct_info] (-->/usr/lib64/glusterfs/3.5qa2/xlator/nfs/server.so(mountudpproc3_mnt_3_svc+0x29) [0x7f1513762359] (-->/usr/lib64/glusterfs/3.5qa2/xlator/nfs/server.so(nfs3_rootfh+0x73) [0x7f15137423b3] (-->/lib64/libglusterfs.so.0(__gf_calloc+0x89) [0x7f1524957589]))) 0-: Assertion failed: type <= xl->mem_acct.num_types Expected results: Mounting works. Additional info: 'rpcinfo -p' shows that 'mount' is available on UDP. --- Additional comment from Anand Avati on 2014-07-05 13:04:55 CEST --- REVIEW: http://review.gluster.org/8241 (nfs: prevent assertion error with MOUNT over UDP) posted (#1) for review on master by Niels de Vos (ndevos) --- Additional comment from Anand Avati on 2014-07-07 12:11:12 CEST --- REVIEW: http://review.gluster.org/8241 (nfs: prevent assertion error with MOUNT over UDP) posted (#2) for review on master by Niels de Vos (ndevos) --- Additional comment from Anand Avati on 2014-07-07 19:28:52 CEST --- COMMIT: http://review.gluster.org/8241 committed in master by Vijay Bellur (vbellur) ------ commit ec74ceedaa41047b88d270c00eeb071b73e19664 Author: Niels de Vos <ndevos> Date: Sat Jul 5 11:44:30 2014 +0200 nfs: prevent assertion error with MOUNT over UDP 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: I3be5a420fc800bbcc14198d0b6faf4cf2c7300b1 BUG: 1116503 Signed-off-by: Niels de Vos <ndevos> Reviewed-on: http://review.gluster.org/8241 Reviewed-by: Santosh Pradhan <spradhan> Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Vijay Bellur <vbellur> --- Additional comment from Anand Avati on 2014-07-08 03:11:58 EDT --- REVIEW: http://review.gluster.org/8258 (nfs: prevent assertion error with MOUNT over UDP) posted (#1) for review on release-3.5 by Niels de Vos (ndevos) --- Additional comment from Anand Avati on 2014-07-08 06:32:35 EDT --- REVIEW: http://review.gluster.org/8258 (nfs: prevent assertion error with MOUNT over UDP) posted (#2) for review on release-3.5 by Niels de Vos (ndevos)
REVIEW: http://review.gluster.org/8262 (nfs: prevent assertion error with MOUNT over UDP) posted (#1) for review on release-3.4 by Kaleb KEITHLEY (kkeithle)
REVIEW: http://review.gluster.org/8262 (nfs: prevent assertion error with MOUNT over UDP) posted (#2) for review on release-3.4 by Kaleb KEITHLEY (kkeithle)
REVIEW: http://review.gluster.org/8262 (nfs: prevent assertion error with MOUNT over UDP) posted (#3) for review on release-3.4 by Kaleb KEITHLEY (kkeithle)
REVIEW: http://review.gluster.org/8262 (nfs: prevent assertion error with MOUNT over UDP) posted (#4) for review on release-3.4 by Kaleb KEITHLEY (kkeithle)
REVIEW: http://review.gluster.org/8262 (nfs: prevent assertion error with MOUNT over UDP) posted (#5) for review on release-3.4 by Kaleb KEITHLEY (kkeithle)
COMMIT: http://review.gluster.org/8262 committed in release-3.4 by Kaleb KEITHLEY (kkeithle) ------ commit e311014d94c7fcfd8c5e7abe3aca7d99f43e0d91 Author: Kaleb S. KEITHLEY <kkeithle> Date: Tue Jul 8 08:25:36 2014 -0400 nfs: prevent assertion error with MOUNT over UDP see http://review.gluster.org/#/c/8258/, http://review.gluster.org/8241; 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 <kkeithle> Reviewed-on: http://review.gluster.org/8262 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Niels de Vos <ndevos> Reviewed-by: Santosh Pradhan <spradhan>