diff options
author | Ashish Pandey <aspandey@redhat.com> | 2019-07-11 16:52:49 +0530 |
---|---|---|
committer | Rinku Kothiya <rkothiya@redhat.com> | 2020-03-17 14:27:36 +0000 |
commit | 5b9e4bbeb115d39e1a5e929b4ffbe981e4597ae7 (patch) | |
tree | 0337ead5951c7390d13f02b5048716b9eef50f3e /xlators/cluster/ec/src/ec-inode-read.c | |
parent | 4bb9b30b4d7f49d17e57fad2540d9398c83d427a (diff) |
cluster/ec: Change handling of heal failure to avoid crash
Problem:
ec_getxattr_heal_cbk was called with NULL as second argument
in case heal was failing.
This function was dereferencing "cookie" argument which caused crash.
Solution:
Cookie is changed to carry the value that was supposed to be
stored in fop->data, so even in the case when fop is NULL in error
case, there won't be any NULL dereference.
Thanks to Xavi for the suggestion about the fix.
Change-Id: I0798000d5cadb17c3c2fbfa1baf77033ffc2bb8c
updates: #1061
Diffstat (limited to 'xlators/cluster/ec/src/ec-inode-read.c')
-rw-r--r-- | xlators/cluster/ec/src/ec-inode-read.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/xlators/cluster/ec/src/ec-inode-read.c b/xlators/cluster/ec/src/ec-inode-read.c index 503149cf840..7b569fa29b3 100644 --- a/xlators/cluster/ec/src/ec-inode-read.c +++ b/xlators/cluster/ec/src/ec-inode-read.c @@ -392,8 +392,7 @@ ec_getxattr_heal_cbk(call_frame_t *frame, void *cookie, xlator_t *xl, int32_t op_ret, int32_t op_errno, uintptr_t mask, uintptr_t good, uintptr_t bad, dict_t *xdata) { - ec_fop_data_t *fop = cookie; - fop_getxattr_cbk_t func = fop->data; + fop_getxattr_cbk_t func = cookie; ec_t *ec = xl->private; dict_t *dict = NULL; char *str; |