summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-09-08 05:43:20 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-09-15 09:30:50 -0700
commit3118cefcb18ffd53aee4500ee93878cad5648168 (patch)
tree81a44035bdfdd1104b06b739ef0344231820ad55 /xlators
parent0d3e879b6cb65b2e42d9fc2e1a1cfe4cc38d5296 (diff)
system/posix-acl: Unwind with NULL xdata on error
In posix-acl when there are errors xdata that comes as part of input is used to unwind which can be used as response xdata which may lead to problems as the keys in the input will match with keys in the output but the values the response xdata may expect can be completely different. For example, we see that dht sends DHT_IATT_IN_XDATA_KEY in setxattr which will be unwound with the same key in the xdata-response which dht thinks is valid response and fills stbuf with invalid values leading to EIO > BUG: 1374093 > Change-Id: I6b77a1fa1ee99cb62e181e1db2e6fea73f6eaaa3 > Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> > Reviewed-on: http://review.gluster.org/15421 > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> > Reviewed-by: Niels de Vos <ndevos@redhat.com> (cherry picked from commit c9271ff14d3efa8279cf67907548b3f43970d4fb) Change-Id: I6b77a1fa1ee99cb62e181e1db2e6fea73f6eaaa3 BUG: 1374640 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/15473 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index 3f4d40af48e..f3666ef9432 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -1128,7 +1128,7 @@ green:
loc, flags, fd, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (open, frame, -1, EACCES, NULL, xdata);
+ STACK_UNWIND_STRICT (open, frame, -1, EACCES, NULL, NULL);
return 0;
}
@@ -1163,7 +1163,8 @@ green:
fd, size, offset, flags, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (readv, frame, -1, EACCES, NULL, 0, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (readv, frame, -1, EACCES, NULL, 0, NULL, NULL,
+ NULL);
return 0;
}
@@ -1198,7 +1199,7 @@ green:
fd, vector, count, offset, flags, iobref, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (writev, frame, -1, EACCES, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (writev, frame, -1, EACCES, NULL, NULL, NULL);
return 0;
}
@@ -1233,7 +1234,7 @@ green:
fd, offset, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (ftruncate, frame, -1, EACCES, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (ftruncate, frame, -1, EACCES, NULL, NULL, NULL);
return 0;
}
@@ -1261,7 +1262,7 @@ green:
loc, fd, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (opendir, frame, -1, EACCES, NULL, xdata);
+ STACK_UNWIND_STRICT (opendir, frame, -1, EACCES, NULL, NULL);
return 0;
}
@@ -1428,7 +1429,7 @@ green:
return 0;
red:
STACK_UNWIND_STRICT (symlink, frame, -1, EACCES, NULL, NULL, NULL,
- NULL, xdata);
+ NULL, NULL);
return 0;
}
@@ -1464,7 +1465,7 @@ green:
loc, xflag, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (unlink, frame, -1, EACCES, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (unlink, frame, -1, EACCES, NULL, NULL, NULL);
return 0;
}
@@ -1499,7 +1500,7 @@ green:
loc, flags, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (rmdir, frame, -1, EACCES, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (rmdir, frame, -1, EACCES, NULL, NULL, NULL);
return 0;
}
@@ -1590,7 +1591,8 @@ posix_acl_link (call_frame_t *frame, xlator_t *this, loc_t *old, loc_t *new, dic
old, new, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (link, frame, -1, op_errno, NULL, NULL, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (link, frame, -1, op_errno, NULL, NULL, NULL, NULL,
+ NULL);
return 0;
}
@@ -1623,7 +1625,7 @@ green:
fd, size, offset, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (readdir, frame, -1, EACCES, NULL, xdata);
+ STACK_UNWIND_STRICT (readdir, frame, -1, EACCES, NULL, NULL);
return 0;
}
@@ -1855,7 +1857,7 @@ posix_acl_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
loc, buf, valid, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (setattr, frame, -1, op_errno, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (setattr, frame, -1, op_errno, NULL, NULL, NULL);
return 0;
}
@@ -1901,7 +1903,7 @@ posix_acl_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
fd, buf, valid, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (fsetattr, frame, -1, EACCES, NULL, NULL, xdata);
+ STACK_UNWIND_STRICT (fsetattr, frame, -1, EACCES, NULL, NULL, NULL);
return 0;
}
@@ -2097,7 +2099,7 @@ posix_acl_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
loc, xattr, flags, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (setxattr, frame, -1, op_errno, xdata);
+ STACK_UNWIND_STRICT (setxattr, frame, -1, op_errno, NULL);
return 0;
}
@@ -2131,7 +2133,7 @@ posix_acl_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
fd, xattr, flags, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (fsetxattr, frame, -1, op_errno, xdata);
+ STACK_UNWIND_STRICT (fsetxattr, frame, -1, op_errno, NULL);
return 0;
}
@@ -2166,7 +2168,7 @@ green:
return 0;
red:
- STACK_UNWIND_STRICT (getxattr, frame, -1, EACCES, NULL, xdata);
+ STACK_UNWIND_STRICT (getxattr, frame, -1, EACCES, NULL, NULL);
return 0;
}
@@ -2199,7 +2201,7 @@ green:
fd, name, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (fgetxattr, frame, -1, EACCES, NULL, xdata);
+ STACK_UNWIND_STRICT (fgetxattr, frame, -1, EACCES, NULL, NULL);
return 0;
}
@@ -2248,7 +2250,7 @@ green:
loc, name, xdata);
return 0;
red:
- STACK_UNWIND_STRICT (removexattr, frame, -1, op_errno, xdata);
+ STACK_UNWIND_STRICT (removexattr, frame, -1, op_errno, NULL);
return 0;
}