Bug 1753592
Summary: | Segmentation fault occurs while truncate file | |||
---|---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | evangelos <vpolakis> | |
Component: | write-behind | Assignee: | Nithya Balachandran <nbalacha> | |
Status: | CLOSED NEXTRELEASE | QA Contact: | ||
Severity: | urgent | Docs Contact: | ||
Priority: | unspecified | |||
Version: | mainline | CC: | bugs, nbalacha, pasik, rgowdapp | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | All | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | 1749369 | |||
: | 1755678 1755679 1797882 (view as bug list) | Environment: | ||
Last Closed: | 2019-09-26 02:28:52 UTC | Type: | --- | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1755678, 1755679, 1797882 |
Description
evangelos
2019-09-19 11:23:25 UTC
REVIEW: https://review.gluster.org/23445 (Segmentation fault occurs during truncate) posted (#2) for review on master by Vangelis Polakis Hi, What version of gluster are you using? I have seen in this issue in 5.6 Thanks. We will take a look and get back to you. Hi, Thank you for an excellent test. Would you mind if I added it to the regression framework? I'm afraid the patch provided will not fix the issue here. In most xlators, the local structure is allocated from a mempool which is why the mem_put will usually work. However, the wb xlator does not have a defined local struct of its own. Instead, for the truncate and ftruncate fops, it saved the wb_inode (which is allocated using GF_CALLOC) in frame->local. In the normal code path, this is cleared in the wb_truncate_cbk and wb_ftruncate_cbk functions and frame->local is set to NULL before unwinding the fop. The test code, however, does a write followed by a conflicting truncate. As the write fails with ENOSPC, __wb_pick_winds determines that there is a conflict, updates the request op_ret and op_errno for the ftruncate request. The wb_ftruncate_cbk is not called and the req is instead unwound in wb_do_winds -> call_unwind_error_keep_stub code path. This does not clear frame->local which causes the mem_put to crash. (In reply to evangelos from comment #3) > I have seen in this issue in 5.6 The issue also exists in the master branch. REVIEW: https://review.gluster.org/23485 (perf/write-behind: Clear frame->local on conflict error) posted (#1) for review on master by N Balachandran REVIEW: https://review.gluster.org/23485 (perf/write-behind: Clear frame->local on conflict error) merged (#1) on master by N Balachandran thanks a lot for the explanation/complete solution! yes, of course you can add it in the regression test. One comment though, wouldn't be good to also add the check in the mem_put for the ptr before referencing ? i mean in case something similar happens in the future instead or coredumping an error would appear. REVISION POSTED: https://review.gluster.org/23445 (Segmentation fault occurs during truncate) posted (#4) for review on master by Pranith Kumar Karampuri |