+++ 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)
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