diff options
author | Ashish Pandey <aspandey@redhat.com> | 2019-07-11 16:52:49 +0530 |
---|---|---|
committer | Pranith Kumar K <pkarampu@redhat.com> | 2020-02-25 12:34:17 +0530 |
commit | 64c9628da16cf0722d809e6c9adb7bc8d6fd7f1e (patch) | |
tree | 592ff2abf33eb2534af9973f42b533dfb186ba28 /xlators/cluster/ec/src/ec-inode-read.c | |
parent | 9013328774c87d8a32ff80e78f6478e22c5157b9 (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
fixes: bz#1805057
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 d13955e4497..db368a6fe5b 100644 --- a/xlators/cluster/ec/src/ec-inode-read.c +++ b/xlators/cluster/ec/src/ec-inode-read.c @@ -395,8 +395,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; |