virtiofsd: Add mount ID to the lo_inode key
commitd672fce6baa0a02dfa64d717fb072c06e301d695
authorMax Reitz <mreitz@redhat.com>
Mon, 2 Nov 2020 16:18:56 +0000 (2 17:18 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 2 Nov 2020 19:22:50 +0000 (2 19:22 +0000)
tree5b94c03f929191f260d5b61a607e7aa1f4c1937b
parent84e319a575d04e9d53c24d801572a3ead538f9e4
virtiofsd: Add mount ID to the lo_inode key

Using st_dev is not sufficient to uniquely identify a mount: You can
mount the same device twice, but those are still separate trees, and
e.g. by mounting something else inside one of them, they may differ.

Using statx(), we can get a mount ID that uniquely identifies a mount.
If that is available, add it to the lo_inode key.

Most of this patch is taken from Miklos's mail here:
https://marc.info/?l=fuse-devel&m=160062521827983
(virtiofsd-use-mount-id.patch attachment)

Suggested-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20201102161859.156603-5-mreitz@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/passthrough_ll.c
tools/virtiofsd/passthrough_seccomp.c