lvm2/0092-vdo-check-memory-only-in-non-critical-section.patch

39 lines
1.3 KiB
Diff
Raw Normal View History

From 71c8df45c7d7efddad66e379d492b6f92cdfb4b9 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Tue, 10 Jan 2023 21:12:22 +0100
Subject: [PATCH 092/115] vdo: check memory only in non critical section
When we are actually resizing VDO device - we need to check size only in
non-critical section - otherwise we are checking
(cherry picked from commit 773b88e028ab2965a8c185f5f2147334f8f2bbfd)
---
lib/vdo/vdo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c
index 9efb424f0..d2d14d146 100644
--- a/lib/vdo/vdo.c
+++ b/lib/vdo/vdo.c
@@ -23,6 +23,7 @@
#include "lib/metadata/metadata.h"
#include "lib/metadata/lv_alloc.h"
#include "lib/metadata/segtype.h"
+#include "lib/mm/memlock.h"
#include "base/memory/zalloc.h"
static const char _vdo_module[] = MODULE_NAME_VDO;
@@ -374,7 +375,8 @@ static int _vdo_pool_add_target_line(struct dev_manager *dm,
return 0;
}
- if (!check_vdo_constrains(cmd, seg->lv->size, seg_lv(seg, 0)->size, &seg->vdo_params))
+ if (!critical_section() &&
+ !check_vdo_constrains(cmd, seg->lv->size, get_vdo_pool_virtual_size(seg), &seg->vdo_params))
return_0;
if (!(vdo_pool_name = dm_build_dm_name(mem, seg->lv->vg->name, seg->lv->name, lv_layer(seg->lv))))
--
2.41.0