aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/acl.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 08:46:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 08:46:57 -0700
commitfeb72ce827b939d5228664c92c2dfed7753cae46 (patch)
treede2d78ee45d9e0df234e98eea67ebc3a21525d8f /fs/ext3/acl.c
parentMerge branch 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux (diff)
parentget rid of BKL in fs/sysv (diff)
downloadlinux-dev-feb72ce827b939d5228664c92c2dfed7753cae46.tar.xz
linux-dev-feb72ce827b939d5228664c92c2dfed7753cae46.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: get rid of BKL in fs/sysv get rid of BKL in fs/minix get rid of BKL in fs/efs befs ->pust_super() doesn't need BKL Cleanup of adfs headers 9P doesn't need BKL in ->umount_begin() fuse doesn't need BKL in ->umount_begin() No instance of ->bmap() needs BKL remove unlock_kernel() left accidentally ext4: avoid unnecessary spinlock in critical POSIX ACL path ext3: avoid unnecessary spinlock in critical POSIX ACL path
Diffstat (limited to 'fs/ext3/acl.c')
-rw-r--r--fs/ext3/acl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index d81ef2fdb08e..e0c745451715 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -129,12 +129,15 @@ fail:
static inline struct posix_acl *
ext3_iget_acl(struct inode *inode, struct posix_acl **i_acl)
{
- struct posix_acl *acl = EXT3_ACL_NOT_CACHED;
+ struct posix_acl *acl = ACCESS_ONCE(*i_acl);
- spin_lock(&inode->i_lock);
- if (*i_acl != EXT3_ACL_NOT_CACHED)
- acl = posix_acl_dup(*i_acl);
- spin_unlock(&inode->i_lock);
+ if (acl) {
+ spin_lock(&inode->i_lock);
+ acl = *i_acl;
+ if (acl != EXT3_ACL_NOT_CACHED)
+ acl = posix_acl_dup(acl);
+ spin_unlock(&inode->i_lock);
+ }
return acl;
}