From 8d81f9bf7c4eb64161e489e468bb29269c918bed Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Wed, 19 Sep 2018 15:56:13 +0530 Subject: Allow unmounting only on properly initialised fs object Libgfapi program coredumps when glfs_fini() is called on an uninitialised fs object. This fix will check if fs has been properly initialised before calling glfs_fini() Glusterfs BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1630803 Change-Id: I27f834b0477a84c7a08ebc7a5e5bfab934220f77 Signed-off-by: Prashanth Pai --- gluster/gfapi/gfapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gluster/gfapi/gfapi.py') diff --git a/gluster/gfapi/gfapi.py b/gluster/gfapi/gfapi.py index f0aa4f8..e0e3499 100644 --- a/gluster/gfapi/gfapi.py +++ b/gluster/gfapi/gfapi.py @@ -782,7 +782,7 @@ class Volume(object): :raises: LibgfapiException on failure """ - if self.fs: + if self.fs and self._mounted: ret = self._api.glfs_fini(self.fs) if ret < 0: err = ctypes.get_errno() -- cgit