Bug 1776784

Summary: glfsheal crash on unexpected volume name
Product: [Community] GlusterFS Reporter: Dmitry Antipov <dmantipov>
Component: coreAssignee: bugs <bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, ravishankar, sabose
Target Milestone: ---Keywords: Triaged
Target Release: ---Flags: ravishankar: needinfo? (dmantipov)
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-05 10:45:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Proposal fix none

Description Dmitry Antipov 2019-11-26 11:47:04 UTC
Created attachment 1639773 [details]
Proposal fix

# glfsheal nosuchvolume
Volume nosuchvolume does not exist
# glfsheal --oops
Segmentation fault (core dumped)

Comment 1 Ravishankar N 2019-12-04 12:21:01 UTC
Dmitry, glfsheal is not supposed to be invoked directly. You need to use the `gluster volume heal $VOLNAME` CLI only. That said, the fix seems to be a good check for gfapi programs that call "glfs_new($junk_volname)" causing it to crash. Can you send the attachment as a patch for review on gerrit? The work-flow is detailed at https://docs.gluster.org/en/latest/Developer-guide/Simplified-Development-Workflow/. Let me know if you need any help.

Comment 2 Worker Ant 2019-12-04 12:53:10 UTC
REVIEW: https://review.gluster.org/23806 (core: avoid NULL pointer dereference) posted (#1) for review on master by None

Comment 3 Dmitry Antipov 2019-12-04 12:55:16 UTC
(In reply to Ravishankar N from comment #1)

> Dmitry, glfsheal is not supposed to be invoked directly.

If so, shouldn't it be installed to (and invoked from) ${prefix}/libexec rather than ${prefix}/sbin?

Comment 4 Ravishankar N 2019-12-04 13:40:47 UTC
(In reply to Dmitry Antipov from comment #3)

> If so, shouldn't it be installed to (and invoked from) ${prefix}/libexec
> rather than ${prefix}/sbin?
Yes, correct. Feel free to send a patch if you would like to.

Comment 5 Worker Ant 2019-12-05 10:45:22 UTC
REVIEW: https://review.gluster.org/23806 (core: avoid NULL pointer dereference) merged (#3) on master by Xavi Hernandez