Bug 1492003

Summary: [Fedora] mount -t nfs4 show wrong port number: port=0
Product: [Fedora] Fedora Reporter: Yongcheng Yang <yoyang>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 26CC: airlied, ajax, bskeggs, eparis, esandeen, hdegoede, ichavero, itamar, jarodwilson, jforbes, jglisse, jiyin, jonathan, josef, jwboyer, kernel-maint, labbott, linville, mchehab, mjg59, nhorman, quintela, steved, xzhou, yoyang
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-28 07:33:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yongcheng Yang 2017-09-15 09:16:40 UTC
Description of problem:

"mount -t nfs4" always show wrong port number: port=0

Steps to Reproduce:
1. mount 127.0.0.1:/exportdir /mnt/nfsmp
2. mount -t nfs4
3. check the port=<?>  # always port=0

Test logs of Fedora26:
~~~
[root@Fedora26 ~]# rpm -q nfs-utils
nfs-utils-2.1.1-5.rc5.fc26.x86_64
[root@Fedora26 ~]# rpm -q kernel
kernel-4.12.11-300.fc26.x86_64
[root@Fedora26 ~]# mount 127.0.0.1:/export_test/ /mnt/
[root@Fedora26 ~]# cat /proc/mounts | grep mnt | grep port
127.0.0.1:/export_test /mnt nfs4 rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1 0 0
[root@Fedora26 ~]#
[root@Fedora26 ~]# mount 127.0.0.1:/export_test/ /mnt/ -o vers=3
[root@Fedora26 ~]# cat /proc/mounts | grep mnt | grep port=
127.0.0.1:/export_test /mnt nfs4 rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1 0 0
127.0.0.1:/export_test/ /mnt nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=127.0.0.1,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=127.0.0.1 0 0

^^^^^^^        Mounting with v3 can show the correct port "mountport=20048"
[root@Fedora26 ~]# 


The corresponding upstream patch
~~~
commit 89a6814d9b665b196aa3a102f96b6dc7e8cb669e
Author: Steve Dickson <steved>
Date:   Thu Jun 29 11:48:26 2017 -0400

    mount: copy the port field into the cloned nfs_server structure.

Comment 2 Laura Abbott 2018-02-28 03:47:42 UTC
We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale. The kernel moves very fast so bugs may get fixed as part of a kernel update. Due to this, we are doing a mass bug update across all of the Fedora 26 kernel bugs.
 
Fedora 26 has now been rebased to 4.15.4-200.fc26.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.
 
If you have moved on to Fedora 27, and are still experiencing this issue, please change the version to Fedora 27.
 
If you experience different issues, please open a new bug report for those.

Comment 3 Yongcheng Yang 2018-02-28 07:33:22 UTC
(In reply to Laura Abbott from comment #2)

Looks like this issue has been resolved in Fedora 27 (with kernel 4.15.3-300.fc27):

-----------------------------------------------------------------
[23:39:03 root@ ~~]# mount -t nfs -o vers=4 localhost:/exportDir-exp-mount-local /mnt/nfsmp-exp-mount-local
[23:39:03 root@ ~~]# mount -t nfs4 | grep /mnt/nfsmp-exp-mount-local
localhost:/exportDir-exp-mount-local on /mnt/nfsmp-exp-mount-local type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp6,timeo=600,retrans=2,sec=sys,clientaddr=::1,local_lock=none,addr=::1)