summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/store.c
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2019-12-24 13:53:16 +0530
committerSanju Rakonde <srakonde@redhat.com>2019-12-25 16:49:06 +0530
commit6350695dccfafdd6ab22be3509ade549a34db98b (patch)
treeb1e95271a622ac273b870977b49a71a50ebb3732 /libglusterfs/src/store.c
parent28d87d5d833f2de320169aa766feaccc0bd98262 (diff)
Revert "store.c: remove a sys_stat() call - just open the file"
This reverts commit da735ad9b58b76d27c580a9feb63f14b2cc0669d. This commit is changing the behaviour of glusterd during its initialization. The removed piece of code checks whether the file mentioned in the path exists or not, if not it returns -1. This return value is considered for the sub sequent operations. By removing this code, we always return 0 and some part of the code will not be executed in the following code path. glusterd_options_init() -> glusterd_store_retrieve_options() -> gf_store_handle_retrieve() In glusterd_options_init(), we are not executing any code if the ret value is 0. ret = glusterd_store_retrieve_options(this); if (ret == 0) { goto out; } as we are not executing any code if the return value is 0, we are unable to enable the brick-multiplex feature using volume set. fixes: bz#1786459 Change-Id: I4f52b7b2ea8adb8df5087bb96927e9bb7db5b491
Diffstat (limited to 'libglusterfs/src/store.c')
-rw-r--r--libglusterfs/src/store.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libglusterfs/src/store.c b/libglusterfs/src/store.c
index fe4401d0355..f444741ef0c 100644
--- a/libglusterfs/src/store.c
+++ b/libglusterfs/src/store.c
@@ -453,9 +453,18 @@ int
gf_store_handle_retrieve(char *path, gf_store_handle_t **handle)
{
int32_t ret = -1;
+ struct stat statbuf = {0};
+ ret = sys_stat(path, &statbuf);
+ if (ret) {
+ gf_msg("", GF_LOG_ERROR, errno, LG_MSG_PATH_NOT_FOUND,
+ "Path "
+ "corresponding to %s.",
+ path);
+ goto out;
+ }
ret = gf_store_handle_new(path, handle);
-
+out:
gf_msg_debug("", 0, "Returning %d", ret);
return ret;
}