Bug 206208

Summary: sloppy option broken on mount command
Product: [Fedora] Fedora Reporter: Jeff Bastian <jmbastia>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED DUPLICATE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: das_deniz, ikent
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-27 19:40:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Bastian 2006-09-12 21:57:16 UTC
Description of problem:
The -s (sloppy) option for the mount command is broken in the latest Fedora Core
6 test release.  It ignores the sloppy mount option and returns an error message
on unsupported mount options, and it returns an error code of 0 to the shell
which indicates success even though it didn't mount anything.

   # mount -t nfs -s -o ro,nobrowse nfssrv:/path/to/dir /mnt
   Unsupported nfs mount option: nobrowse
   # echo $?
   0

Returning 0 is breaking the automounter:
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=199777

Version-Release number of selected component (if applicable):
util-linux-2.13-0.40

How reproducible:
Every time

Steps to Reproduce:
1. Try to mount a directory using the -s flag and a bad mount option
2. Watch it return an error message on the unsupported mount option
3. Note the return value is 0 which indicates success
  
Actual results:
An error message was returned, the return value was 0 (success), and the
directory was not mounted.

Expected results:
If the -s flag is used, the unsupported mount option should be ignored (or
stripped), the mount should be made, and success returned (barring any other
problems).

If the -s flag is not used, the error message about unsupported mount options
should be printed, the return code should be non-zero, and the mount should fail.

Comment 1 Karel Zak 2006-09-13 07:28:39 UTC

*** This bug has been marked as a duplicate of 205038 ***

Comment 2 Jeff Moyer 2006-09-22 15:39:35 UTC
*** Bug 188945 has been marked as a duplicate of this bug. ***

Comment 3 das_deniz 2006-09-22 17:38:50 UTC
(In reply to comment #1)
> 
> *** This bug has been marked as a duplicate of 205038 ***

can you open the perms on the bug this is marked a duplicate of so we can see
the status of 'sloppy' being ignored and know what the resolution is - when
available?

thanks.

Comment 4 Karel Zak 2006-09-22 18:22:07 UTC
The problem has been fixed. Update to 

   util-linux-2.13-0.42
   nfs-utils-1.0.9-7.fc6

Comment 5 Jeff Bastian 2006-09-27 16:52:20 UTC
I've updated my system to these packages and the sloppy option is fixed. 
However, the return code from 'mount' is not:
   # mount -o ro,nobrowse server:/some/path; echo $?
   Unsupported nfs mount option: nobrowse
   0

Shouldn't $? be non-zero to indicate an error?

The automounter depends on the error codes returning accurate information.  See
BZ 199777.

(I tried to post this to BZ 205038 but it says I don't have permissions to do so.)




Comment 6 Ian Kent 2006-09-27 17:31:51 UTC
(In reply to comment #5)
> I've updated my system to these packages and the sloppy option is fixed. 
> However, the return code from 'mount' is not:
>    # mount -o ro,nobrowse server:/some/path; echo $?
>    Unsupported nfs mount option: nobrowse
>    0
> 
> Shouldn't $? be non-zero to indicate an error?

Yes I thibk that is wrong.

> 
> The automounter depends on the error codes returning accurate information.  See
> BZ 199777.

Does the mount occur anyway?
Perhaps the return is an indication of that and the message
is informational.

The handling of autofs specific mount options (they are
interpreted, removed and handled internaly) was fixed in
autofs-5.0.1-0.rc2.2 which of course is not available due
to the freeze.

Ian


Comment 7 Karel Zak 2006-09-27 19:40:58 UTC
The problem with exit code has been fixed in nfs-utils: 

* Tue Sep 26 2006 Steve Dickson <steved> 1.0.9-8
- mount.nfs was not returning a non-zero exit value
  on failed mounts (bz 206705)



*** This bug has been marked as a duplicate of 206705 ***