[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Is using w! safe to share data between domains?



Your scheme has a race condition in it. Suppose that a partition has opened sda3 read-only and right between after seeing the tag-file doesn't exist and re-mounting the partition, someone else comes in and creates the tag file. You know have to partitions that have followed your rules and have simultaneously opened the partition read-write.

Even if you eliminated the race condition, in general, it's probably not a good idea to open a file system (even if it's read-only) while someone else has it open read-write. There's no guarantee the meta-data is going to be in a consistent state.

Your best bet is probably to use networking to share data between partitions.

Regards,

Anthony Liguori
John A. Sullivan III wrote:

I have a slightly unusual situation where I need to pass data from one
domain to another but, for security reasons, one of the domains will not
be on the network.  I would like to pass the data via a shared disk
partition.  I would like to know if what I have done is safe.

I created a disk partition named /dev/VG1/pkipass.
Each domU disk definition contains: 'phy:VG1/pkipass,sda3,w!'
None of the domUs automatically mounts this device.

When one domU needs to deposit data for another domU to pick up (this
exchange is always a manual effort to first deposit the shared data and
then retrieve the shared data), we do the following:

The depositing domU mounts sda3 read-only.
It looks for a tag file -- this tag file is created when a domU has
mounted the partition as read-write
If the tag-file exists {
        it unmounts the partition
        it sleeps briefly
        it retries
}
else {
        it remounts the partition read-write
        it creates the tag file
        it deposits the data
        it deletes the tag fie
        it unmounts the partition
}

A similar process is used to retrieve the data.

Is this safe?

Thanks - John


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.