From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X35pX-0000cx-1g for qemu-devel@nongnu.org; Fri, 04 Jul 2014 11:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X35pP-0005wD-3X for qemu-devel@nongnu.org; Fri, 04 Jul 2014 11:55:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X35pO-0005tf-RQ for qemu-devel@nongnu.org; Fri, 04 Jul 2014 11:55:11 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s64Ft9mg020413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 4 Jul 2014 11:55:09 -0400 From: Kevin Wolf Date: Fri, 4 Jul 2014 17:55:01 +0200 Message-Id: <1404489305-8750-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] block: Fix qiov sizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com Some callers use larger qiovs than nb_sectors for their read requests. This is bad because raw-posix uses nb_sectors to allocate a bounce buffer and then copies the whole iov over. This series fixes some more cases (mirroring was already fixed earlier this week) and adds assertions to catch any other offenders. Kevin Wolf (4): block: Make qiov match the request size until EOF qcow2: Make qiov match request size until backing file EOF qed: Make qiov match request size until backing file EOF block: Assert qiov length matches request length block.c | 13 ++++++++++++- block/qcow2.c | 11 ++++++++++- block/qed.c | 26 +++++++++++++++++++++++--- block/qed.h | 1 + block/raw-posix.c | 15 +++++++++++---- 5 files changed, 57 insertions(+), 9 deletions(-) -- 1.8.3.1