Bug 1196607

Summary: Any op on files in the root directory of the volume fails unless absolute path is specified.
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: rjoseph
Component: glusterfs-develAssignee: Poornima G <pgurusid>
Status: CLOSED ERRATA QA Contact: Nag Pavan Chilakam <nchilaka>
Severity: high Docs Contact:
Priority: high    
Version: rhgs-3.0CC: annair, bugs, gluster-bugs, nlevinki, nsathyan, pgurusid, rcyriac, rhs-bugs, rwheeler, sdharane, vbellur
Target Milestone: ---Keywords: Regression, ZStream
Target Release: RHGS 3.0.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.6.0.48-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1196019 Environment:
Last Closed: 2015-03-26 06:36:35 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:
Bug Depends On: 1196019    
Bug Blocks: 1104039, 1182947    
Attachments:
Description Flags
Test script
none
QE log none

Description rjoseph 2015-02-26 11:12:54 UTC
+++ This bug was initially created as a clone of Bug #1196019 +++

Description of problem:
If a test case is as follows: 
....
fs = glfs_init();
....
glfs_mkdir(fs, "dir1", 0755); /* dir1 being relative to the root of the volume*/
...
glfs_fini();

The above test case fails for the below reason:

glfs_init() does not set the cwd to be "/", Hence with this patch the expectation would be that the path should be absolute always for a file directory under "/". i.e. the below statement succeeds:
    glfs_mkdir (fs, "/dir1", 0755);
Expecting absolute patch for any file directly under "/", may break the existing users.

Two possible fixes:

In glfs_init(), set fs->cwd to "/", not sure if there can be other cases where it can be unset.
In glfs_resolve_path() even if glfs_cwd_get() returns NULL, call priv_glfs_resolve_at() as it handles that case.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Anand Avati on 2015-02-25 06:20:28 EST ---

REVIEW: http://review.gluster.org/9744 (libgfapi: In glfs_init() set the cwd to "/".) posted (#1) for review on master by Poornima G (pgurusid)

Comment 6 Poornima G 2015-03-11 09:40:25 UTC
Created attachment 1000324 [details]
Test script

To run:
gcc -lgfapi bug-1196607.c -o bug-1196607
./bug-1196607 <volume name> <log file location>

Comment 7 Nag Pavan Chilakam 2015-03-12 08:15:05 UTC
Created attachment 1000854 [details]
QE log

Comment 8 Nag Pavan Chilakam 2015-03-12 08:16:34 UTC
Verified the bug using script provided by dev and ran it successfully.
marking it as pass
ran on 3.0.4.48u

Comment 10 errata-xmlrpc 2015-03-26 06:36:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0682.html