aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/acl.c')
-rw-r--r--fs/ext4/acl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 647e0d65a284..605aeed96d68 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -129,12 +129,15 @@ fail:
129static inline struct posix_acl * 129static inline struct posix_acl *
130ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl) 130ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl)
131{ 131{
132 struct posix_acl *acl = EXT4_ACL_NOT_CACHED; 132 struct posix_acl *acl = ACCESS_ONCE(*i_acl);
133 133
134 spin_lock(&inode->i_lock); 134 if (acl) {
135 if (*i_acl != EXT4_ACL_NOT_CACHED) 135 spin_lock(&inode->i_lock);
136 acl = posix_acl_dup(*i_acl); 136 acl = *i_acl;
137 spin_unlock(&inode->i_lock); 137 if (acl != EXT4_ACL_NOT_CACHED)
138 acl = posix_acl_dup(acl);
139 spin_unlock(&inode->i_lock);
140 }
138 141
139 return acl; 142 return acl;
140} 143}