summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-01 11:11:59 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2016-09-01 11:11:59 +0200
commit5201dc449e4b6b6d7e92f7f974269b11681f98b5 (patch)
tree06076e84519b88f46240ea8bdb3a618f1159d5e6 /fs/overlayfs
parenteea2fb4851e9dcbab6b991aaf47e2e024f1f55a0 (diff)
downloadlinux-5201dc449e4b6b6d7e92f7f974269b11681f98b5.tar.gz
linux-5201dc449e4b6b6d7e92f7f974269b11681f98b5.tar.bz2
linux-5201dc449e4b6b6d7e92f7f974269b11681f98b5.zip
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: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/inode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 024352f1d405..d50d1ead1b6f 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -10,6 +10,7 @@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/xattr.h>
+#include <linux/posix_acl.h>
#include "overlayfs.h"
static int ovl_copy_up_truncate(struct dentry *dentry)
@@ -314,14 +315,14 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type)
const struct cred *old_cred;
struct posix_acl *acl;
- if (!IS_POSIXACL(realinode))
+ if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode))
return NULL;
if (!realinode->i_op->get_acl)
return NULL;
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);
return acl;