diff options
Diffstat (limited to 'lib/format1/import-export.c')
-rw-r--r-- | lib/format1/import-export.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c index 855c04273..ae48571f6 100644 --- a/lib/format1/import-export.c +++ b/lib/format1/import-export.c @@ -25,6 +25,7 @@ #include "pv_alloc.h" #include "display.h" #include "metadata.h" +#include "lvmlockd.h" #include <time.h> @@ -240,12 +241,12 @@ int import_vg(struct dm_pool *mem, if (vgd->vg_access & VG_WRITE) vg->status |= LVM_WRITE; + if (vgd->vg_access & VG_WRITE_LOCKD) + vg->status |= LVM_WRITE; + if (vgd->vg_access & VG_CLUSTERED) vg->status |= CLUSTERED; - if (vgd->vg_access & VG_LOCK_TYPE) - vg->status |= LOCK_TYPE; - if (vgd->vg_access & VG_SHARED) vg->status |= SHARED; @@ -267,15 +268,15 @@ int export_vg(struct vg_disk *vgd, struct volume_group *vg) if (vg->status & LVM_READ) vgd->vg_access |= VG_READ; - if (vg->status & LVM_WRITE) + if ((vg->status & LVM_WRITE) && !is_lockd_type(vg->lock_type)) vgd->vg_access |= VG_WRITE; + if ((vg->status & LVM_WRITE) && is_lockd_type(vg->lock_type)) + vgd->vg_access |= VG_WRITE_LOCKD; + if (vg_is_clustered(vg)) vgd->vg_access |= VG_CLUSTERED; - if (vg->status & LOCK_TYPE) - vgd->vg_access |= VG_LOCK_TYPE; - if (vg->status & SHARED) vgd->vg_access |= VG_SHARED; @@ -324,6 +325,9 @@ int import_lv(struct cmd_context *cmd, struct dm_pool *mem, if (lvd->lv_access & LV_WRITE) lv->status |= LVM_WRITE; + if (lvd->lv_access & LV_WRITE_LOCKD) + lv->status |= LVM_WRITE; + if (lvd->lv_badblock) lv->status |= BADBLOCK_ON; @@ -356,9 +360,12 @@ static void _export_lv(struct lv_disk *lvd, struct volume_group *vg, if (lv->status & LVM_READ) lvd->lv_access |= LV_READ; - if (lv->status & LVM_WRITE) + if ((lv->status & LVM_WRITE) && !is_lockd_type(vg->lock_type)) lvd->lv_access |= LV_WRITE; + if ((lv->status & LVM_WRITE) && is_lockd_type(vg->lock_type)) + lvd->lv_access |= LV_WRITE_LOCKD; + if (lv->status & SPINDOWN_LV) lvd->lv_status |= LV_SPINDOWN; |