diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-25 02:48:00 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-28 18:57:18 -0700 |
commit | 5464ab94634e949ff4fdcba74f13ed7302fbd322 (patch) | |
tree | f3376f0cb0f22bc0762f2ae3c99386919d523404 /libglusterfsclient | |
parent | 47802bd0fdb65424a4466cb2d67118e98a5337a8 (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')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 962eb973d28..ed00474011d 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); |