Bug 1118311 - After enabling nfs.mount-udp mounting server:/volume/subdir fails
Summary: After enabling nfs.mount-udp mounting server:/volume/subdir fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: nfs
Version: mainline
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
: 1031164 1031166 (view as bug list)
Depends On:
Blocks: 1118359 1124789
TreeView+ depends on / blocked
 
Reported: 2014-07-10 12:17 UTC by Niels de Vos
Modified: 2015-05-14 17:42 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1118359 (view as bug list)
Environment:
Last Closed: 2015-05-14 17:26:15 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)
Fix (3.48 KB, patch)
2014-07-22 11:24 UTC, santosh pradhan
no flags Details | Diff

Description Niels de Vos 2014-07-10 12:17:55 UTC
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.

Comment 1 santosh pradhan 2014-07-11 14:50:34 UTC
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.

Comment 2 santosh pradhan 2014-07-22 11:24:29 UTC
Created attachment 919888 [details]
Fix


This needs a bit of testing.

Comment 3 Anand Avati 2014-07-22 11:37:52 UTC
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@redhat.com)

Comment 4 Anand Avati 2014-08-07 09:41:45 UTC
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@redhat.com)

Comment 5 Anand Avati 2014-08-07 11:59:35 UTC
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@redhat.com)

Comment 6 Niels de Vos 2014-08-18 13:27:16 UTC
*** Bug 1031166 has been marked as a duplicate of this bug. ***

Comment 7 Niels de Vos 2014-08-18 13:43:21 UTC
*** Bug 1031164 has been marked as a duplicate of this bug. ***

Comment 8 Anand Avati 2014-08-21 12:49:12 UTC
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@redhat.com)

Comment 9 Anand Avati 2014-08-21 18:31:03 UTC
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@redhat.com)

Comment 10 Anand Avati 2014-08-21 19:33:57 UTC
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@redhat.com)

Comment 11 Anand Avati 2014-08-22 11:46:27 UTC
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@redhat.com)

Comment 12 Anand Avati 2014-08-23 07:32:07 UTC
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@redhat.com)

Comment 13 santosh pradhan 2014-08-23 07:53:51 UTC
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

Comment 14 Anand Avati 2014-08-27 07:41:25 UTC
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@redhat.com)

Comment 15 Anand Avati 2014-08-27 11:37:28 UTC
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@redhat.com)

Comment 16 Anand Avati 2014-08-28 19:27:39 UTC
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@redhat.com)

Comment 17 Anand Avati 2014-08-30 03:09:26 UTC
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@redhat.com)

Comment 18 Anand Avati 2014-09-10 07:54:12 UTC
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@redhat.com)

Comment 19 Anand Avati 2014-09-10 08:22:19 UTC
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@redhat.com)

Comment 21 Anand Avati 2014-10-07 07:51:33 UTC
COMMIT: http://review.gluster.org/8346 committed in master by Niels de Vos (ndevos@redhat.com) 
------
commit ddb31110db8e1b5995d392ced988f34d2f9145d2
Author: Santosh Kumar Pradhan <spradhan@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/8346
    Reviewed-by: soumya k <skoduri@redhat.com>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Niels de Vos <ndevos@redhat.com>

Comment 22 Niels de Vos 2015-05-14 17:26:15 UTC
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

Comment 23 Niels de Vos 2015-05-14 17:35:28 UTC
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

Comment 24 Niels de Vos 2015-05-14 17:37:50 UTC
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

Comment 25 Niels de Vos 2015-05-14 17:42:41 UTC
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


Note You need to log in before you can comment on or make changes to this bug.