summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorKinglong Mee <mijinlong@open-fs.com>2018-09-19 03:35:38 -0400
committerPoornima G <pgurusid@redhat.com>2018-10-10 17:07:48 +0000
commit27d3d481bd66c30aaa9e30040aadee7325e9995e (patch)
treea667dcb3ff8136fb5be6b0db9f2332926f0b0c0e /api
parent196b32423af9a5088056fe10ea22d01494670931 (diff)
gfapi: fix crash of using uninitialized fs->ctx
0 0x00007fb3db3a2ee4 in pub_glfs_fini (fs=0x7f8977d63f00) at glfs.c:1236 1 0x00007fb3db3a2065 in pub_glfs_new (volname=0x7f80de4d4d40 "openfs1") at glfs.c:784 2 0x00007fb3db5cf089 in glusterfs_get_fs (params=..., up_ops=up_ops@entry=0x7fb3ca643130) at /usr/src/debug/nfs-ganesha/src/FSAL/FSAL_GLUSTER/export.c:889 3 0x00007fb3db5cf99a in glusterfs_create_export ( fsal_hdl=0x7fb3db7e2490 <GlusterFS+112>, parse_node=0x7fb3ca6387d0, err_type=<optimized out>, up_ops=0x7fb3ca643130) at /usr/src/debug/nfs-ganesha/src/FSAL/FSAL_GLUSTER/export.c:1011 4 0x00007fb3e11c485f in mdcache_fsal_create_export ( sub_fsal=0x7fb3db7e2490 <GlusterFS+112>, parse_node=parse_node@entry=0x7fb3ca6387d0, err_type=err_type@entry=0x7fb3c0bef140, super_up_ops=<optimized out>) at /usr/src/debug/nfs-ganesha/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_main.c:281 (gdb) p errno $1 = 12 Change-Id: I3dd5b84b52962ceb0b5d4f9b4f475bf4aa724292 updates: bz#1626313 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index babaf20cee3..7b2a10dfa63 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -1221,13 +1221,18 @@ pub_glfs_fini(struct glfs *fs)
DECLARE_OLD_THIS;
- __GLFS_ENTRY_VALIDATE_FS(fs, invalid_fs);
+ if (!fs) {
+ errno = EINVAL;
+ goto invalid_fs;
+ }
ctx = fs->ctx;
if (!ctx) {
goto free_fs;
}
+ THIS = fs->ctx->master;
+
if (ctx->mgmt) {
rpc_clnt_disable(ctx->mgmt);
}