summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 32059123dd2..419944af6b5 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);