mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
locking: memory locking ONLY with suspending reason
It's important to lock memory beforo running SUSPEND ioctl - but whole lvm preload runs in memory unlocked environment - as in this phase memory allocation is allowed and is meant to happen. Once all targets are preload and ready (confirmed from all targets) we start suspending tree - and here the memory allocation (or i.e. opening files) is no longer allowed - as it may cause kernel deadlock.
This commit is contained in:
parent
b55d30956d
commit
0bae9a1bff
@ -604,8 +604,7 @@ static void _unlock_mem_if_possible(struct cmd_context *cmd)
|
||||
void critical_section_inc(struct cmd_context *cmd, const char *reason)
|
||||
{
|
||||
if (!_critical_section &&
|
||||
((strcmp(reason, "suspending") == 0) ||
|
||||
(strcmp(reason, "locking for suspend") == 0))) {
|
||||
(strcmp(reason, "suspending") == 0)) {
|
||||
/*
|
||||
* Profiles are loaded on-demand so make sure that before
|
||||
* entering the critical section all needed profiles are
|
||||
|
Loading…
Reference in New Issue
Block a user