From efc6d4983245f2cea472a928428d9e236f68124f Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 28 May 2020 19:32:13 -0500 Subject: [PATCH 1/2] src/aiori-CEPHFS: Add option checks before init Signed-off-by: Mark Nelson --- src/aiori-CEPHFS.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/aiori-CEPHFS.c b/src/aiori-CEPHFS.c index 2c8d34b..0d38901 100755 --- a/src/aiori-CEPHFS.c +++ b/src/aiori-CEPHFS.c @@ -125,6 +125,12 @@ static option_help * CEPHFS_options(){ static void CEPHFS_Init() { + /* Short circuit if the options haven't been filled yet. */ + if (!o.user || !o.conf || !o.prefix) { + WARN("CEPHFS_Init() called before options have been populated!"); + return; + } + /* Short circuit if the mount handle already exists */ if (cmount) { return; From edba70e99c7609a84943c0b2ae7317fbbd71b60e Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 28 May 2020 20:18:05 -0500 Subject: [PATCH 2/2] aiori-CEPHFS: don't just unmount on close, release cmount too. Signed-off-by: Mark Nelson --- src/aiori-CEPHFS.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/aiori-CEPHFS.c b/src/aiori-CEPHFS.c index 0d38901..27f12db 100755 --- a/src/aiori-CEPHFS.c +++ b/src/aiori-CEPHFS.c @@ -173,7 +173,15 @@ static void CEPHFS_Init() static void CEPHFS_Final() { /* shutdown */ - ceph_shutdown(cmount); + int ret = ceph_unmount(cmount); + if (ret < 0) { + CEPHFS_ERR("ceph_umount failed", ret); + } + ret = ceph_release(cmount); + if (ret < 0) { + CEPHFS_ERR("ceph_release failed", ret); + } + cmount = NULL; } static void *CEPHFS_Create(char *testFileName, IOR_param_t * param) @@ -273,7 +281,6 @@ static void CEPHFS_Close(void *file, IOR_param_t * param) CEPHFS_ERR("ceph_close failed", ret); } free(file); - return; }