summaryrefslogtreecommitdiffstats
path: root/lib/activate
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2011-07-06 00:29:44 +0000
committerAlasdair Kergon <agk@redhat.com>2011-07-06 00:29:44 +0000
commitf5f3defc02c6cfd8a71cc7bd91255e0ff98e711a (patch)
treecaf5be888d327377d814c13613b5c6805688e325 /lib/activate
parent86b15c7c90c87ad0756f4c7d5238a243326c6529 (diff)
downloadlvm2-f5f3defc02c6cfd8a71cc7bd91255e0ff98e711a.tar.gz
lvm2-f5f3defc02c6cfd8a71cc7bd91255e0ff98e711a.tar.xz
lvm2-f5f3defc02c6cfd8a71cc7bd91255e0ff98e711a.zip
Cope with a PV only discovered missing when creating deptree.
Diffstat (limited to 'lib/activate')
-rw-r--r--lib/activate/dev_manager.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 6c037496..90cf5a4f 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1194,13 +1194,21 @@ int add_areas_line(struct dev_manager *dm, struct lv_segment *seg,
uint64_t extent_size = seg->lv->vg->extent_size;
uint32_t s;
char *dlid;
+ struct stat info;
+ const char *name;
+ /* FIXME Avoid repeating identical stat in dm_tree_node_add_target_area */
for (s = start_area; s < areas; s++) {
if ((seg_type(seg, s) == AREA_PV &&
- (!seg_pvseg(seg, s) ||
- !seg_pv(seg, s) ||
- !seg_dev(seg, s))) ||
+ (!seg_pvseg(seg, s) || !seg_pv(seg, s) || !seg_dev(seg, s) ||
+ !(name = dev_name(seg_dev(seg, s))) || !*name ||
+ stat(name, &info) < 0 || !S_ISBLK(info.st_mode))) ||
(seg_type(seg, s) == AREA_LV && !seg_lv(seg, s))) {
+ if (!seg->lv->vg->cmd->partial_activation) {
+ log_error("Aborting. LV %s is now incomplete "
+ "and --partial was not specified.", seg->lv->name);
+ return 0;
+ }
if (!_add_error_area(dm, node, seg, s))
return_0;
} else if (seg_type(seg, s) == AREA_PV) {