Bug 1507896

Summary: glfs_init returns incorrect errno on faliure
Product: [Community] GlusterFS Reporter: Denis Chaplygin <dchaplyg>
Component: libgfapiAssignee: Sheetal Pamecha <spamecha>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: mainlineCC: bugs, jthottan, ndevos, pgurusid
Target Milestone: ---Keywords: EasyFix, StudentProject, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-12 08:03:27 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:
Embargoed:

Description Denis Chaplygin 2017-10-31 11:59:06 UTC
Description of problem: glfs_init called  with volume name prefixed by '/'  returns -1 and sets errno to 0.


Version-Release number of selected component (if applicable): 3.12


How reproducible: always


Steps to Reproduce:
1. Create some gluster volume, for example 'test'
2. Try to call glfs_init with volume name '/test'

Actual results: glfs_init returns -1 and sets errno to 0. With logging enabled it will log the following error: 
  E [MSGID: 101091] [graph.c:493:glusterfs_graph_prepare] 0-graph: glusterfs graph settop failed

Expected results: glfs_init should set errno to some meaningful value and correctly report volume name incorrectness.

Comment 1 Shyamsundar 2018-10-23 14:54:28 UTC
Release 3.12 has been EOLd and this bug was still found to be in the NEW state, hence moving the version to mainline, to triage the same and take appropriate actions.

Comment 2 Worker Ant 2018-11-21 11:02:40 UTC
REVIEW: https://review.gluster.org/21699 (libgfapi: glfs_init returns incorrect errno on faliure) posted (#1) for review on master by Iraj Jamali

Comment 4 Worker Ant 2019-08-19 10:25:32 UTC
REVIEW: https://review.gluster.org/23265 (libgfapi: return correct errno on invalid volume name) posted (#1) for review on master by Sheetal Pamecha

Comment 5 Worker Ant 2019-09-12 08:03:27 UTC
REVIEW: https://review.gluster.org/23265 (libgfapi: return correct errno on invalid volume name) merged (#6) on master by Amar Tumballi