summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-09-08 05:43:20 +0530
committerNiels de Vos <ndevos@redhat.com>2016-09-13 01:05:04 -0700
commitc9271ff14d3efa8279cf67907548b3f43970d4fb (patch)
tree571b2a659d07598d382ec7b88b32696b96e3f2f2
parentfc144b5c8dff6bbe71173d24026d0e41863da021 (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>
-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 ed117b809cb..c1e8d782d89 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -1132,7 +1132,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;
}
@@ -1167,7 +1167,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;
}
@@ -1202,7 +1203,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;
}
@@ -1237,7 +1238,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;
}
@@ -1265,7 +1266,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;
}
@@ -1432,7 +1433,7 @@ green:
return 0;
red:
STACK_UNWIND_STRICT (symlink, frame, -1, EACCES, NULL, NULL, NULL,
- NULL, xdata);
+ NULL, NULL);
return 0;
}
@@ -1468,7 +1469,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;
}
@@ -1503,7 +1504,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;
}
@@ -1594,7 +1595,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;
}
@@ -1627,7 +1629,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;
}
@@ -1859,7 +1861,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;
}
@@ -1905,7 +1907,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;
}
@@ -2101,7 +2103,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;
}
@@ -2135,7 +2137,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;
}
@@ -2170,7 +2172,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;
}
@@ -2203,7 +2205,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;
}
@@ -2252,7 +2254,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;
}