]> sourceware.org Git - lvm2.git/commitdiff
Unlock memory for vg_write
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 18 Nov 2011 19:28:00 +0000 (19:28 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 18 Nov 2011 19:28:00 +0000 (19:28 +0000)
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.

WHATS_NEW
lib/metadata/metadata.c

index 6fd7414e1eb2f4b9255023c4e7a810c6ce1da491..169beee2ee43b9bdf748b7eeca288d59bce6264e 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
index 4037c0e6fe0011e40458ade1e78cc029ee07a020..7ab06c0bdc1eeba22d44476f895a61fdbf9945da 100644 (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) {
This page took 0.043002 seconds and 5 git commands to generate.