Bug 521638

Summary: Bogus error ("an incorrect mount option was specified") when mounting stopped server
Product: [Fedora] Fedora Reporter: Tobias Ringstrom <tobias>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.2.0-5.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-06 06:11:08 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Tobias Ringstrom 2009-09-07 07:32:21 EDT
Description of problem:
A bogus and misleading error is given when trying to mount from a server where the NFS service is stopped.  The error is "mount.nfs: an incorrect mount option was specified", but should say that the NFS server could not be connected to.

Version-Release number of selected component (if applicable):
nfs-utils-1.2.0-4.fc11.i586

How reproducible:
Always.

Steps to Reproduce:
1. service nfs stop
2. mount -t nfs localhost:/nosuchdir /mnt
  
Actual results:
mount.nfs: an incorrect mount option was specified

Expected results:
An error indicating that the NFS server could not be contacted.

Additional info:
Comment 1 Steve Dickson 2009-09-08 11:20:22 EDT
Well I'm seeing something different... 

# service nfs stop
# mount -t nfs localhost:/nosuchdir /mnt

mount.nfs: mount to NFS server 'localhost:/nosuchdir' failed: RPC Error: Program not registered


The kernel I'm using is:    kernel-2.6.30.5-43.fc11.x86_64
The nfs-utils I'm using is: nfs-utils-1.2.0-4.fc11.x86_64

So something else must be in play here.... 

Please do a 
   rpcdebug -m nfs -s mount (which turns on kernel debugging)

then added a '-v' to the mount command
   mount -v -t nfs localhost:/nosuchdir /mnt

Finally, please post the output of the mount command 
and the kernel debugging (which is in /var/log/messages)
Comment 2 Tobias Ringstrom 2009-09-09 03:09:11 EDT
Thanks for looking into this so swiftly!

Before filing the bug, I tested it on two different computers, but they were both 32 bit.  The kernel was kernel-2.6.30.5-43.fc11.i586 on one of them and kernel-2.6.29.6-217.2.8.fc11.i586 on the other.  Both behaved exactly the same.  Here's the additional info you requested:

    # rpcdebug -m nfs -s mount
    nfs        mount

    # mount -v -t nfs localhost:/nosuchdir /mnt
    mount.nfs: timeout set for Wed Sep  9 08:29:48 2009
    mount.nfs: text-based options: 'addr=127.0.0.1'
    mount.nfs: mount(2): Operation not supported
    mount.nfs: an incorrect mount option was specified

    # dmesg | tail -7
    NFS: nfs mount opts='addr=127.0.0.1'
    NFS:   parsing nfs mount option 'addr=127.0.0.1'
    NFS: parsing IPv4 address 127.0.0.1
    NFS: MNTPATH: '/nosuchdir'
    NFS: sending MNT request for localhost:/nosuchdir
    NFS: failed to create RPC client, status=-95
    NFS: unable to mount server localhost, error -95

Today I also tested on an x86_64 machine with the same kernel and nfs-utils that you have, and I got exactly the same RPC error that you got, but when I added debugging I got the following potentially interesting result:

    # mount -t nfs localhost:/nosuchdir /mnt
    mount.nfs: mount to NFS server 'localhost:/nosuchdir' failed: RPC Error: Program not registered

    # rpcdebug -m nfs -s mount
    nfs        mount

    # mount -v -t nfs localhost:/nosuchdir /mnt
    mount.nfs: timeout set for Wed Sep  9 08:45:03 2009
    mount.nfs: text-based options: 'addr=127.0.0.1'
    mount.nfs: mount(2): Operation not supported
    mount.nfs: an incorrect mount option was specified       <--------- LOOK!

    # dmesg | tail -7
    NFS: nfs mount opts='addr=127.0.0.1'
    NFS:   parsing nfs mount option 'addr=127.0.0.1'
    NFS: parsing IPv4 address 127.0.0.1
    NFS: MNTPATH: '/nosuchdir'
    NFS: sending MNT request for localhost:/nosuchdir
    NFS: failed to create RPC client, status=-95
    NFS: unable to mount server localhost, error -95

I still get the "an incorrect mount option was specified" error after clearing the mount debug flag in the nfs module.  The verbose flag is enough to make also the x86_64 get the bogus mount option error.
Comment 3 Fedora Update System 2009-09-09 08:39:25 EDT
nfs-utils-1.2.0-5.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/nfs-utils-1.2.0-5.fc11
Comment 4 Steve Dickson 2009-09-09 08:43:19 EDT
It turns out the mount command was not handling error correctly.
The problem should be fixed in nfs-utils-1.2.0-5.fc11 which
is available at:
     http://koji.fedoraproject.org/koji/buildinfo?buildID=131163
Could up please install and test the patch to insure the problem 
is truly fixed... If it is, please set the karma according in
the like in Comment #3

tia,
Comment 5 Tobias Ringstrom 2009-09-09 09:01:34 EDT
Thanks!  It works fine now:

    # mount -t nfs localhost:/nosuchdir /mnt
    mount.nfs: requested NFS version or transport protocol is not supported
Comment 6 Fedora Update System 2009-09-09 23:50:07 EDT
nfs-utils-1.2.0-5.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update nfs-utils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9470
Comment 7 Fedora Update System 2009-10-06 06:11:02 EDT
nfs-utils-1.2.0-5.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.