X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Freiserfs%2Fxattr_acl.c;h=97ae1b92bc47d0088a10ff3b1bc6433a70f05bda;hb=69cd291c6bbc6647fe3783257c5a2e076e808f71;hp=a47ac9aac8b2b743c8768091abacdeff0e14ee2c;hpb=7079060f3e86ea4c1d4e9c1e356592ef9dcaaa1f;p=linux-2.6-omap-h63xx.git diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index a47ac9aac8b..97ae1b92bc4 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -174,14 +175,14 @@ static void *posix_acl_to_disk(const struct posix_acl *acl, size_t * size) /* * Inode operation get_posix_acl(). * - * inode->i_sem: down + * inode->i_mutex: down * BKL held [before 2.5.x] */ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) { char *name, *value; struct posix_acl *acl, **p_acl; - size_t size; + int size; int retval; struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode); @@ -205,7 +206,7 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) return posix_acl_dup(*p_acl); size = reiserfs_xattr_get(inode, name, NULL, 0); - if ((int)size < 0) { + if (size < 0) { if (size == -ENODATA || size == -ENOSYS) { *p_acl = ERR_PTR(-ENODATA); return NULL; @@ -227,7 +228,8 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) acl = ERR_PTR(retval); } else { acl = posix_acl_from_disk(value, retval); - *p_acl = posix_acl_dup(acl); + if (!IS_ERR(acl)) + *p_acl = posix_acl_dup(acl); } kfree(value); @@ -237,7 +239,7 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) /* * Inode operation set_posix_acl(). * - * inode->i_sem: down + * inode->i_mutex: down * BKL held [before 2.5.x] */ static int @@ -312,7 +314,7 @@ reiserfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) return error; } -/* dir->i_sem: down, +/* dir->i_mutex: locked, * inode is new and not released into the wild yet */ int reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry, @@ -406,8 +408,9 @@ int reiserfs_cache_default_acl(struct inode *inode) acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT); reiserfs_read_unlock_xattrs(inode->i_sb); reiserfs_read_unlock_xattr_i(inode); - ret = acl ? 1 : 0; - posix_acl_release(acl); + ret = (acl && !IS_ERR(acl)); + if (ret) + posix_acl_release(acl); } return ret;