X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=fs%2Freiserfs%2Fxattr_acl.c;h=97ae1b92bc47d0088a10ff3b1bc6433a70f05bda;hb=69cd291c6bbc6647fe3783257c5a2e076e808f71;hp=43de3ba833327d35618cd156d12ab96d53440c41;hpb=94bc2be31a01a3055ec94176e595dfe208e92d3b;p=linux-2.6-omap-h63xx.git diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 43de3ba8333..97ae1b92bc4 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c @@ -182,7 +182,7 @@ 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); @@ -206,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; @@ -228,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); @@ -407,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;