From: Al Viro Date: Sat, 23 Jul 2011 06:41:54 +0000 (-0400) Subject: generic_acl: no need to clone acl just to push it to set_cached_acl() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95203befa8887997f14077d8557e67d78457ee02;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git generic_acl: no need to clone acl just to push it to set_cached_acl() In-core acls are copy-on-write, so the reference taken by set_cached_acl() will do just fine. Signed-off-by: Al Viro --- diff --git a/fs/generic_acl.c b/fs/generic_acl.c index 3a60d9d1653c..134782116a62 100644 --- a/fs/generic_acl.c +++ b/fs/generic_acl.c @@ -134,14 +134,8 @@ generic_acl_init(struct inode *inode, struct inode *dir) if (acl) { struct posix_acl *clone; - if (S_ISDIR(inode->i_mode)) { - clone = posix_acl_clone(acl, GFP_KERNEL); - error = -ENOMEM; - if (!clone) - goto cleanup; - set_cached_acl(inode, ACL_TYPE_DEFAULT, clone); - posix_acl_release(clone); - } + if (S_ISDIR(inode->i_mode)) + set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); clone = posix_acl_clone(acl, GFP_KERNEL); error = -ENOMEM; if (!clone)