Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1946346

Summary: When mount is triggered for an already mounted NFS v3 share (using auto negotiation), it displays "mount.nfs: Protocol not supported" instead of EBUSY.
Product: Red Hat Enterprise Linux 8 Reporter: Rohan Sable <rsable>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: dwysocha, fsorenso, jshivers, steved, wshaikh, xzhou, yieli, yoyang
Target Milestone: betaKeywords: CustomerScenariosInitiative, Patch, Reproducer, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-2.3.3-50.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2054300 (view as bug list) Environment:
Last Closed: 2022-05-10 15:20:51 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:
Bug Depends On:    
Bug Blocks: 2054300    
Deadline: 2022-02-28   

Description Rohan Sable 2021-04-05 20:25:56 UTC
Description of problem:

When mount is triggered for an already mounted NFS v3 share (using auto negotiation),
it displays "mount.nfs: Protocol not supported" instead of EBUSY.


Version-Release number of selected component (if applicable):

nfs-utils-2.3.3-35.el8.x86_64

(but should be present on any release that has commit a709f25c1da4a2fb44a1f3fd060298fbbd88aa3c)


How reproducible:

100%


Steps to Reproduce:

1. Create a NFS server and export :

mkdir /export ; chmod 777 /export ; echo "/export *(rw,sync)" >> /etc/exports ; systemctl restart nfs-server ; systemctl stop firewalld

2. Disable NFSv4.* (on NFS server) :

[root@rsable83 ~]# egrep -i "\[nfsd\]|^vers4*" /etc/nfs.conf 
[nfsd]
vers4=n
vers4.0=n
vers4.1=n
vers4.2=n

3. Mount the NFS share (use auto negotiation) (everything works as expected)

4. Now try to mount the share again (use auto negotiation only) :

[root@rsable83 ~]# mount 127.0.0.1:/export /mnt
mount.nfs: Protocol not supported


Actual results:

[root@rsable83 ~]# mount 127.0.0.1:/export /mnt
mount.nfs: Protocol not supported

(although adding '-v' shows the 'Device or resource busy' internally before changing it back to EPROTONOTSUPPORT)

[root@rsable83 ~]# mount -v 127.0.0.1:/export /mnt
mount.nfs: timeout set for Mon Apr  5 16:03:53 2021
mount.nfs: trying text-based options 'vers=4.2,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=127.0.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 127.0.0.1 prog 100005 vers 3 prot UDP port 20048
mount.nfs: mount(2): Device or resource busy
mount.nfs: Protocol not supported


Expected results:

mount.nfs: /mnt is busy or already mounted


Additional info:

This behavior seems to be introduced because of commit a709f25c1da4a2fb44a1f3fd060298fbbd88aa3c ;
which was in turn for https://bugzilla.redhat.com/show_bug.cgi?id=1709963.

However IMHO, in current scenario giving out the v3 error should be more important,
a corner case perhaps.

Comment 14 Steve Dickson 2022-02-14 16:21:25 UTC
commit c547ad481dca5bc0b0a2e365ebcff3439848f664 
Author: Rohan Sable <rsable>
Date:   Mon Feb 14 11:15:22 2022 -0500

    mount.nfs Fix error reporting for already mounted shares

Comment 15 Yongcheng Yang 2022-02-15 05:56:16 UTC
This problem doesn't get fixed after that patch applied.

[root@ ~]# systemctl restart nfs-server
[root@ ~]# cat /proc/fs/nfsd/versions
-2 +3 -4 -4.0 -4.1 -4.2
[root@ ~]# mount 127.0.0.1:/export_test/ /mnt_test/
[root@ ~]# nfsstat -m
/mnt_test from 127.0.0.1:/export_test/
 Flags: 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

[root@ ~]# mount 127.0.0.1:/export_test/ /mnt_test/
mount.nfs: Protocol not supported
[root@ ~]# echo $?
32
[root@ ~]# rpm -q nfs-utils
nfs-utils-2.3.3-49.el8.x86_64
[root@ ~]#

Comment 23 Yongcheng Yang 2022-02-21 05:11:08 UTC
Verified in nfs-utils-2.3.3-50.el8 the EBUSY error emits (in verbose mode).
By default it's hided due to https://patchwork.kernel.org/project/linux-nfs/patch/877fi2raey.fsf@notabene.neil.brown.name/

[root@yoyang-rhel-860-202202123 ~]# cat /proc/fs/nfsd/versions
-2 +3 -4 -4.0 -4.1 -4.2
[root@yoyang-rhel-860-202202123 ~]# mount 127.0.0.1:/export_test/ /mnt_test/
[root@yoyang-rhel-860-202202123 ~]# nfsstat -m
/mnt_test from 127.0.0.1:/export_test/
 Flags: rw,relatime,vers=3,rsize=262144,wsize=262144,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

[root@yoyang-rhel-860-202202123 ~]# mount 127.0.0.1:/export_test/ /mnt_test/
[root@yoyang-rhel-860-202202123 ~]# echo $?
0
[root@yoyang-rhel-860-202202123 ~]# mount 127.0.0.1:/export_test/ /mnt_test/ -vvv
mount.nfs: timeout set for Mon Feb 21 00:05:31 2022
mount.nfs: trying text-based options 'vers=4.2,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=127.0.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 127.0.0.1 prog 100005 vers 3 prot UDP port 20048
mount.nfs: mount(2): Device or resource busy
[root@yoyang-rhel-860-202202123 ~]# rpm -q nfs-utils
nfs-utils-2.3.3-50.el8.x86_64
[root@yoyang-rhel-860-202202123 ~]#

Comment 26 Yongcheng Yang 2022-02-21 14:16:06 UTC
Have verified in nfs-utils-2.3.3-50.el8 i.e. https://beaker.engineering.redhat.com/jobs/6324044

Comment 27 Yongcheng Yang 2022-02-28 00:56:25 UTC
Including "EACCES" might lead to Bug 1709963 recurrence.
And the olderrno was added to fix that.

[16:57:26 root@ ~~]# exportfs -i 127.0.0.1:/export -o rw,no_root_squash,fsid=0
[16:57:26 root@ ~~]# mount 127.0.0.1:/notexistdir /mnt/nfsmp
mount.nfs: access denied by server while mounting 127.0.0.1:/notexistdir
           ^^^^^^^^^^^^^^
[16:57:27 root@ ~~]# mount -t nfs4 127.0.0.1:/notexistdir /mnt/nfsmp
mount.nfs4: mounting 127.0.0.1:/notexistdir failed, reason given by server: No such file or directory

Comment 28 Steve Dickson 2022-03-14 16:16:30 UTC
(In reply to Yongcheng Yang from comment #27)
> Including "EACCES" might lead to Bug 1709963 recurrence.
> And the olderrno was added to fix that.
> 
> [16:57:26 root@ ~~]# exportfs -i 127.0.0.1:/export -o
> rw,no_root_squash,fsid=0
> [16:57:26 root@ ~~]# mount 127.0.0.1:/notexistdir /mnt/nfsmp
> mount.nfs: access denied by server while mounting 127.0.0.1:/notexistdir
>            ^^^^^^^^^^^^^^
I'm thinking this is ok.... but if you think it is a problem, please
open up another bz...

Comment 29 Yongcheng Yang 2022-03-15 06:22:37 UTC
(In reply to Steve Dickson from comment #28)
> (In reply to Yongcheng Yang from comment #27)
> > Including "EACCES" might lead to Bug 1709963 recurrence.
> > And the olderrno was added to fix that.
> > 
> > [16:57:26 root@ ~~]# exportfs -i 127.0.0.1:/export -o
> > rw,no_root_squash,fsid=0
> > [16:57:26 root@ ~~]# mount 127.0.0.1:/notexistdir /mnt/nfsmp
> > mount.nfs: access denied by server while mounting 127.0.0.1:/notexistdir
> >            ^^^^^^^^^^^^^^
> I'm thinking this is ok.... but if you think it is a problem, please
> open up another bz...

I don't know the background of filing Bug 1709963 thus not sure if this is a problem for someone.

Let's keep this in mind and we can jump back in the future. Thanks!

Comment 31 errata-xmlrpc 2022-05-10 15:20:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nfs-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2025