From: Miklos Szeredi Date: Thu, 1 Sep 2016 09:11:59 +0000 (+0200) Subject: ovl: use cached acl on underlying layer X-Git-Tag: v4.1.12-108.0.20170806_1300~11 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=95b0987c23f4b79bcec9af512068906547413a53;p=users%2Fjedix%2Flinux-maple.git 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 Orabug: 26401569 (backport upstream commit 5201dc449e4b6b6d7e92f7f974269b11681f98b5) Signed-off-by: Shan Hai Reviewed-by: Somasundaram Krishnasamy --- diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index c8952c9dda19d..e32f7042d3cb5 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "overlayfs.h" static int ovl_copy_up_last(struct dentry *dentry, struct iattr *attr, @@ -307,14 +308,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;