summaryrefslogtreecommitdiffstats
path: root/gluster/gfapi/gfapi.py
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2018-09-19 15:56:13 +0530
committerPrashanth Pai <ppai@redhat.com>2018-09-19 15:58:36 +0530
commit8d81f9bf7c4eb64161e489e468bb29269c918bed (patch)
tree57ba50f6d8043c01193f3e445616c3eff46fc048 /gluster/gfapi/gfapi.py
parent1266c51e57b32fd979a61ebfc73f93964223822f (diff)
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 <ppai@redhat.com>
Diffstat (limited to 'gluster/gfapi/gfapi.py')
-rw-r--r--gluster/gfapi/gfapi.py2
1 files changed, 1 insertions, 1 deletions
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()