block: Fix handling of image enlarging write
commit7f8f03ef6d5c82fee1c22be06fc9de4a16ad7059
authorFam Zheng <famz@redhat.com>
Tue, 10 Jul 2018 06:31:20 +0000 (10 14:31 +0800)
committerKevin Wolf <kwolf@redhat.com>
Tue, 10 Jul 2018 14:01:52 +0000 (10 16:01 +0200)
tree611c0b6972c8b24f6a45fd8e6762de92c27afbbd
parent85fe24796ddf70f2b6a5045952826aedffa55ca2
block: Fix handling of image enlarging write

Two problems exist when a write request that enlarges the image (i.e.
write beyond EOF) finishes:

1) parent is not notified about size change;
2) dirty bitmap is not resized although we try to set the dirty bits;

Fix them just like how bdrv_co_truncate works.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c