From 5464ab94634e949ff4fdcba74f13ed7302fbd322 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Fri, 25 Sep 2009 02:48:00 +0000 Subject: libglusterfsclient: traverse the vmplist during fini only if any entries are mounted. - the vmplist.list is inited only during mounting of first entry. Hence doing a list traversal when no vmpentries are present, results in a segfault. Signed-off-by: Anand V. Avati BUG: 282 (segfault of applications using booster observed when the application does not mount any vmps.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=282 --- libglusterfsclient/src/libglusterfsclient.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 962eb973d..ed0047401 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -1781,11 +1781,14 @@ glusterfs_umount_all (void) pthread_mutex_lock (&vmplock); { - list_for_each_entry_safe (entry, tmp, &vmplist.list, list) { - /* even if there are errors, continue with other - mounts - */ - _libgf_umount (entry->vmp); + if (vmplist.entries > 0) { + list_for_each_entry_safe (entry, tmp, &vmplist.list, + list) { + /* even if there are errors, continue with other + mounts + */ + _libgf_umount (entry->vmp); + } } } pthread_mutex_unlock (&vmplock); -- cgit