summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2016-04-11 15:44:16 +0530
committerKaushal M <kaushal@redhat.com>2016-04-15 19:00:16 -0700
commit1c62ca12df86eedf130de679ac99638a9d0ad82d (patch)
tree59efbf22482c2c4100b48b9327127526591b3fe5
parent96a246a8944cfd9154a75e7dc66fc9aacc39dbf3 (diff)
posix_acl: create inode ctx for posix_acl_get
This is a backport of http://review.gluster.org/13961 > Change-Id: Ibe5b00cd4b5d896133adc61f65094d783c492ed4 > BUG: 1325822 > Signed-off-by: vmallika <vmallika@redhat.com> Change-Id: I6be941044ea430913bb950c202f65a1c642d7ae4 BUG: 1325826 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/13962 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index 3ebdca4c0f2..cd799fc741a 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -853,17 +853,25 @@ posix_acl_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, inode_t *inode,
struct iatt *buf, dict_t *xattr, struct iatt *postparent)
{
- struct posix_acl *acl_access = NULL;
+ struct posix_acl *acl_access = NULL;
struct posix_acl *acl_default = NULL;
- struct posix_acl *old_access = NULL;
+ struct posix_acl *old_access = NULL;
struct posix_acl *old_default = NULL;
- data_t *data = NULL;
- int ret = 0;
- dict_t *my_xattr = NULL;
+ struct posix_acl_ctx *ctx = NULL;
+ data_t *data = NULL;
+ int ret = 0;
+ dict_t *my_xattr = NULL;
if (op_ret != 0)
goto unwind;
+ ctx = posix_acl_ctx_new (inode, this);
+ if (!ctx) {
+ op_ret = -1;
+ op_errno = ENOMEM;
+ goto unwind;
+ }
+
ret = posix_acl_get (inode, this, &old_access, &old_default);
data = dict_get (xattr, POSIX_ACL_ACCESS_XATTR);
@@ -1624,11 +1632,12 @@ posix_acl_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, gf_dirent_t *entries,
dict_t *xdata)
{
- gf_dirent_t *entry = NULL;
- struct posix_acl *acl_access = NULL;
- struct posix_acl *acl_default = NULL;
- data_t *data = NULL;
- int ret = 0;
+ gf_dirent_t *entry = NULL;
+ struct posix_acl *acl_access = NULL;
+ struct posix_acl *acl_default = NULL;
+ struct posix_acl_ctx *ctx = NULL;
+ data_t *data = NULL;
+ int ret = 0;
if (op_ret <= 0)
goto unwind;
@@ -1638,6 +1647,13 @@ posix_acl_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!entry->dict || !entry->inode)
continue;
+ ctx = posix_acl_ctx_new (entry->inode, this);
+ if (!ctx) {
+ op_ret = -1;
+ op_errno = ENOMEM;
+ goto unwind;
+ }
+
ret = posix_acl_get (entry->inode, this,
&acl_access, &acl_default);