summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-09-25 02:48:00 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-28 18:57:18 -0700
commit5464ab94634e949ff4fdcba74f13ed7302fbd322 (patch)
treef3376f0cb0f22bc0762f2ae3c99386919d523404 /libglusterfsclient/src/libglusterfsclient.c
parent47802bd0fdb65424a4466cb2d67118e98a5337a8 (diff)
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 <avati@dev.gluster.com> 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
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 962eb97..ed00474 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);