[Devel] [PATCH RHEL8 COMMIT] cbt: Move cbt_flush_cache() before size calculation
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Dec 10 18:48:57 MSK 2019
The commit is pushed to "branch-rh8-4.18.0-80.1.2.vz8.2.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-80.1.2.vz8.2.6
------>
commit b9a0642e693d04884697a49ae4abc232c1eba2f7
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Tue Dec 10 18:48:31 2019 +0300
cbt: Move cbt_flush_cache() before size calculation
Flush cpu caches before searching of last bit,
otherwise we may miss some set bits.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
block/blk-cbt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/blk-cbt.c b/block/blk-cbt.c
index dddac68b61b4..171d3b5869b4 100644
--- a/block/blk-cbt.c
+++ b/block/blk-cbt.c
@@ -407,14 +407,14 @@ static int blk_cbt_snap_create(struct request_queue *q, __u8 *uuid,
return -EBUSY;
}
+ cbt_flush_cache(cbt);
+
size = map_required_size(cbt->map, cbt->block_max);
if (to_size < size) {
mutex_unlock(&cbt_mutex);
return -EFBIG;
}
- cbt_flush_cache(cbt);
-
npages = NR_PAGES(cbt->block_max);
map = vmalloc(npages * sizeof(void*));
if (!map)
More information about the Devel
mailing list