]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
filesystem: make link handling more robust
authorEric Biggers <ebiggers@google.com>
Tue, 29 Oct 2019 07:04:39 +0000 (00:04 -0700)
committerEric Biggers <ebiggers@google.com>
Wed, 30 Oct 2019 16:11:29 +0000 (09:11 -0700)
commitfe58e7236a3285e172733aeab0b136bec968ac4d
tree35dce6e49541c05c5a5713ba7af3f20fe0d8dd24
parentc7da2443d6ffa51727db09f8ef1df6aea8c7612c
filesystem: make link handling more robust

The previous patch fixed making linked protectors to /dev/root, by
setting Mount.Device to the real device node rather than /dev/root.

That's good, but it also hints that the linked protector handling is
unnecessarily fragile, as it relies on the device node name matching
exactly.  The Linux kernel allows the same device to have multiple
device nodes, and path comparisons are slow and error-prone in general.

Change it to compare the device number instead.
filesystem/mountpoint.go