qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
@ 2017-07-10  8:35 Denis V. Lunev
  2017-07-10  8:56 ` Fam Zheng
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Denis V. Lunev @ 2017-07-10  8:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, Denis V. Lunev, Stefan Hajnoczi, Fam Zheng

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)
---
 block/io.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index ed31810c0a..e5c6dc77d3 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2464,7 +2464,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
     assert(max_pdiscard >= bs->bl.request_alignment);
 
     while (count > 0) {
-        int ret;
         int num = count;
 
         if (head) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
  2017-07-10  8:35 [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard Denis V. Lunev
@ 2017-07-10  8:56 ` Fam Zheng
  2017-07-10  8:59   ` Denis V. Lunev
  2017-07-10 13:51 ` Eric Blake
  2017-07-10 13:59 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  2 siblings, 1 reply; 7+ messages in thread
From: Fam Zheng @ 2017-07-10  8:56 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: qemu-devel, Stefan Hajnoczi, qemu-block

On Mon, 07/10 11:35, Denis V. Lunev wrote:
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
> CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)

Maybe use "--noroles"?  The parenthesis part is not really useful.

> ---
>  block/io.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/io.c b/block/io.c
> index ed31810c0a..e5c6dc77d3 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -2464,7 +2464,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
>      assert(max_pdiscard >= bs->bl.request_alignment);
>  
>      while (count > 0) {
> -        int ret;
>          int num = count;
>  
>          if (head) {
> -- 
> 2.11.0
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
  2017-07-10  8:56 ` Fam Zheng
@ 2017-07-10  8:59   ` Denis V. Lunev
  0 siblings, 0 replies; 7+ messages in thread
From: Denis V. Lunev @ 2017-07-10  8:59 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, Stefan Hajnoczi, qemu-block

On 07/10/2017 11:56 AM, Fam Zheng wrote:
> On Mon, 07/10 11:35, Denis V. Lunev wrote:
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
>> CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)
> Maybe use "--noroles"?  The parenthesis part is not really useful.
good thing. May be this should be default. I have missed to clear
that at commit stage.

Den

>> ---
>>  block/io.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/block/io.c b/block/io.c
>> index ed31810c0a..e5c6dc77d3 100644
>> --- a/block/io.c
>> +++ b/block/io.c
>> @@ -2464,7 +2464,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
>>      assert(max_pdiscard >= bs->bl.request_alignment);
>>  
>>      while (count > 0) {
>> -        int ret;
>>          int num = count;
>>  
>>          if (head) {
>> -- 
>> 2.11.0
>>
>>
> Reviewed-by: Fam Zheng <famz@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
  2017-07-10  8:35 [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard Denis V. Lunev
  2017-07-10  8:56 ` Fam Zheng
@ 2017-07-10 13:51 ` Eric Blake
  2017-07-10 14:31   ` Denis V. Lunev
  2017-07-10 13:59 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  2 siblings, 1 reply; 7+ messages in thread
From: Eric Blake @ 2017-07-10 13:51 UTC (permalink / raw)
  To: Denis V. Lunev, qemu-devel
  Cc: Fam Zheng, Stefan Hajnoczi, qemu-block, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

On 07/10/2017 03:35 AM, Denis V. Lunev wrote:
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
> CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)

The commit message is a bit sparse; I might have written:

block: fix shadowed variable in bdrv_co_pdiscard

We've had a shadowed 'ret' variable, which risks returning the wrong
value, introduced in commit b9c64947.

> ---
>  block/io.c | 1 -
>  1 file changed, 1 deletion(-)

Adding qemu-stable in cc, and you can add:
Reviewed-by: Eric Blake <eblake@redhat.com>

[and I wonder why gcc doesn't flag the shadowed variable for me - I
definitely touched that code in commit 9f1963b3, but didn't notice that
I kept the shadowing in place.  I guess we don't have that compiler
warning flag turned on for default configuration]

> 
> diff --git a/block/io.c b/block/io.c
> index ed31810c0a..e5c6dc77d3 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -2464,7 +2464,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
>      assert(max_pdiscard >= bs->bl.request_alignment);
>  
>      while (count > 0) {
> -        int ret;
>          int num = count;
>  
>          if (head) {
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
  2017-07-10  8:35 [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard Denis V. Lunev
  2017-07-10  8:56 ` Fam Zheng
  2017-07-10 13:51 ` Eric Blake
@ 2017-07-10 13:59 ` Kevin Wolf
  2017-07-10 14:31   ` Denis V. Lunev
  2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2017-07-10 13:59 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: qemu-devel, Fam Zheng, Stefan Hajnoczi, qemu-block

Am 10.07.2017 um 10:35 hat Denis V. Lunev geschrieben:
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
> CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)
> ---
>  block/io.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/io.c b/block/io.c
> index ed31810c0a..e5c6dc77d3 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -2464,7 +2464,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
>      assert(max_pdiscard >= bs->bl.request_alignment);
>  
>      while (count > 0) {
> -        int ret;
>          int num = count;
>  
>          if (head) {

Good catch, and the fix looks fine.

This needs rebasing, though (conflicts with commit f5a5ca7 'block:
change variable names in BlockDriverState').

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
  2017-07-10 13:51 ` Eric Blake
@ 2017-07-10 14:31   ` Denis V. Lunev
  0 siblings, 0 replies; 7+ messages in thread
From: Denis V. Lunev @ 2017-07-10 14:31 UTC (permalink / raw)
  To: Eric Blake, qemu-devel
  Cc: Fam Zheng, Stefan Hajnoczi, qemu-block, qemu-stable

On 07/10/2017 04:51 PM, Eric Blake wrote:
> On 07/10/2017 03:35 AM, Denis V. Lunev wrote:
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
>> CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)
> The commit message is a bit sparse; I might have written:
>
> block: fix shadowed variable in bdrv_co_pdiscard
>
> We've had a shadowed 'ret' variable, which risks returning the wrong
> value, introduced in commit b9c64947.
thank you for the proposal.

Den

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard
  2017-07-10 13:59 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
@ 2017-07-10 14:31   ` Denis V. Lunev
  0 siblings, 0 replies; 7+ messages in thread
From: Denis V. Lunev @ 2017-07-10 14:31 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Fam Zheng, Stefan Hajnoczi, qemu-block

On 07/10/2017 04:59 PM, Kevin Wolf wrote:
> Am 10.07.2017 um 10:35 hat Denis V. Lunev geschrieben:
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Stefan Hajnoczi <stefanha@redhat.com> (supporter:Block I/O path)
>> CC: Fam Zheng <famz@redhat.com> (supporter:Block I/O path)
>> ---
>>  block/io.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/block/io.c b/block/io.c
>> index ed31810c0a..e5c6dc77d3 100644
>> --- a/block/io.c
>> +++ b/block/io.c
>> @@ -2464,7 +2464,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
>>      assert(max_pdiscard >= bs->bl.request_alignment);
>>  
>>      while (count > 0) {
>> -        int ret;
>>          int num = count;
>>  
>>          if (head) {
> Good catch, and the fix looks fine.
>
> This needs rebasing, though (conflicts with commit f5a5ca7 'block:
> change variable names in BlockDriverState').
>
> Kevin
ok, will re-spin.

Den

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-10 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10  8:35 [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard Denis V. Lunev
2017-07-10  8:56 ` Fam Zheng
2017-07-10  8:59   ` Denis V. Lunev
2017-07-10 13:51 ` Eric Blake
2017-07-10 14:31   ` Denis V. Lunev
2017-07-10 13:59 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-07-10 14:31   ` Denis V. Lunev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).