qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 1/5] block/io: fix bdrv_co_block_status_above


From: Alberto Garcia
Subject: Re: [PATCH v5 1/5] block/io: fix bdrv_co_block_status_above
Date: Tue, 18 Aug 2020 16:15:30 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Wed 10 Jun 2020 02:04:22 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
> +             * The top layer deferred to this layer, and because this layer 
> is
> +             * short, any zeroes that we synthesize beyond EOF behave as if 
> they
> +             * were allocated at this layer
>               */
> +            assert(ret & BDRV_BLOCK_EOF);
>              *pnum = bytes;
> +            if (file) {
> +                *file = p;
> +            }
> +            return BDRV_BLOCK_ZERO | BDRV_BLOCK_ALLOCATED;

You don't add BDRV_BLOCK_EOF to the return code here ?

> +        res = bdrv_block_status_above(bs, NULL, offset, bytes, &nr, NULL, 
> NULL);
> +        offset += nr;
> +        bytes -= nr;
> +    } while (res >= 0 && (res & BDRV_BLOCK_ZERO) && nr && bytes);

About this last "... && nr && bytes", I think 'nr' already implies
'bytes', maybe you want to use an assertion instead?

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]