|
From: | Mark Wu |
Subject: | Re: [Qemu-devel] [PATCH] qed: limit to image size in qed_find_cluster() |
Date: | Tue, 29 Nov 2011 13:01:52 +0800 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110927 Red Hat/3.1.15-1.el6_1 Thunderbird/3.1.15 |
On 11/29/2011 12:18 AM, Stefan Hajnoczi wrote:
It seems the same problem exists in qcow/qcow2, why do we not add the limit in bdrv_is_allocated? Then it can cover all formats.Callers of bdrv_is_allocated() may go beyond the end of the image. For general robustness we should limit to the end of the image so that callers don't end up using out-of-range sector counts and receive -EIO.
Actually, I can't figure out how the caller can go beyond the end of the image. If the I/O request for sectors beyond image size comes from guest, it should be dropped in the guest block layer. If the request comes from qemu, like block streaming, it should also honor the image size, right?
Mark.
[Prev in Thread] | Current Thread | [Next in Thread] |