All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - vdo: check memory only in non critical section
Date: Mon, 16 Jan 2023 11:39:12 +0000 (GMT)	[thread overview]
Message-ID: <20230116113912.EDD713858D33@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=773b88e028ab2965a8c185f5f2147334f8f2bbfd
Commit:        773b88e028ab2965a8c185f5f2147334f8f2bbfd
Parent:        f486eb60d5cfb72f084b9e2c02e4dc962f26bb69
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Jan 10 21:12:22 2023 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Jan 16 12:37:38 2023 +0100

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
---
 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))))


                 reply	other threads:[~2023-01-16 11:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230116113912.EDD713858D33@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.