]> sourceware.org Git - lvm2.git/commitdiff
pvscan --cache: Error out on pool-format VGs for now.
authorPetr Rockai <prockai@redhat.com>
Sun, 15 Dec 2013 15:31:35 +0000 (16:31 +0100)
committerPetr Rockai <prockai@redhat.com>
Sun, 15 Dec 2013 15:44:47 +0000 (16:44 +0100)
lib/cache/lvmetad.c

index 1ead9f8879f76069437dbda20e2650e39b2ef5cb..a2ebefbacd6e209ffe4b9434a5e66015ee614c7c 100644 (file)
@@ -20,6 +20,8 @@
 #include "lvmcache.h"
 #include "lvmetad-client.h"
 #include "format-text.h" // TODO for disk_locn, used as a DA representation
+#include "format_pool.h" // for FMT_POOL_NAME
+#include "format1.h" // for FMT_LVM1_NAME
 #include "crc.h"
 
 static daemon_handle _lvmetad;
@@ -904,6 +906,13 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
 
        lvmcache_foreach_mda(info, _lvmetad_pvscan_single, &baton);
 
+       if (lvmcache_fmt(info) == get_format_by_name(cmd, FMT_POOL_NAME)) {
+               log_error("WARNING: Ignoring old GFS pool metadata on device %s "
+                         "when using lvmetad", dev_name(dev));
+               lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
+               return 0;
+       }
+
        /* LVM1 VGs have no MDAs. */
        if (!baton.vg && lvmcache_fmt(info) == get_format_by_name(cmd, "lvm1"))
                baton.vg = ((struct metadata_area *) dm_list_first(&baton.fid->metadata_areas_in_use))->
This page took 0.03834 seconds and 5 git commands to generate.