aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/inode.c6
-rw-r--r--fs/jffs2/acl.c3
-rw-r--r--fs/jfs/acl.c13
-rw-r--r--include/linux/posix_acl.h10
-rw-r--r--kernel/Makefile4
-rw-r--r--mm/shmem.c5
6 files changed, 23 insertions, 18 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/fs/jfs/acl.c b/fs/jfs/acl.c
index f272bf032e1e..91fa3ad6e8c2 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -118,15 +118,16 @@ out:
118 118
119static int jfs_check_acl(struct inode *inode, int mask) 119static int jfs_check_acl(struct inode *inode, int mask)
120{ 120{
121 if (inode->i_acl == ACL_NOT_CACHED) { 121 struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS);
122 struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); 122
123 if (IS_ERR(acl)) 123 if (IS_ERR(acl))
124 return PTR_ERR(acl); 124 return PTR_ERR(acl);
125 if (acl) {
126 int error = posix_acl_permission(inode, acl, mask);
125 posix_acl_release(acl); 127 posix_acl_release(acl);
128 return error;
126 } 129 }
127 130
128 if (inode->i_acl)
129 return posix_acl_permission(inode, inode->i_acl, mask);
130 return -EAGAIN; 131 return -EAGAIN;
131} 132}
132 133
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 0cdba01b7756..065a3652a3ea 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -83,6 +83,7 @@ extern int posix_acl_chmod_masq(struct posix_acl *, mode_t);
83extern struct posix_acl *get_posix_acl(struct inode *, int); 83extern struct posix_acl *get_posix_acl(struct inode *, int);
84extern int set_posix_acl(struct inode *, int, struct posix_acl *); 84extern int set_posix_acl(struct inode *, int, struct posix_acl *);
85 85
86#ifdef CONFIG_FS_POSIX_ACL
86static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) 87static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
87{ 88{
88 struct posix_acl **p, *acl; 89 struct posix_acl **p, *acl;
@@ -146,5 +147,14 @@ static inline void forget_cached_acl(struct inode *inode, int type)
146 if (old != ACL_NOT_CACHED) 147 if (old != ACL_NOT_CACHED)
147 posix_acl_release(old); 148 posix_acl_release(old);
148} 149}
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}
149 159
150#endif /* __LINUX_POSIX_ACL_H */ 160#endif /* __LINUX_POSIX_ACL_H */
diff --git a/kernel/Makefile b/kernel/Makefile
index da750010a6fc..780c8dcf4516 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -69,8 +69,8 @@ obj-$(CONFIG_IKCONFIG) += configs.o
69obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o 69obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
70obj-$(CONFIG_STOP_MACHINE) += stop_machine.o 70obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
71obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o 71obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
72obj-$(CONFIG_AUDIT) += audit.o auditfilter.o 72obj-$(CONFIG_AUDIT) += audit.o auditfilter.o audit_watch.o
73obj-$(CONFIG_AUDITSYSCALL) += auditsc.o audit_watch.o 73obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
74obj-$(CONFIG_GCOV_KERNEL) += gcov/ 74obj-$(CONFIG_GCOV_KERNEL) += gcov/
75obj-$(CONFIG_AUDIT_TREE) += audit_tree.o 75obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
76obj-$(CONFIG_KPROBES) += kprobes.o 76obj-$(CONFIG_KPROBES) += kprobes.o
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