diff mbox series

[for-5.0,v2,02/23] blockdev: Allow resizing everywhere

Message ID 20191111160216.197086-3-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: Fix check_to_replace_node() | expand

Commit Message

Max Reitz Nov. 11, 2019, 4:01 p.m. UTC
Block nodes that do not allow resizing should not share BLK_PERM_RESIZE.
It does not matter whether they are the first non-filter in their chain
or not.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 blockdev.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Alberto Garcia Dec. 6, 2019, 2:04 p.m. UTC | #1
On Mon 11 Nov 2019 05:01:55 PM CET, Max Reitz wrote:
> @@ -3177,11 +3177,6 @@ void qmp_block_resize(bool has_device, const char *device,
>      aio_context = bdrv_get_aio_context(bs);
>      aio_context_acquire(aio_context);
>  
> -    if (!bdrv_is_first_non_filter(bs)) {
> -        error_setg(errp, QERR_FEATURE_DISABLED, "resize");
> -        goto out;
> -    }
> -

What happens with this case now?

https://lists.gnu.org/archive/html/qemu-block/2019-11/msg00793.html

Berto
Max Reitz Dec. 9, 2019, 1:56 p.m. UTC | #2
On 06.12.19 15:04, Alberto Garcia wrote:
> On Mon 11 Nov 2019 05:01:55 PM CET, Max Reitz wrote:
>> @@ -3177,11 +3177,6 @@ void qmp_block_resize(bool has_device, const char *device,
>>      aio_context = bdrv_get_aio_context(bs);
>>      aio_context_acquire(aio_context);
>>  
>> -    if (!bdrv_is_first_non_filter(bs)) {
>> -        error_setg(errp, QERR_FEATURE_DISABLED, "resize");
>> -        goto out;
>> -    }
>> -
> 
> What happens with this case now?
> 
> https://lists.gnu.org/archive/html/qemu-block/2019-11/msg00793.html

As far as I understand, we have a bug there and we’ll fix it in 5.0.
It’s just that in one case, it wasn’t visible because resize wasn’t
allowed on some nodes (where I think it should actually be allowed,
hence this patch).

So I think we should allow resize on those nodes (this patch) and fix
the bug, and that should be fine then.

Max
diff mbox series

Patch

diff --git a/blockdev.c b/blockdev.c
index ab78230d23..9dc2238bf3 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3177,11 +3177,6 @@  void qmp_block_resize(bool has_device, const char *device,
     aio_context = bdrv_get_aio_context(bs);
     aio_context_acquire(aio_context);
 
-    if (!bdrv_is_first_non_filter(bs)) {
-        error_setg(errp, QERR_FEATURE_DISABLED, "resize");
-        goto out;
-    }
-
     if (size < 0) {
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "size", "a >0 size");
         goto out;