]> sourceware.org Git - lvm2.git/commitdiff
vdo: deactivate forgotten vdo pool
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 30 Sep 2019 11:22:42 +0000 (13:22 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 30 Sep 2019 11:34:34 +0000 (13:34 +0200)
If the linear mapping is lost (for whatever reason, i.e.
test suite forcible  'dmsetup remove' linear LV,
lvm2 had hard times figuring out how to deactivate such DM table.

So add function which is in case inactive VDO pool LV checks if
the pool is actually still active (-vpool device present) and
it has open count == 0.  In this case deactivation is allowed
to continue and cleanup DM table.

lib/activate/activate.c

index 29cd2d3aad66a5087ffd814b9854f07c82285141..258881633da97064cdaef2da0a3cf47a573b3132 100644 (file)
@@ -2434,6 +2434,17 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi
                        }
                }
 
+               if (lv_is_vdo_pool(lv)) {
+                       /* If someone has remove 'linear' mapping over VDO device
+                        * we may still be able to deactivate the rest of the tree
+                        * i.e. in test-suite we simulate this via 'dmsetup remove' */
+                       if (!lv_info(cmd, lv, 1, &info, 1, 0))
+                               goto_out;
+
+                       if (info.exists && !info.open_count)
+                               r = 0; /* Unused VDO device left in table? */
+               }
+
                if (r)
                        goto out;
        }
This page took 0.037932 seconds and 5 git commands to generate.