diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-25 02:55:44 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-28 18:57:10 -0700 |
commit | 009fc3e3e921517a7b986f7b5a73676f43edb358 (patch) | |
tree | d005fc554224f32c010d8ba2abcc2ab0214760a5 /libglusterfsclient/src | |
parent | 5816d5dcc5e564017c101acb65e496a8d631b4eb (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')
-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 32059123d..419944af6 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -1782,11 +1782,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); |