diff mbox

ide: only constrain read/write requests to drive size, not other types

Message ID 1407914611-10516-1-git-send-email-mjt@msgid.tls.msk.ru
State New
Headers show

Commit Message

Michael Tokarev Aug. 13, 2014, 7:23 a.m. UTC
Commit 58ac321135a introduced a check to ide dma processing which
constrains all requests to drive size.  However, apparently, some
valid requests (like TRIM) does not fit in this constraint, and
fails in 2.1.  So check the range only for reads and writes.

Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Markus Armbruster <armbru@redhat.com>

Comments

Stefan Hajnoczi Aug. 14, 2014, 9:20 a.m. UTC | #1
On Wed, Aug 13, 2014 at 11:23:31AM +0400, Michael Tokarev wrote:
> Commit 58ac321135a introduced a check to ide dma processing which
> constrains all requests to drive size.  However, apparently, some
> valid requests (like TRIM) does not fit in this constraint, and
> fails in 2.1.  So check the range only for reads and writes.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
diff mbox

Patch

diff --git a/hw/ide/core.c b/hw/ide/core.c
index db191a6..7256592 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -688,7 +688,8 @@  void ide_dma_cb(void *opaque, int ret)
            sector_num, n, s->dma_cmd);
 #endif
 
-    if (!ide_sect_range_ok(s, sector_num, n)) {
+    if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) &&
+        !ide_sect_range_ok(s, sector_num, n)) {
         dma_buf_commit(s);
         ide_dma_error(s);
         return;