Commit 5201dc44 authored by Miklos Szeredi's avatar Miklos Szeredi

ovl: use cached acl on underlying layer

Instead of calling ->get_acl() directly, use get_acl() to get the cached
value.

We will have the acl cached on the underlying inode anyway, because we do
permission checking on the both the overlay and the underlying fs.

So, since we already have double caching, this improves performance without
any cost.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent eea2fb48
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/xattr.h> #include <linux/xattr.h>
#include <linux/posix_acl.h>
#include "overlayfs.h" #include "overlayfs.h"
static int ovl_copy_up_truncate(struct dentry *dentry) static int ovl_copy_up_truncate(struct dentry *dentry)
...@@ -314,14 +315,14 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type) ...@@ -314,14 +315,14 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type)
const struct cred *old_cred; const struct cred *old_cred;
struct posix_acl *acl; struct posix_acl *acl;
if (!IS_POSIXACL(realinode)) if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode))
return NULL; return NULL;
if (!realinode->i_op->get_acl) if (!realinode->i_op->get_acl)
return NULL; return NULL;
old_cred = ovl_override_creds(inode->i_sb); old_cred = ovl_override_creds(inode->i_sb);
acl = realinode->i_op->get_acl(realinode, type); acl = get_acl(realinode, type);
revert_creds(old_cred); revert_creds(old_cred);
return acl; return acl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment