Bug 765508 (GLUSTER-3776) - [PATCH] umask is applied to to newly created files despite they inherit extended ACLs
Summary: [PATCH] umask is applied to to newly created files despite they inherit exten...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: GLUSTER-3776
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Amar Tumballi
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-02 19:26 UTC by Lubomir Rintel (GoodData, inactive)
Modified: 2013-12-19 00:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-27 06:54:39 UTC
Regression: RTP
Mount Type: nfs
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Lubomir Rintel (GoodData, inactive) 2011-11-02 19:26:08 UTC
On a POSIX filesystem:

ext3$ setfacl -d -m mask::rwx .
ext3$ umask 027
ext3$ mkdir subdir
ext3$ ls -ld subdir
drwxrwxr-x+ 2 lkundrak lkundrak 4096 Nov  2 20:12 subdir
ext3$ 

On GlusterFS:

glusterfs$ setfacl -d -m mask::rwx .
glusterfs$ umask 027
glusterfs$ mkdir subdir
glusterfs$ ls -ld subdir
drwxr-x---+ 2 root root 4096 Nov  2 20:19 subdir
glusterfs$ 

The umask is not supposed to be applied in case extended acls are present. Unfortunately, FUSE used to resolve umask itself, loosing the information of intended creation mode and umask before passing it to the filesystem server. Precisely for this reason (correct support of POSIX ACLs) FUSE_DONT_MASK was added.

I'm not sure how to fix that. Here's what I've done to mkdir() call:

https://github.com/lkundrak/glusterfs/commit/6e1cceafb338a696e2010ca7f895d6c15d886c7b

Would this be correct? Is mixing different versions of client and server supported, and if yes, does this break the protocol? If yes, let me know and I'll proceed modifying other file creation calls, otherwise please point me to the right direction. Thanks!

Comment 1 Lubomir Rintel (GoodData, inactive) 2011-11-03 08:10:53 UTC
Reworked the patches to utilize the parameters dictionaries instead of breaking the protocol. Submitted for review:

http://review.gluster.com/667
http://review.gluster.com/668

Comment 2 Amar Tumballi 2011-11-08 01:12:35 UTC
Csaba Henk sent some review comments on the submitted patches. Please see if the patch can be resubmitted with comments incorporated.

Comment 3 Lubomir Rintel (GoodData, inactive) 2011-11-08 13:01:17 UTC
Amar, thank you. I've addressed all Csaba's comments and submitted a new set of patches.

Comment 4 Anand Avati 2012-01-12 17:12:00 UTC
CHANGE: http://review.gluster.com/667 (fuse-bridge: preserve original mode and umask) merged in master by Anand Avati (avati)

Comment 5 Anand Avati 2012-01-12 17:12:44 UTC
CHANGE: http://review.gluster.com/668 (posix-acl: properly process umask in case client sent it) merged in master by Anand Avati (avati)

Comment 6 Anush Shetty 2012-01-17 09:39:08 UTC
I tested this on 3.3git and the issue is still not fixed.

# dmesg | grep -i fuse
[    0.553091] fuse init (API version 7.16)


On ext3
# setfacl -d -m mask::rwx .
# umask 027
# mkdir subdir
# ls -ld subdir
drwxrwxrwx+ 2 root root 4096 2012-01-17 14:56 subdir

On glusterfs
# setfacl -d -m mask::rwx .
# umask 027
# mkdir subdir
# ls -ld subdir
drwxrwx---+ 2 root root 8192 2012-01-17 14:58 subdir

Comment 7 Lubomir Rintel 2012-01-17 09:53:11 UTC
I will take a look.
Which exact version of server and client were you using?

Comment 8 Anush Shetty 2012-01-17 09:58:59 UTC
GlusterFS is from latest git pull (master branch).

Comment 9 Amar Tumballi 2012-02-27 07:43:34 UTC
QA says this bug is not yet fixed in master branch. Moving it to assigned.

Comment 10 Lubomir Rintel (GoodData, inactive) 2012-06-25 17:42:59 UTC
I could not reproduce the behavior above on neither RHEL 6.2 nor Fedora 17 -- for me it behaves both correctly and consistently.

Please ensure that the parent directory has the same mode and ACL on both ext3 and glusterfs when checking for regressions. If you manage to reproduce the behavior you describe, please include information about mode and ACL of the parent directory (your working directory, one level above "subdir").

Thank you.

Comment 11 Lubomir Rintel (GoodData, inactive) 2012-06-27 06:54:39 UTC
Seems like I can't switch this back to ON_QA, only to CLOSED. Closing in hope to get QA attention.


Note You need to log in before you can comment on or make changes to this bug.