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

Re: [libvirt] [PATCHv2] Don't allow two or more disks to be mapped to the same image file



On 03/24/2011 02:46 AM, Hu Tao wrote:
> If two or more disks are mapped to the same image file, operating
> on these disks at the same time may corrupt data stored in the
> image file.
> 
> changes:
> 
> v2:
> 
> - allow it for read-only disks
> - compare source files by inode number
> 
> +
> +    if (stat(disk->src, &stat1)) {
> +        if (errno != ENOENT) {
> +            /* Can't stat file, for safety treate it as conflicted */

s/treate/treat/

Won't this will fail on root-squash NFS from qemu:///system?  (Or does
root-squash meant that root can still stat() but just not open() a file?)

Overall, I'm worried that this patch is repeating some of danpb's bigger
efforts to integrate a sanlock disk contention avoidance [1].  If a
resource manager is properly hooked to all disks, then we can prevent
contention between domains (and not limit ourself to just single-domain
contention, as in this patch).  On the other hand, this seems like an
easy enough check to do for a single domain whether or not we get the
sanlock code completed (that is, timing wise this looks like it could be
ready prior to 0.9.0 while Dan's work is bigger in scope and probably
missed the feature freeze for this month's release).  So I'm not sure
whether to ack this.

[1] https://www.redhat.com/archives/libvir-list/2011-January/msg00963.html

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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