aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-09-01 05:11:59 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2016-09-01 05:11:59 -0400
commit5201dc449e4b6b6d7e92f7f974269b11681f98b5 (patch)
tree06076e84519b88f46240ea8bdb3a618f1159d5e6
parenteea2fb4851e9dcbab6b991aaf47e2e024f1f55a0 (diff)
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>
-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 @@
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/xattr.h> 12#include <linux/xattr.h>
13#include <linux/posix_acl.h>
13#include "overlayfs.h" 14#include "overlayfs.h"
14 15
15static int ovl_copy_up_truncate(struct dentry *dentry) 16static int ovl_copy_up_truncate(struct dentry *dentry)
@@ -314,14 +315,14 @@ struct posix_acl *ovl_get_acl(struct inode *inode, int type)
314 const struct cred *old_cred; 315 const struct cred *old_cred;
315 struct posix_acl *acl; 316 struct posix_acl *acl;
316 317
317 if (!IS_POSIXACL(realinode)) 318 if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode))
318 return NULL; 319 return NULL;
319 320
320 if (!realinode->i_op->get_acl) 321 if (!realinode->i_op->get_acl)
321 return NULL; 322 return NULL;
322 323
323 old_cred = ovl_override_creds(inode->i_sb); 324 old_cred = ovl_override_creds(inode->i_sb);
324 acl = realinode->i_op->get_acl(realinode, type); 325 acl = get_acl(realinode, type);
325 revert_creds(old_cred); 326 revert_creds(old_cred);
326 327
327 return acl; 328 return acl;