Skip to content

RFC Richacls

Andreas Gruenbacher linux-cifs linux-fsdevel linux-nfs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest21 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21vfs: Minor documentation fixDocumentation/filesystems/porting Documentation/filesystems/vfs.txt+7 -40 replies
2/21vfs: Shrink struct posix_aclfs/posix_acl.c include/linux/posix_acl.h+5 -70 replies
3/21vfs: Add IS_ACL() and IS_RICHACL() testsfs/Kconfig fs/namei.c include/linux/fs.h +1 more+21 -50 replies
4/21vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flagsfs/namei.c include/linux/fs.h+26 -180 replies
5/21vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flagsfs/namei.c include/linux/fs.h+13 -40 replies
6/21vfs: Make the inode passed to inode_change_ok non-constfs/attr.c include/linux/fs.h+2 -20 replies
7/21vfs: Add permission flags for setting file attributesfs/attr.c include/linux/fs.h+70 -120 replies
8/21richacl: In-memory representation and helper functionsfs/Makefile fs/richacl_base.c include/linux/richacl.h+307 -00 replies
9/21richacl: Permission mapping functionsfs/richacl_base.c include/linux/richacl.h+163 -00 replies
10/21richacl: Compute maximum file masks from an aclfs/richacl_base.c include/linux/richacl.h+129 -00 replies
11/21richacl: Update the file masks in chmod()fs/richacl_base.c include/linux/richacl.h+41 -00 replies
12/21richacl: Permission check algorithmfs/richacl_base.c include/linux/richacl.h+113 -00 replies
13/21richacl: Create-time inheritancefs/Makefile fs/richacl_base.c fs/richacl_inode.c +1 more+136 -10 replies
14/21richacl: Check if an acl is equivalent to a file modefs/richacl_base.c include/linux/richacl.h+55 -00 replies
15/21richacl: Automatic Inheritancefs/richacl_base.c fs/richacl_inode.c include/linux/richacl.h+38 -30 replies
16/21richacl: xattr mapping functionsfs/Makefile fs/richacl_xattr.c include/linux/richacl_xattr.h+179 -10 replies
17/21vfs: Cache base_acl objects in inodesdrivers/staging/lustre/lustre/llite/llite_lib.c fs/f2fs/acl.c fs/inode.c +4 more+38 -230 replies
18/21vfs: Cache richacl in struct inodefs/inode.c fs/posix_acl.c fs/richacl_base.c +2 more+102 -130 replies
19/21vfs: Add richacl permission checkingfs/namei.c fs/posix_acl.c+52 -50 replies
20/21ext4: Implement rich acl for ext4fs/ext4/Kconfig fs/ext4/Makefile fs/ext4/acl.c +9 more+332 -200 replies
21/21ext4: Add richacl feature flagfs/ext4/ext4.h fs/ext4/super.c+36 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/21] Richacls

Hello,

here is an updated richacl patch queue, also available in git [1]. For those who might not know, richacls are an implementation of NFSv4 ACLs that cleanly integrates into the POSIX file permission model. The goal is to improve interoperability between Linux and other systems, mainly across the NFSv4 and CIFS/SMB protocols. A file system can either contain posix acls or richacls, but not both.

This patch queue includes the vfs and ext4 changes needed for local richacl support. A previous version of this patch queue was last posted about a year ago [2]; I have updated the patches to v4.0-rc1 and tried to incorporate the feedback from the previous discussion. The changes include:

* Introduction of a base_acl object type so that an inode can either cache a posix acl or a richacl largely without caring which of the two kinds it is dealing with.

* RCU support as for posix acls.

* Various cleanups and more documentation.

Things I'm not entirely happy with:

* A new get_richacl inode operation is introduced. This is needed because we need to perform permission checks in contexts where the dentry of the inode to check is not available and we cannot use the getxattr inode operation. It would be nice if we could either convert the getxattr inode operation to take an inode instead, or pass the dentries down to where the get_richacl inode operation is currently used.

* The base_acl code is rather ugly; maybe the previous version which was criticized wasn't so bad after all.

* It would be nice if the MAY_DELETE_SELF flag could override the sticky directory check as it did in the previous version of this patch queue. I couldn't come up with a clean way of achieving that, though.

Because the code has changed quite a bit since the last posting, I have removed the previous sign-offs.

At this point, I would like to ask for your feedback as to what should be changed before these patches can be merged, even if merging these patches alone doesn't make a while lot of sense. I will follow up with additional pieces to the puzzle like the nfsv4 support as I get them into shape again.

--

Which kind of acls an ext4 file system supports is determined by the "richacl" ext4 feature (mkfs.ext4 -O richacl or tune2fs -O richacl). The file system also needs to be mounted with the "acl" mount option, which is the default nowadays.

A version of e2fsprogs with support for the "richacl" feature can be found on github [3], but the feature can also be enabled "hard" in debugfs. Note that unpatched versions of e2fsck will not check file systems with the feature enabled though.

The acls themselves can be manipulated with the richacl command-line utility [4]. Some details on the permission model and examples of its use can be found at the richacl page, http://acl.bestbits.at/richacl/.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/agruen/linux-richacl.git richacl
[2] http://lwn.net/Articles/596517/
[3] https://github.com/andreas-gruenbacher/e2fsprogs
[4] https://github.com/andreas-gruenbacher/richacl

Thanks,
Andreas

--

Andreas Gruenbacher (19):
vfs: Minor documentation fix
vfs: Shrink struct posix_acl
vfs: Add IS_ACL() and IS_RICHACL() tests
vfs: Add MAY_CREATE_FILE and MAY_CREATE_DIR permission flags
vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags
vfs: Make the inode passed to inode_change_ok non-const
vfs: Add permission flags for setting file attributes
richacl: In-memory representation and helper functions
richacl: Permission mapping functions
richacl: Compute maximum file masks from an acl
richacl: Update the file masks in chmod()
richacl: Permission check algorithm
richacl: Create-time inheritance
richacl: Check if an acl is equivalent to a file mode
richacl: Automatic Inheritance
richacl: xattr mapping functions
vfs: Cache base_acl objects in inodes
vfs: Cache richacl in struct inode
vfs: Add richacl permission checking

Aneesh Kumar K.V (2):
ext4: Implement rich acl for ext4
ext4: Add richacl feature flag

 Documentation/filesystems/porting               |   8 +-
 Documentation/filesystems/vfs.txt               |   3 +
 drivers/staging/lustre/lustre/llite/llite_lib.c |   2 +-
 fs/Kconfig                                      |   3 +
 fs/Makefile                                     |   2 +
 fs/attr.c                                       |  81 ++-
 fs/ext4/Kconfig                                 |  15 +
 fs/ext4/Makefile                                |   1 +
 fs/ext4/acl.c                                   |   7 +-
 fs/ext4/acl.h                                   |  12 +-
 fs/ext4/ext4.h                                  |   6 +-
 fs/ext4/file.c                                  |   6 +-
 fs/ext4/ialloc.c                                |   7 +-
 fs/ext4/inode.c                                 |  10 +-
 fs/ext4/namei.c                                 |  11 +-
 fs/ext4/richacl.c                               | 229 ++++++++
 fs/ext4/richacl.h                               |  47 ++
 fs/ext4/super.c                                 |  41 +-
 fs/ext4/xattr.c                                 |   6 +
 fs/ext4/xattr.h                                 |   1 +
 fs/f2fs/acl.c                                   |   4 +-
 fs/inode.c                                      |  15 +-
 fs/namei.c                                      | 108 +++-
 fs/posix_acl.c                                  |  31 +-
 fs/richacl_base.c                               | 660 ++++++++++++++++++++++++
 fs/richacl_inode.c                              |  67 +++
 fs/richacl_xattr.c                              | 131 +++++
 include/linux/fs.h                              |  47 +-
 include/linux/posix_acl.h                       |  12 +-
 include/linux/richacl.h                         | 329 ++++++++++++
 include/linux/richacl_xattr.h                   |  47 ++
 include/uapi/linux/fs.h                         |   3 +-
 32 files changed, 1844 insertions(+), 108 deletions(-)
 create mode 100644 fs/ext4/richacl.c
 create mode 100644 fs/ext4/richacl.h
 create mode 100644 fs/richacl_base.c
 create mode 100644 fs/richacl_inode.c
 create mode 100644 fs/richacl_xattr.c
 create mode 100644 include/linux/richacl.h
 create mode 100644 include/linux/richacl_xattr.h
Signature · 1 line
2.1.0