Don't ignore drives with type "aufs" or "overlay" (Xamarin-31021)
authorEberhard Beilharz <eb1@sil.org>
Fri, 29 Jan 2016 21:24:06 +0000 (22:24 +0100)
committerEberhard Beilharz <eb1@sil.org>
Fri, 29 Jan 2016 21:33:41 +0000 (22:33 +0100)
Docker uses aufs or overlayfs to mount the root system in a
container. This change fixes Xamarin-31021 so that the drives
show up properly.

This change is released under the MIT license.

Change-Id: I5150b0e82f26e9dbd07bbcbc50e7ca50d856dde8

mono/io-layer/io.c

index c2e6a4e1906c1bfb59ea180dc16ba9a812f1d137..75cdbfb7670bdeaeabf47c8d3cb6e45413218eba 100644 (file)
@@ -3716,9 +3716,14 @@ add_drive_string (guint32 len, gunichar2 *buf, LinuxMountInfoParseState *state)
 
        if (state->fsname_index == 1 && state->fsname [0] == '/')
                ignore_entry = FALSE;
-       else if (state->fsname_index == 0 || memcmp ("none", state->fsname, state->fsname_index) == 0)
+       else if (memcmp ("overlay", state->fsname, state->fsname_index) == 0 ||
+               memcmp ("aufs", state->fstype, state->fstype_index) == 0) {
+               /* Don't ignore overlayfs and aufs - these might be used on Docker
+                * (https://bugzilla.xamarin.com/show_bug.cgi?id=31021) */
+               ignore_entry = FALSE;
+       } else if (state->fsname_index == 0 || memcmp ("none", state->fsname, state->fsname_index) == 0) {
                ignore_entry = TRUE;
-       else if (state->fstype_index >= 5 && memcmp ("fuse.", state->fstype, 5) == 0) {
+       else if (state->fstype_index >= 5 && memcmp ("fuse.", state->fstype, 5) == 0) {
                /* Ignore GNOME's gvfs */
                if (state->fstype_index == 21 && memcmp ("fuse.gvfs-fuse-daemon", state->fstype, state->fstype_index) == 0)
                        ignore_entry = TRUE;