• Christian Brauner's avatar
    ovl: implement get acl method · 6c0a8bfb
    Christian Brauner authored
    The current way of setting and getting posix acls through the generic
    xattr interface is error prone and type unsafe. The vfs needs to
    interpret and fixup posix acls before storing or reporting it to
    userspace. Various hacks exist to make this work. The code is hard to
    understand and difficult to maintain in it's current form. Instead of
    making this work by hacking posix acls through xattr handlers we are
    building a dedicated posix acl api around the get and set inode
    operations. This removes a lot of hackiness and makes the codepaths
    easier to maintain. A lot of background can be found in [1].
    
    In order to build a type safe posix api around get and set acl we need
    all filesystem to implement get and set acl.
    
    Now that we have added get and set acl inode operations that allow easy
    access to the dentry we give overlayfs it's own get and set acl inode
    operations.
    
    Since overlayfs is a stacking filesystem it will use the newly added
    posix acl api when retrieving posix acls from the relevant layer.
    
    Since overlayfs can also be mounted on top of idmapped layers. If
    idmapped layers are used overlayfs must take the layer's idmapping into
    account after it retrieved the posix acls from the relevant layer.
    
    Note, until the vfs has been switched to the new posix acl api this
    patch is a non-functional change.
    
    Link: https://lore.kernel.org/all/20220801145520.1532837-1-brauner@kernel.org [1]
    Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
    6c0a8bfb
inode.c 36.1 KB