Bug 1492003 - [Fedora] mount -t nfs4 show wrong port number: port=0
Summary: [Fedora] mount -t nfs4 show wrong port number: port=0
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 26
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-09-15 09:16 UTC by Yongcheng Yang
Modified: 2018-02-28 07:36 UTC (History)
25 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-02-28 07:33:22 UTC
Type: Bug

Attachments (Terms of Use)

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 /mnt/nfsmp
2. mount -t nfs4
3. check the port=<?>  # always port=0

Test logs of Fedora26:
[root@Fedora26 ~]# rpm -q nfs-utils
[root@Fedora26 ~]# rpm -q kernel
[root@Fedora26 ~]# mount /mnt/
[root@Fedora26 ~]# cat /proc/mounts | grep mnt | grep port /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=,local_lock=none,addr= 0 0
[root@Fedora26 ~]#
[root@Fedora26 ~]# mount /mnt/ -o vers=3
[root@Fedora26 ~]# cat /proc/mounts | grep mnt | grep port= /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=,local_lock=none,addr= 0 0 /mnt nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr= 0 0

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

The corresponding upstream patch
commit 89a6814d9b665b196aa3a102f96b6dc7e8cb669e
Author: Steve Dickson <steved@redhat.com>
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)

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