All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Peter Lieven <pl@kamp.de>, Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()
Date: Tue, 24 Nov 2015 11:42:23 -0500	[thread overview]
Message-ID: <5654936F.2070008@redhat.com> (raw)
In-Reply-To: <9b87e09d61019c128139b6c999ed0c07f0674170.1448367341.git.berto@igalia.com>



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 <berto@igalia.com>
> ---
>  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 <jsnow@redhat.com>

I'll send the PR.

--js

      parent reply	other threads:[~2015-11-24 16:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 12:17 [Qemu-devel] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector() Alberto Garcia
2015-11-24 12:18 ` [Qemu-devel] [PATCH for-2.5 2/2] atapi: Fix code indentation Alberto Garcia
2015-11-24 12:47 ` [Qemu-devel] [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector() Kevin Wolf
2015-11-24 12:52   ` Alberto Garcia
2015-11-24 13:13     ` Kevin Wolf
2015-11-24 16:42 ` John Snow [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5654936F.2070008@redhat.com \
    --to=jsnow@redhat.com \
    --cc=berto@igalia.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.