mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-11-27 06:01:12 +00:00
ANDROID: fix acl leaks
Fixes regressions associated with commit 073931017b49d9458aa351605b43a7e34598caef Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 32458736 Change-Id: I6ee127dfdf3594d24ccd8560541ac554c5b05eb6 [stummala@codeaurora.org: Fixed merge conflicts] Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
This commit is contained in:
parent
0a4d95d83e
commit
fdb66128fc
@ -268,16 +268,13 @@ static int gfs2_xattr_system_set(struct dentry *dentry, const char *name,
|
||||
|
||||
if (type == ACL_TYPE_ACCESS) {
|
||||
umode_t mode;
|
||||
struct posix_acl *old_acl = acl;
|
||||
|
||||
error = posix_acl_update_mode(inode, &mode, &acl);
|
||||
|
||||
if (error <= 0) {
|
||||
posix_acl_release(acl);
|
||||
acl = NULL;
|
||||
|
||||
if (error < 0)
|
||||
return error;
|
||||
}
|
||||
if (!acl)
|
||||
posix_acl_release(old_acl);
|
||||
if (error)
|
||||
goto out_release;
|
||||
|
||||
error = gfs2_set_mode(inode, mode);
|
||||
if (error)
|
||||
|
@ -693,11 +693,13 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
|
||||
return rc;
|
||||
}
|
||||
if (acl) {
|
||||
rc = posix_acl_equiv_mode(acl, &inode->i_mode);
|
||||
posix_acl_release(acl);
|
||||
struct posix_acl *old_acl = acl;
|
||||
|
||||
rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
|
||||
posix_acl_release(old_acl);
|
||||
if (rc < 0) {
|
||||
printk(KERN_ERR
|
||||
"posix_acl_equiv_mode returned %d\n",
|
||||
"posix_acl_update_mode returned %d\n",
|
||||
rc);
|
||||
return rc;
|
||||
}
|
||||
|
@ -389,16 +389,13 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,
|
||||
|
||||
if (type == ACL_TYPE_ACCESS) {
|
||||
umode_t mode;
|
||||
struct posix_acl *old_acl = acl;
|
||||
|
||||
error = posix_acl_update_mode(inode, &mode, &acl);
|
||||
|
||||
if (error <= 0) {
|
||||
posix_acl_release(acl);
|
||||
acl = NULL;
|
||||
|
||||
if (error < 0)
|
||||
return error;
|
||||
}
|
||||
if (!acl)
|
||||
posix_acl_release(old_acl);
|
||||
if (error)
|
||||
goto out_release;
|
||||
|
||||
error = xfs_set_mode(inode, mode);
|
||||
if (error)
|
||||
|
Loading…
Reference in New Issue
Block a user