diff options
| author | Eric Biggers <ebiggers@google.com> | 2019-10-29 00:04:39 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@google.com> | 2019-10-30 09:11:29 -0700 |
| commit | c7b963bfa76b9541e01493d21fef3e3596ef9904 (patch) | |
| tree | a350c645996844ec246274f3401517dd3866fc1b /filesystem | |
| parent | 4eb1ea869703873f6f4192dcec5262f33a497fcb (diff) | |
filesystem: skip unnecessary mountpoint canonicalization
The kernel always shows mountpoints as absolute paths without symlinks,
so there's no need to canonicalize them in userspace.
Diffstat (limited to 'filesystem')
| -rw-r--r-- | filesystem/mountpoint.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/filesystem/mountpoint.go b/filesystem/mountpoint.go index c43e14e..861f5b1 100644 --- a/filesystem/mountpoint.go +++ b/filesystem/mountpoint.go @@ -134,12 +134,6 @@ func loadMountInfo() error { continue } - // Skip invalid mountpoints - var err error - if mnt.Path, err = canonicalizePath(mnt.Path); err != nil { - log.Printf("getting mnt_dir: %v", err) - continue - } // We can only use mountpoints that are directories for fscrypt. if !isDir(mnt.Path) { log.Printf("ignoring mountpoint %q because it is not a directory", mnt.Path) @@ -151,6 +145,7 @@ func loadMountInfo() error { // filesystems are listed in mount order. mountsByPath[mnt.Path] = mnt + var err error mnt.Device, err = canonicalizePath(mnt.Device) // Only use real valid devices (unlike cgroups, tmpfs, ...) if err == nil && isDevice(mnt.Device) { |