summaryrefslogtreecommitdiff
path: root/tools/vgcfgrestore.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/vgcfgrestore.c')
-rw-r--r--tools/vgcfgrestore.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index 0dd7d4d77..84032f133 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -14,7 +14,6 @@
*/
#include "tools.h"
-#include "daemons/lvmetad/lvmetad-client.h"
#include "device_mapper/all.h"
#include "device_mapper/misc/dm-ioctl.h"
@@ -77,7 +76,6 @@ out:
int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
{
const char *vg_name = NULL;
- int lvmetad_rescan = 0;
unsigned found = 0;
int ret;
@@ -121,22 +119,6 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
}
}
- /*
- * lvmetad does not handle a VG being restored, which would require
- * vg_remove of the existing VG, then vg_update of the restored VG. A
- * command failure after removing the existing VG from lvmetad would
- * not be easily recovered from. So, disable the lvmetad cache before
- * doing the restore. After the VG is restored on disk, rescan
- * metadata from disk to populate lvmetad from scratch which will pick
- * up the VG that was restored on disk.
- */
-
- if (lvmetad_used()) {
- lvmetad_set_disabled(cmd, LVMETAD_DISABLE_REASON_VGRESTORE);
- lvmetad_disconnect();
- lvmetad_rescan = 1;
- }
-
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE, NULL)) {
log_error("Unable to lock orphans.");
return ECMD_FAILED;
@@ -161,7 +143,7 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
unlock_vg(cmd, NULL, VG_ORPHANS);
log_error("Restore failed.");
ret = ECMD_FAILED;
- goto rescan;
+ goto out;
}
ret = ECMD_PROCESSED;
@@ -169,21 +151,6 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
unlock_vg(cmd, NULL, VG_ORPHANS);
unlock_vg(cmd, NULL, vg_name);
-rescan:
- if (lvmetad_rescan) {
- if (!lvmetad_connect(cmd)) {
- log_warn("WARNING: Failed to connect to lvmetad.");
- log_warn("WARNING: Update lvmetad with pvscan --cache.");
- goto out;
- }
- if (!refresh_filters(cmd))
- stack;
- if (!lvmetad_pvscan_all_devs(cmd, 1)) {
- log_warn("WARNING: Failed to scan devices.");
- log_warn("WARNING: Update lvmetad with pvscan --cache.");
- goto out;
- }
- }
out:
return ret;
}