1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Unlock memory for vg_write

For write we do not need to hold memory locked.
This relaxes many conditions and avoid problems when allocating
a lot of memory for writting metadata buffers.
(In case of huge MDA size this would lead to mismatch between
locked and unlocked memory region size).

Add also internal check we are not writing in critical section.
This commit is contained in:
Zdenek Kabelac 2011-11-18 19:28:00 +00:00
parent 37f274ced9
commit 8deeeb07ea
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
Unlock memory before writing metadata.
Add query before removing snapshots when inactive snapshot origin is removed.
Allow changing availability state of snapshots.
Skip non-virtual snapshots for availability change for lvchange with vg name.

View File

@ -2573,6 +2573,12 @@ int vg_write(struct volume_group *vg)
return 0;
}
if (critical_section())
log_error(INTERNAL_ERROR
"Writing metadata in critical section.");
/* Unlock memory if possible */
memlock_unlock(vg->cmd);
vg->seqno++;
dm_list_iterate_items(pv_to_create, &vg->pvs_to_create) {