[Drbd-dev] lock for reading device state

Cristian Zamfir zamf at dcs.gla.ac.uk
Wed Dec 6 18:22:43 CET 2006


I am using drbd to implement xen block device migration.  Right now I am 
parsing /proc/drbd to find out if the drives are synchronized and I can 
migrate them. Is there a way to obtain a lock while reading and 
processing this information and prevent other writes to the primary 
device? I need to be able to prevent writes while reading the state of 
the device from a script external to drbd.

In case there is no existing solution, can you please give me a few tips 
on how to start developing such a locking mechanism?

Thank you very much.


More information about the drbd-dev mailing list