[Virtio-fs] [RFC] Duplicate submounts in the guest

Max Reitz mreitz at redhat.com
Fri May 8 07:31:47 UTC 2020


On 07.05.20 22:53, Vivek Goyal wrote:
> On Wed, May 06, 2020 at 05:32:58PM +0200, Max Reitz wrote:
>> Hi,
>>
>> This RFC consists of two patch series, one for virtiofsd (i.e., to be
>> applied to the qemu repo), and one for Linux.
>>
>> The problem it wants to solve is that virtiofsd just passes through the
>> stat.st_ino value from the host to the guest, without taking stat.st_dev
>> into account.  Therefore, it is generally impossible to uniquely
>> identify nodes in the guest by their st_dev/st_ino combinations.
>>
>> One way to fix this would be to derive some algorithm to derive a unique
>> st_ino value from the st_dev/st_ino combination on the host, but this is
>> not always possible.
>>
>> So what this series does it basically passing through st_dev alongside
>> st_ino: We can let the guest create auto-mounted submounts for every
>> host mount point, so that they get their own dedicated st_dev.  This is
>> similar to what NFS does with the crossmnt option.
>>
>> Announcing submounts to the guest (the FUSE client) is done by the FUSE
>> server (virtiofsd) of setting st_rdev to a non-zero value (e.g. st_dev)
>> for every mount point.
>>
>> In this version here, duplicate mounts on the host (same st_dev) will
>> not necessarily have the same st_dev in the guest.  That would be more
>> complicated to implement, and there is probably no real need to.
> 
> Hi Max,
> 
> What's duplicate mount. Is it two bind bounts created from same
> filesystem.

For example; or the same filesystem from the same device twice
(mount /dev/loop0 a; mount /dev/loop0 b).

> So two bind mounts which have same st_dev on host, will appear to come
> from two different devices in guest (different st_dev), right?

Yes.

Max

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/virtio-fs/attachments/20200508/562025f0/attachment.sig>


More information about the Virtio-fs mailing list