aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/reiserfs/super.c12
-rw-r--r--fs/reiserfs/xattr_acl.c21
-rw-r--r--include/linux/reiserfs_acl.h4
3 files changed, 16 insertions, 21 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 2969773cfc2..b194451fc04 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -530,8 +530,8 @@ static void init_once(void *foo)
530 INIT_LIST_HEAD(&ei->i_prealloc_list); 530 INIT_LIST_HEAD(&ei->i_prealloc_list);
531 inode_init_once(&ei->vfs_inode); 531 inode_init_once(&ei->vfs_inode);
532#ifdef CONFIG_REISERFS_FS_POSIX_ACL 532#ifdef CONFIG_REISERFS_FS_POSIX_ACL
533 ei->i_acl_access = NULL; 533 ei->i_acl_access = ACL_NOT_CACHED;
534 ei->i_acl_default = NULL; 534 ei->i_acl_default = ACL_NOT_CACHED;
535#endif 535#endif
536} 536}
537 537
@@ -586,14 +586,14 @@ static void reiserfs_clear_inode(struct inode *inode)
586 struct posix_acl *acl; 586 struct posix_acl *acl;
587 587
588 acl = REISERFS_I(inode)->i_acl_access; 588 acl = REISERFS_I(inode)->i_acl_access;
589 if (acl && !IS_ERR(acl)) 589 if (acl && acl != ACL_NOT_CACHED)
590 posix_acl_release(acl); 590 posix_acl_release(acl);
591 REISERFS_I(inode)->i_acl_access = NULL; 591 REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
592 592
593 acl = REISERFS_I(inode)->i_acl_default; 593 acl = REISERFS_I(inode)->i_acl_default;
594 if (acl && !IS_ERR(acl)) 594 if (acl && acl != ACL_NOT_CACHED)
595 posix_acl_release(acl); 595 posix_acl_release(acl);
596 REISERFS_I(inode)->i_acl_default = NULL; 596 REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
597} 597}
598#else 598#else
599#define reiserfs_clear_inode NULL 599#define reiserfs_clear_inode NULL
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index a1a7e3530e1..7b3aeb9327d 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -192,19 +192,19 @@ static inline void iset_acl(struct inode *inode, struct posix_acl **i_acl,
192 struct posix_acl *acl) 192 struct posix_acl *acl)
193{ 193{
194 spin_lock(&inode->i_lock); 194 spin_lock(&inode->i_lock);
195 if (*i_acl != ERR_PTR(-ENODATA)) 195 if (*i_acl != ACL_NOT_CACHED)
196 posix_acl_release(*i_acl); 196 posix_acl_release(*i_acl);
197 *i_acl = acl ? posix_acl_dup(acl) : ERR_PTR(-ENODATA); 197 *i_acl = posix_acl_dup(acl);
198 spin_unlock(&inode->i_lock); 198 spin_unlock(&inode->i_lock);
199} 199}
200 200
201static inline struct posix_acl *iget_acl(struct inode *inode, 201static inline struct posix_acl *iget_acl(struct inode *inode,
202 struct posix_acl **i_acl) 202 struct posix_acl **i_acl)
203{ 203{
204 struct posix_acl *acl = ERR_PTR(-ENODATA); 204 struct posix_acl *acl = ACL_NOT_CACHED;
205 205
206 spin_lock(&inode->i_lock); 206 spin_lock(&inode->i_lock);
207 if (*i_acl != ERR_PTR(-ENODATA)) 207 if (*i_acl != ACL_NOT_CACHED)
208 acl = posix_acl_dup(*i_acl); 208 acl = posix_acl_dup(*i_acl);
209 spin_unlock(&inode->i_lock); 209 spin_unlock(&inode->i_lock);
210 210
@@ -239,15 +239,13 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
239 } 239 }
240 240
241 acl = iget_acl(inode, p_acl); 241 acl = iget_acl(inode, p_acl);
242 if (acl && !IS_ERR(acl)) 242 if (acl != ACL_NOT_CACHED)
243 return acl; 243 return acl;
244 else if (PTR_ERR(acl) == -ENODATA)
245 return NULL;
246 244
247 size = reiserfs_xattr_get(inode, name, NULL, 0); 245 size = reiserfs_xattr_get(inode, name, NULL, 0);
248 if (size < 0) { 246 if (size < 0) {
249 if (size == -ENODATA || size == -ENOSYS) { 247 if (size == -ENODATA || size == -ENOSYS) {
250 *p_acl = ERR_PTR(-ENODATA); 248 *p_acl = NULL;
251 return NULL; 249 return NULL;
252 } 250 }
253 return ERR_PTR(size); 251 return ERR_PTR(size);
@@ -262,7 +260,7 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
262 /* This shouldn't actually happen as it should have 260 /* This shouldn't actually happen as it should have
263 been caught above.. but just in case */ 261 been caught above.. but just in case */
264 acl = NULL; 262 acl = NULL;
265 *p_acl = ERR_PTR(-ENODATA); 263 *p_acl = acl;
266 } else if (retval < 0) { 264 } else if (retval < 0) {
267 acl = ERR_PTR(retval); 265 acl = ERR_PTR(retval);
268 } else { 266 } else {
@@ -379,11 +377,8 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
379 } 377 }
380 378
381 acl = reiserfs_get_acl(dir, ACL_TYPE_DEFAULT); 379 acl = reiserfs_get_acl(dir, ACL_TYPE_DEFAULT);
382 if (IS_ERR(acl)) { 380 if (IS_ERR(acl))
383 if (PTR_ERR(acl) == -ENODATA)
384 goto apply_umask;
385 return PTR_ERR(acl); 381 return PTR_ERR(acl);
386 }
387 382
388 if (acl) { 383 if (acl) {
389 struct posix_acl *acl_copy; 384 struct posix_acl *acl_copy;
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 8cc65757e47..8f4d8d718b1 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -58,12 +58,12 @@ extern struct xattr_handler reiserfs_posix_acl_access_handler;
58 58
59static inline void reiserfs_init_acl_access(struct inode *inode) 59static inline void reiserfs_init_acl_access(struct inode *inode)
60{ 60{
61 REISERFS_I(inode)->i_acl_access = NULL; 61 REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
62} 62}
63 63
64static inline void reiserfs_init_acl_default(struct inode *inode) 64static inline void reiserfs_init_acl_default(struct inode *inode)
65{ 65{
66 REISERFS_I(inode)->i_acl_default = NULL; 66 REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
67} 67}
68#else 68#else
69 69