From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1Gfm-000415-SI for qemu-devel@nongnu.org; Tue, 24 Nov 2015 11:42:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1Gfl-0006kM-UL for qemu-devel@nongnu.org; Tue, 24 Nov 2015 11:42:30 -0500 References: <9b87e09d61019c128139b6c999ed0c07f0674170.1448367341.git.berto@igalia.com> From: John Snow Message-ID: <5654936F.2070008@redhat.com> Date: Tue, 24 Nov 2015 11:42:23 -0500 MIME-Version: 1.0 In-Reply-To: <9b87e09d61019c128139b6c999ed0c07f0674170.1448367341.git.berto@igalia.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Peter Lieven , Stefan Hajnoczi , qemu-block@nongnu.org On 11/24/2015 07:17 AM, Alberto Garcia wrote: > Commit 5f81724d made PIO read requests async but didn't add the > relevant block_acct_failed() and block_acct_invalid() calls. > > Signed-off-by: Alberto Garcia > --- > hw/ide/atapi.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c > index 7b9f74c..5e3791c 100644 > --- a/hw/ide/atapi.c > +++ b/hw/ide/atapi.c > @@ -148,17 +148,18 @@ static void cd_read_sector_cb(void *opaque, int ret) > { > IDEState *s = opaque; > > - block_acct_done(blk_get_stats(s->blk), &s->acct); > - > #ifdef DEBUG_IDE_ATAPI > printf("cd_read_sector_cb: lba=%d ret=%d\n", s->lba, ret); > #endif > > if (ret < 0) { > + block_acct_failed(blk_get_stats(s->blk), &s->acct); > ide_atapi_io_error(s, ret); > return; > } > > + block_acct_done(blk_get_stats(s->blk), &s->acct); > + > if (s->cd_sector_size == 2352) { > cd_data_to_raw(s->io_buffer, s->lba); > } > @@ -173,6 +174,7 @@ static void cd_read_sector_cb(void *opaque, int ret) > static int cd_read_sector(IDEState *s) > { > if (s->cd_sector_size != 2048 && s->cd_sector_size != 2352) { > + block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_READ); > return -EINVAL; > } > > Gah, sorry. I should have caught this during the merge. Thank you for catching it. Reviewed-by: John Snow I'll send the PR. --js