Description of problem: After enabling nfs.mount-udp, mounting a subdir on a volume over NFS fails. Version-Release number of selected component (if applicable): Any How reproducible: 100% Steps to Reproduce: 1. create a volume 2. enable the nfs.mount-udp volume option 3. start the volume 4. mount the volume 5. create a subdir on the volume 6. unmount the volume 7. mount the volume/subdir Actual results: # mount -vvv -t nfs -o mountproto=udp,proto=tcp server:/bug/subdir.d /mnt ... mount.nfs: trying 192.168.130.11 prog 100003 vers 3 prot TCP port 2049 mount.nfs: prog 100005, trying vers=3, prot=17 mount.nfs: trying 192.168.130.11 prog 100005 vers 3 prot UDP port 988 mount.nfs: mount(2): Input/output error mount.nfs: mount system call failed In nfs.log: [2014-07-09 14:23:57.161478] D [mount3.c:1237:mnt3_mntpath_to_export] 0-nfs-mount: Export not found [2014-07-09 14:23:57.161695] D [mount3udp_svc.c:52:mountudpproc3_mnt_3_svc] 0-nfs-mount: unable to get fh for bug/subdir.d [2014-07-09 14:23:57.161719] D [mount3udp_svc.c:140:mountudp_program_3] 0-nfs-mount: PROC returned error [2014-07-09 14:23:57.162526] D [mount3.c:1237:mnt3_mntpath_to_export] 0-nfs-mount: Export not found Expected results: Mount should succeed. Additional info: By default, Linux NFS clients try to use UDP for the MOUNT protocol. Forcing the NFS-client to use TCP makes mounting work.
mountudpproc3_mnt_3_svc() invokes nfs3_rootfh() which internally calls mnt3_mntpath_to_export() to resolve the path. mnt3_mntpath_to_export() just works if the mount path requested is volume itself. It does not resolve if the path is a subdir inside the volume. I think nfs3_rootfh() needs to invoke something like mnt3_find_export() which would resolve volume and subdir. I ll test the fix before sending the patch out for review.
Created attachment 919888 [details] Fix This needs a bit of testing.
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#1) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#2) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#3) for review on master by Santosh Pradhan (spradhan)
*** Bug 1031166 has been marked as a duplicate of this bug. ***
*** Bug 1031164 has been marked as a duplicate of this bug. ***
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#4) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#5) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#6) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#7) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#8) for review on master by Santosh Pradhan (spradhan)
I am done with all the changes, code review is pending, snippet of change: gNFS: Subdir mount does not work on UDP proto After enabling nfs.mount-udp, mounting a subdir on a volume over NFS fails. Because mountudpproc3_mnt_3_svc() invokes nfs3_rootfh() which internally calls mnt3_mntpath_to_export() to resolve the mount path. mnt3_mntpath_to_export() just works if the mount path requested is volume itself. It is not able to resolve, if the path is a subdir inside the volume. MOUNT over TCP uses mnt3_find_export() to resolve subdir path but UDP can't use this routine because mnt3_find_export() needs the req data (of type rpcsvc_request_t) and it's available only for TCP version of RPC. FIX: (1) Use syncop_lookup() framework to resolve the MOUNT PATH by breaking it into components and resolve component-by-component. (2) If MOUNT PATH is subdir, then make sure subdir export is not disabled. (3) Add auth mechanism to respect nfs.rpc-auth-allow/reject and subdir auth i.e. nfs.export-dir (4) Enhanced error handling for MOUNT over UDP
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#9) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#10) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#11) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#12) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#13) for review on master by Santosh Pradhan (spradhan)
REVIEW: http://review.gluster.org/8346 (gNFS: Subdir mount does not work on UDP proto) posted (#14) for review on master by Santosh Pradhan (spradhan)
COMMIT: http://review.gluster.org/8346 committed in master by Niels de Vos (ndevos) ------ commit ddb31110db8e1b5995d392ced988f34d2f9145d2 Author: Santosh Kumar Pradhan <spradhan> Date: Tue Jul 22 16:56:57 2014 +0530 gNFS: Subdir mount does not work on UDP proto After enabling nfs.mount-udp, mounting a subdir on a volume over NFS fails. Because mountudpproc3_mnt_3_svc() invokes nfs3_rootfh() which internally calls mnt3_mntpath_to_export() to resolve the mount path. mnt3_mntpath_to_export() just works if the mount path requested is volume itself. It is not able to resolve, if the path is a subdir inside the volume. MOUNT over TCP uses mnt3_find_export() to resolve subdir path but UDP can't use this routine because mnt3_find_export() needs the req data (of type rpcsvc_request_t) and it's available only for TCP version of RPC. FIX: (1) Use syncop_lookup() framework to resolve the MOUNT PATH by breaking it into components and resolve component-by-component. i.e. glfs_resolve_at () API from libgfapi shared object. (2) If MOUNT PATH is subdir, then make sure subdir export is not disabled. (3) Add auth mechanism to respect nfs.rpc-auth-allow/reject and subdir auth i.e. nfs.export-dir (4) Enhanced error handling for MOUNT over UDP Change-Id: I42ee69415d064b98af4f49773026562824f684d1 BUG: 1118311 Signed-off-by: Santosh Kumar Pradhan <spradhan> Reviewed-on: http://review.gluster.org/8346 Reviewed-by: soumya k <skoduri> Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Niels de Vos <ndevos>
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report. glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution. [1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user