[Qemu-devel] [PATCH v5 0/3] Fix overflow bug in qcow2 discard

Vladimir Sementsov-Ogievskiy posted 3 patches 5 years ago
Test checkpatch passed
Test asan passed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190423125706.26989-1-vsementsov@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Max Reitz <mreitz@redhat.com>, Fam Zheng <fam@euphon.net>
include/block/block.h      |  4 +--
block/io.c                 | 16 ++++-----
block/qcow2-refcount.c     |  7 +++-
block/trace-events         |  3 ++
tests/qemu-iotests/250     | 73 ++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/250.out | 23 ++++++++++++
tests/qemu-iotests/group   |  1 +
7 files changed, 116 insertions(+), 11 deletions(-)
create mode 100755 tests/qemu-iotests/250
create mode 100644 tests/qemu-iotests/250.out
[Qemu-devel] [PATCH v5 0/3] Fix overflow bug in qcow2 discard
Posted by Vladimir Sementsov-Ogievskiy 5 years ago
v5: by Kevin's comments
02: add check for invalid @bytes parameter, drop r-b
03: move from qemu-img info to qemu-img map -f raw, drop r-b and t-b

Vladimir Sementsov-Ogievskiy (3):
  block/qcow2-refcount: add trace-point to qcow2_process_discards
  block/io: bdrv_pdiscard: support int64_t bytes parameter
  iotests: test big qcow2 shrink

 include/block/block.h      |  4 +--
 block/io.c                 | 16 ++++-----
 block/qcow2-refcount.c     |  7 +++-
 block/trace-events         |  3 ++
 tests/qemu-iotests/250     | 73 ++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/250.out | 23 ++++++++++++
 tests/qemu-iotests/group   |  1 +
 7 files changed, 116 insertions(+), 11 deletions(-)
 create mode 100755 tests/qemu-iotests/250
 create mode 100644 tests/qemu-iotests/250.out

-- 
2.18.0


Re: [Qemu-devel] [PATCH v5 0/3] Fix overflow bug in qcow2 discard
Posted by Kevin Wolf 4 years, 10 months ago
Am 23.04.2019 um 14:57 hat Vladimir Sementsov-Ogievskiy geschrieben:
> v5: by Kevin's comments
> 02: add check for invalid @bytes parameter, drop r-b
> 03: move from qemu-img info to qemu-img map -f raw, drop r-b and t-b

The patches look good to me, but the test case fails (this is on XFS; it
does work on tmpfs):

--- /home/kwolf/source/qemu/tests/qemu-iotests/250.out  2019-06-03 15:22:51.212961123 +0200
+++ /home/kwolf/source/qemu/tests/qemu-iotests/250.out.bad      2019-06-03 15:37:37.202959101 +0200
@@ -12,12 +12,10 @@
 0               0xa00000        0x82f00000      TEST_DIR/t.qcow2
 0x82a00000      0xa00000        0x500000        TEST_DIR/t.qcow2
 Offset          Length          Mapped to       File
-0               0x301000        0               TEST_DIR/t.qcow2
-0x400000        0xb00000        0x400000        TEST_DIR/t.qcow2
+0               0xf00000        0               TEST_DIR/t.qcow2
 0x82f00000      0xa00000        0x82f00000      TEST_DIR/t.qcow2
 Image resized.
 Offset          Length          Mapped to       File
-0               0x301000        0               TEST_DIR/t.qcow2
-0x400000        0x100000        0x400000        TEST_DIR/t.qcow2
+0               0x500000        0               TEST_DIR/t.qcow2
 0x82f00000      0x500000        0x82f00000      TEST_DIR/t.qcow2
 *** done

I'll apply the first two patches without the test for now, but please
try if you can tweak the test case to work on all common filesystems.

Kevin

Re: [Qemu-devel] [PATCH v5 0/3] Fix overflow bug in qcow2 discard
Posted by Vladimir Sementsov-Ogievskiy 4 years, 10 months ago
03.06.2019 16:40, Kevin Wolf wrote:
> Am 23.04.2019 um 14:57 hat Vladimir Sementsov-Ogievskiy geschrieben:
>> v5: by Kevin's comments
>> 02: add check for invalid @bytes parameter, drop r-b
>> 03: move from qemu-img info to qemu-img map -f raw, drop r-b and t-b
> 
> The patches look good to me, but the test case fails (this is on XFS; it
> does work on tmpfs):
> 
> --- /home/kwolf/source/qemu/tests/qemu-iotests/250.out  2019-06-03 15:22:51.212961123 +0200
> +++ /home/kwolf/source/qemu/tests/qemu-iotests/250.out.bad      2019-06-03 15:37:37.202959101 +0200
> @@ -12,12 +12,10 @@
>   0               0xa00000        0x82f00000      TEST_DIR/t.qcow2
>   0x82a00000      0xa00000        0x500000        TEST_DIR/t.qcow2
>   Offset          Length          Mapped to       File
> -0               0x301000        0               TEST_DIR/t.qcow2
> -0x400000        0xb00000        0x400000        TEST_DIR/t.qcow2
> +0               0xf00000        0               TEST_DIR/t.qcow2
>   0x82f00000      0xa00000        0x82f00000      TEST_DIR/t.qcow2
>   Image resized.
>   Offset          Length          Mapped to       File
> -0               0x301000        0               TEST_DIR/t.qcow2
> -0x400000        0x100000        0x400000        TEST_DIR/t.qcow2
> +0               0x500000        0               TEST_DIR/t.qcow2
>   0x82f00000      0x500000        0x82f00000      TEST_DIR/t.qcow2
>   *** done
> 
> I'll apply the first two patches without the test for now, but please
> try if you can tweak the test case to work on all common filesystems.
> 
> Kevin
> 

Thank you! OK, I'll try

-- 
Best regards,
Vladimir
Re: [Qemu-devel] [PATCH v5 0/3] Fix overflow bug in qcow2 discard
Posted by Vladimir Sementsov-Ogievskiy 4 years, 11 months ago
ping

23.04.2019 15:57, Vladimir Sementsov-Ogievskiy wrote:
> v5: by Kevin's comments
> 02: add check for invalid @bytes parameter, drop r-b
> 03: move from qemu-img info to qemu-img map -f raw, drop r-b and t-b
> 
> Vladimir Sementsov-Ogievskiy (3):
>    block/qcow2-refcount: add trace-point to qcow2_process_discards
>    block/io: bdrv_pdiscard: support int64_t bytes parameter
>    iotests: test big qcow2 shrink
> 
>   include/block/block.h      |  4 +--
>   block/io.c                 | 16 ++++-----
>   block/qcow2-refcount.c     |  7 +++-
>   block/trace-events         |  3 ++
>   tests/qemu-iotests/250     | 73 ++++++++++++++++++++++++++++++++++++++
>   tests/qemu-iotests/250.out | 23 ++++++++++++
>   tests/qemu-iotests/group   |  1 +
>   7 files changed, 116 insertions(+), 11 deletions(-)
>   create mode 100755 tests/qemu-iotests/250
>   create mode 100644 tests/qemu-iotests/250.out
> 


-- 
Best regards,
Vladimir
[Qemu-devel] ping Re: [PATCH v5 0/3] Fix overflow bug in qcow2 discard
Posted by Vladimir Sementsov-Ogievskiy 4 years, 10 months ago
ping 21.05.2019 12:38, Vladimir Sementsov-Ogievskiy wrote:
> ping
> 
> 23.04.2019 15:57, Vladimir Sementsov-Ogievskiy wrote:
>> v5: by Kevin's comments
>> 02: add check for invalid @bytes parameter, drop r-b
>> 03: move from qemu-img info to qemu-img map -f raw, drop r-b and t-b
>>
>> Vladimir Sementsov-Ogievskiy (3):
>>    block/qcow2-refcount: add trace-point to qcow2_process_discards
>>    block/io: bdrv_pdiscard: support int64_t bytes parameter
>>    iotests: test big qcow2 shrink
>>
>>   include/block/block.h      |  4 +--
>>   block/io.c                 | 16 ++++-----
>>   block/qcow2-refcount.c     |  7 +++-
>>   block/trace-events         |  3 ++
>>   tests/qemu-iotests/250     | 73 ++++++++++++++++++++++++++++++++++++++
>>   tests/qemu-iotests/250.out | 23 ++++++++++++
>>   tests/qemu-iotests/group   |  1 +
>>   7 files changed, 116 insertions(+), 11 deletions(-)
>>   create mode 100755 tests/qemu-iotests/250
>>   create mode 100644 tests/qemu-iotests/250.out
>>
> 
> 


-- 
Best regards,
Vladimir