From 5dc152aac25ac7680ce0f83edc580d2a953d27a7 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Wed, 25 Feb 2015 15:44:59 +0530 Subject: libgfapi: In glfs_init() set the cwd to "/". Initially, when the cwd is NULL, while resolving a relative path, it was taken to be relative from the root of the volume. But this behaviour changed with the patch: http://review.gluster.org/#/c/9671/ with this patch, if cwd is NULL, all the fops on the files (given relative path) under root directory will fail. Hence, setting the cwd to "/" during glfs_init() itself. Change-Id: I65018f6cd42539d09852069b84099034b9925418 BUG: 1196019 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/9744 Reviewed-by: soumya k Reviewed-by: Rajesh Joseph Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- api/src/glfs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api/src/glfs.c') diff --git a/api/src/glfs.c b/api/src/glfs.c index 48af2412b8b..8389d674266 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -803,6 +803,11 @@ pub_glfs_init (struct glfs *fs) ret = glfs_init_wait (fs); + /* Set the initial current working directory to "/" */ + if (ret >= 0) { + ret = glfs_chdir (fs, "/"); + } + return ret; } -- cgit