aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-24 16:58:48 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 16:58:48 -0400
commit72c04902d1e27c8a324014cff1d4475c11b1cecd (patch)
tree3e93abdd0a3eeedd6df5a1dc43170744f2fa7664
parent641cf4a668e9e69d2bc061e953422ff72a91f86e (diff)
Get "no acls for this inode" right, fix shmem breakage
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/btrfs/inode.c6
-rw-r--r--fs/jffs2/acl.c3
-rw-r--r--include/linux/posix_acl.h9
-rw-r--r--mm/shmem.c5
4 files changed, 13 insertions, 10 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 78ad38ddd01f..dbe1aabf96cd 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2122,10 +2122,8 @@ static void btrfs_read_locked_inode(struct inode *inode)
2122 * any xattrs or acls 2122 * any xattrs or acls
2123 */ 2123 */
2124 maybe_acls = acls_after_inode_item(leaf, path->slots[0], inode->i_ino); 2124 maybe_acls = acls_after_inode_item(leaf, path->slots[0], inode->i_ino);
2125 if (!maybe_acls) { 2125 if (!maybe_acls)
2126 inode->i_acl = NULL; 2126 cache_no_acl(inode);
2127 inode->i_default_acl = NULL;
2128 }
2129 2127
2130 BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0, 2128 BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0,
2131 alloc_group_block, 0); 2129 alloc_group_block, 0);
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index edd2ad6416d8..8fcb6239218e 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -284,8 +284,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
284 struct posix_acl *acl, *clone; 284 struct posix_acl *acl, *clone;
285 int rc; 285 int rc;
286 286
287 inode->i_default_acl = NULL; 287 cache_no_acl(inode);
288 inode->i_acl = NULL;
289 288
290 if (S_ISLNK(*i_mode)) 289 if (S_ISLNK(*i_mode))
291 return 0; /* Symlink always has no-ACL */ 290 return 0; /* Symlink always has no-ACL */
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index c513466c7dc7..065a3652a3ea 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -148,4 +148,13 @@ static inline void forget_cached_acl(struct inode *inode, int type)
148 posix_acl_release(old); 148 posix_acl_release(old);
149} 149}
150#endif 150#endif
151
152static inline void cache_no_acl(struct inode *inode)
153{
154#ifdef CONFIG_FS_POSIX_ACL
155 inode->i_acl = NULL;
156 inode->i_default_acl = NULL;
157#endif
158}
159
151#endif /* __LINUX_POSIX_ACL_H */ 160#endif /* __LINUX_POSIX_ACL_H */
diff --git a/mm/shmem.c b/mm/shmem.c
index 5f2019fc7895..d713239ce2ce 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1558,6 +1558,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, int mode,
1558 spin_lock_init(&info->lock); 1558 spin_lock_init(&info->lock);
1559 info->flags = flags & VM_NORESERVE; 1559 info->flags = flags & VM_NORESERVE;
1560 INIT_LIST_HEAD(&info->swaplist); 1560 INIT_LIST_HEAD(&info->swaplist);
1561 cache_no_acl(inode);
1561 1562
1562 switch (mode & S_IFMT) { 1563 switch (mode & S_IFMT) {
1563 default: 1564 default:
@@ -2379,10 +2380,6 @@ static struct inode *shmem_alloc_inode(struct super_block *sb)
2379 p = (struct shmem_inode_info *)kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL); 2380 p = (struct shmem_inode_info *)kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL);
2380 if (!p) 2381 if (!p)
2381 return NULL; 2382 return NULL;
2382#ifdef CONFIG_TMPFS_POSIX_ACL
2383 p->vfs_inode.i_acl = NULL;
2384 p->vfs_inode.i_default_acl = NULL;
2385#endif
2386 return &p->vfs_inode; 2383 return &p->vfs_inode;
2387} 2384}
2388 2385