mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-26 10:02:58 +00:00
Don't cache ACL's in newer kernels.
The caller takes care of caching for us. Us doing caching messes with memory management of cached ACLs and breaks. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -69,12 +69,14 @@ struct posix_acl *scoutfs_get_acl_locked(struct inode *inode, int type, struct s
|
|||||||
char *name;
|
char *name;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#ifndef KC___POSIX_ACL_CREATE
|
||||||
if (!IS_POSIXACL(inode))
|
if (!IS_POSIXACL(inode))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
acl = get_cached_acl(inode, type);
|
acl = get_cached_acl(inode, type);
|
||||||
if (acl != ACL_NOT_CACHED)
|
if (acl != ACL_NOT_CACHED)
|
||||||
return acl;
|
return acl;
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = acl_xattr_name_len(type, &name, NULL);
|
ret = acl_xattr_name_len(type, &name, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -96,9 +98,11 @@ struct posix_acl *scoutfs_get_acl_locked(struct inode *inode, int type, struct s
|
|||||||
acl = ERR_PTR(ret);
|
acl = ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef KC___POSIX_ACL_CREATE
|
||||||
/* can set null negative cache */
|
/* can set null negative cache */
|
||||||
if (!IS_ERR(acl))
|
if (!IS_ERR(acl))
|
||||||
set_cached_acl(inode, type, acl);
|
set_cached_acl(inode, type, acl);
|
||||||
|
#endif
|
||||||
|
|
||||||
kfree(value);
|
kfree(value);
|
||||||
|
|
||||||
@@ -112,8 +116,10 @@ struct posix_acl *scoutfs_get_acl(struct inode *inode, int type)
|
|||||||
struct posix_acl *acl;
|
struct posix_acl *acl;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#ifndef KC___POSIX_ACL_CREATE
|
||||||
if (!IS_POSIXACL(inode))
|
if (!IS_POSIXACL(inode))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = scoutfs_lock_inode(sb, SCOUTFS_LOCK_READ, 0, inode, &lock);
|
ret = scoutfs_lock_inode(sb, SCOUTFS_LOCK_READ, 0, inode, &lock);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@@ -188,8 +194,10 @@ int scoutfs_set_acl_locked(struct inode *inode, struct posix_acl *acl, int type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
#ifndef KC___POSIX_ACL_CREATE
|
||||||
if (!ret)
|
if (!ret)
|
||||||
set_cached_acl(inode, type, acl);
|
set_cached_acl(inode, type, acl);
|
||||||
|
#endif
|
||||||
|
|
||||||
kfree(value);
|
kfree(value);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user