aboutsummaryrefslogtreecommitdiff
path: root/filesystem/mountpoint.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-09-09 11:30:45 -0700
committerEric Biggers <ebiggers@google.com>2023-09-09 11:30:45 -0700
commite663a3ee2287be77dcd44631b29147a1eddcb4f0 (patch)
tree07f2f6d6cd79d6f892c11d7ab808ae0372d4444d /filesystem/mountpoint.go
parentc999f0b04c526a85d061a7461c0e4211e94f9fb7 (diff)
Re-run 'make format' with latest version of gofmt
Diffstat (limited to 'filesystem/mountpoint.go')
-rw-r--r--filesystem/mountpoint.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/filesystem/mountpoint.go b/filesystem/mountpoint.go
index 0abae06..ae432bf 100644
--- a/filesystem/mountpoint.go
+++ b/filesystem/mountpoint.go
@@ -106,6 +106,7 @@ func getDeviceName(num DeviceNumber) string {
// Parse one line of /proc/self/mountinfo.
//
// The line contains the following space-separated fields:
+//
// [0] mount ID
// [1] parent ID
// [2] major:minor
@@ -184,11 +185,11 @@ func addUncontainedSubtreesRecursive(dst map[string]bool,
// preferably a read-write mount. However, that doesn't work in containers
// where the "/" subtree might not be mounted. Here's a real-world example:
//
-// mnt.Subtree mnt.Path
-// ----------- --------
-// /var/lib/lxc/base/rootfs /
-// /var/cache/pacman/pkg /var/cache/pacman/pkg
-// /srv/repo/x86_64 /srv/http/x86_64
+// mnt.Subtree mnt.Path
+// ----------- --------
+// /var/lib/lxc/base/rootfs /
+// /var/cache/pacman/pkg /var/cache/pacman/pkg
+// /srv/repo/x86_64 /srv/http/x86_64
//
// In this case, all mnt.Subtree are independent. To handle this case, we must
// choose the Mount whose mnt.Path contains the others, i.e. the first one.
@@ -199,10 +200,10 @@ func addUncontainedSubtreesRecursive(dst map[string]bool,
// needed to correctly handle bind mounts. For example, in the following case,
// the first Mount should be chosen:
//
-// mnt.Subtree mnt.Path
-// ----------- --------
-// /foo /foo
-// /foo/dir /dir
+// mnt.Subtree mnt.Path
+// ----------- --------
+// /foo /foo
+// /foo/dir /dir
//
// To solve this, we divide the mounts into non-overlapping trees of mnt.Path.
// Then, we choose one of these trees which contains (exactly or via path