Bug 7721 - smbmount or mount.cifs do not explain well for EINVAL error for mount syscall
Summary: smbmount or mount.cifs do not explain well for EINVAL error for mount syscall
Status: ASSIGNED
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.4.7
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: Jeff Layton
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 01:39 UTC by arsane
Modified: 2010-10-11 08:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arsane 2010-10-11 01:39:16 UTC
At present, when the syscall mount returns the EINVAL error, current
samba client tool just call strerror to print an error message like:

"Invalid argument".

which is actually different the EINVAL's usage for the system call of mount (it only means the source path is wrong) and may confuse the user.

I checked the the ”mount“ command in util-linux package, and it well explained this error and other error type returned by the mount syscall. I think the client-tools can do similar thing as mount tool has done.
Comment 1 Jeff Layton 2010-10-11 06:21:55 UTC
The mount(2) syscall just provides an error code, and no further info. The mount helper programs have no way to get additional info. It's quite typical for filesystems to return EINVAL when given mount options that make no sense. We do often pop a printk when that happens, and that will show up in dmesg.
Comment 2 arsane 2010-10-11 07:54:46 UTC
(In reply to comment #1)
> The mount(2) syscall just provides an error code, and no further info. The
> mount helper programs have no way to get additional info. It's quite typical
> for filesystems to return EINVAL when given mount options that make no sense.
> We do often pop a printk when that happens, and that will show up in dmesg.
> 
man mount(2):
SYNOPSIS
       #include <sys/mount.h>

       int mount(const char *source, const char *target,
                 const char *filesystemtype, unsigned long mountflags,
                 const void *data);

EINVAL source had an invalid superblock.  Or, a remount (MS_REMOUNT) was attempted, but source was not already mounted on target.  Or, a move (MS_MOVE) was attempted, but source was not a  mount point, or was '/'.

It means source param is invalid, instead of data or target parameter.
The "mount" command seems having tried to explain more about this error to help
command line user. 

If mount.cifs can get this done, it would be helpful.

Thanks.



Comment 3 arsane 2010-10-11 08:06:41 UTC
(In reply to comment #1)
> The mount(2) syscall just provides an error code, and no further info. The
> mount helper programs have no way to get additional info. It's quite typical
> for filesystems to return EINVAL when given mount options that make no sense.
> We do often pop a printk when that happens, and that will show up in dmesg.
> 

Or do you mean that the kernel implementation does not conform to the man mount(2)?