On 11/17/2011 12:36 PM, Chunyan Liu wrote:
Adding lock to the nbd device before connecting disk image to that device to handling race conditions.
This removes the possibility for other programs to lock. Have you checked what happens if you use the same device twice and whether you can piggyback on e.g. an EBUSY from the NBD_SET_SOCK ioctl?
Paolo