]> sourceware.org Git - lvm2.git/commitdiff
Resume volumes in reverse order to preserve memlock pairing.
authorMilan Broz <mbroz@redhat.com>
Tue, 5 Jan 2010 15:58:11 +0000 (15:58 +0000)
committerMilan Broz <mbroz@redhat.com>
Tue, 5 Jan 2010 15:58:11 +0000 (15:58 +0000)
If renaming snapshot with virtual origin, the origin is renamed too.
But the code must resume LVs in reverse order to properly
pair memlock (in cluster locking).

(The resume of snapshot resumes origin too and later resume
is ignored otherwise.)

WHATS_NEW
lib/metadata/lv_manip.c

index 1e984273c58ddf737352981245ba39e4439e54c9..8d2588f70cb15893af164e3d981ccd001498d8c9 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Resume renamed volumes in reverse order to preserve memlock pairing.
   Drop metadata cache after device was autorepaired and removed from VG.
   Remove missing flag in metadata if PV reappeared and is empty.
   Destroy allocated mempool in _vg_read_orphans() error path.
index 7a0171e9cdf58b1cbd4f4f603c0fac5922264565..84ad6390434d13ae220ff28d9df168a606b0f5dd 100644 (file)
@@ -1767,7 +1767,7 @@ int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
        struct volume_group *vg = lv->vg;
        struct lv_names lv_names;
        DM_LIST_INIT(lvs_changed);
-       struct lv_list lvl, lvl2;
+       struct lv_list lvl, lvl2, *lvlp;
        int r = 0;
 
        /* rename is not allowed on sub LVs */
@@ -1822,7 +1822,13 @@ int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
        if (!(r = vg_commit(vg)))
                stack;
 
-       resume_lvs(cmd, &lvs_changed);
+       /*
+        * FIXME: resume LVs in reverse order to prevent memory
+        * lock imbalance when resuming virtual snapshot origin
+        * (resume of snapshot resumes origin too)
+        */
+       dm_list_iterate_back_items(lvlp, &lvs_changed)
+               resume_lv(cmd, lvlp->lv);
 out:
        backup(vg);
        return r;
This page took 0.049593 seconds and 5 git commands to generate.