Bug 850578

Summary: forcegid documented in man page but not supported by mount.cifs
Product: [Fedora] Fedora Reporter: Gregory Lee Bartholomew <gregory.lee.bartholomew>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 17CC: gansalmon, itamar, jlayton, jonathan, kernel-maint, madhu.chinakonda, sprabhu, ssorce, steved
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-05 13:29:21 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Gregory Lee Bartholomew 2012-08-21 17:02:36 EDT
Description of problem:

The following command fails:

[root@node-02 ~]# /sbin/mount.cifs //smb.server.domain/share/homedir /mnt -o "noperm,mapchars,dir_mode=0750,file_mode=0640,uid=myusername,forceuid,gid=root,forcegid,domain=server.domain,user=myusername"
Password for myusername@//smb.server.domain/share/homedir:  ********
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

/var/log/messages reports that the "forcegid" option is unknown:

[root@node-02 ~]# grep forcegid /var/log/messages
Aug 21 15:30:40 node-02 kernel: [693888.328908] CIFS: Unknown mount option "forcegid"

The man page indicates that the option should be known:

[root@node-02 ~]# man --pager=cat mount.cifs | grep -B 1 -A 3 forcegid

           instructs the client to ignore any gid provided by the server for files and directories and to
           always assign the owner to be the value of the gid= option. See the section on FILE AND DIRECTORY
           OWNERSHIP AND PERMISSIONS below for more information.

       If the uid´s and gid´s being used do not match on the client and server, the forceuid and forcegid
       options may be helpful. Note however, that there is no corresponding option to override the mode.
       Permissions assigned to a file when forceuid or forcegid are in effect may not reflect the the real

The command succeeds if I simply remove the "forcegid" parameter.

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


How reproducible:


Steps to Reproduce:

See Description.
Actual results:

Invalid argument

Expected results:

Successful mount

Additional info:

I don't personally need this flag.  This bug report is just FYI.
Comment 1 Jeff Layton 2012-10-03 15:31:03 EDT
This is a kernel bug actually. When the mount option parser was converted to use the standard parsing code, this option got dropped. I have a patch that I'll send upstream after some testing.
Comment 2 Jeff Layton 2012-10-05 13:29:21 EDT
Patch has been merged upstream. I'll go ahead and close this with a resolution of UPSTREAM. It should eventually show up in stable kernels too so f17 will get it at that point.