[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] block: assert that permission commit sets same permissio
From: |
Max Reitz |
Subject: |
Re: [PATCH 2/2] block: assert that permission commit sets same permissions |
Date: |
Thu, 5 Nov 2020 15:34:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 |
On 31.10.20 13:35, Vladimir Sementsov-Ogievskiy wrote:
On permission update commit we must set same permissions as on _check_.
Let's add assertions. Next step may be to drop permission parameters
from _set_.
Note that prior to previous commit, fixing bdrv_drop_intermediate(),
new assertion in bdrv_child_set_perm() crashes on iotests 30 and 40.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index bd9f4e534b..0f4da59a6c 100644
--- a/block.c
+++ b/block.c
[...]
@@ -2301,6 +2306,8 @@ static void bdrv_child_set_perm(BdrvChild *c, uint64_t
perm, uint64_t shared)
c->has_backup_perm = false;
+ assert(c->perm == perm);
+ assert(c->shared_perm == shared);
c->perm = perm;
c->shared_perm = shared;
Then we can drop the assignments, no?
(And, as you write, in the future potentially drop the parameters.)
Anyway:
Reviewed-by: Max Reitz <mreitz@redhat.com>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 2/2] block: assert that permission commit sets same permissions,
Max Reitz <=