mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Propagate volume group read-only setting down to its logical volumes.
(Might sometimes be safe to relax this restriction.)
This commit is contained in:
parent
7ae5a778d5
commit
12a6fcd3a8
@ -277,9 +277,13 @@ int _load(struct logical_volume *lv, int task)
|
||||
}
|
||||
}
|
||||
|
||||
if (!(lv->status & LVM_WRITE) && !dm_task_set_ro(dmt))
|
||||
log_error("Failed to set %s read-only during activation.",
|
||||
lv->name);
|
||||
if (!((lv->status & LVM_WRITE) && (lv->vg->status & LVM_WRITE))) {
|
||||
if (!dm_task_set_ro(dmt))
|
||||
log_error("Failed to set %s read-only during "
|
||||
"activation.", lv->name);
|
||||
else
|
||||
log_very_verbose("Activating %s read-only", lv->name);
|
||||
}
|
||||
|
||||
|
||||
if (!(r = dm_task_run(dmt)))
|
||||
|
@ -47,10 +47,10 @@ static int lvchange_single(struct logical_volume *lv)
|
||||
int doit = 0;
|
||||
int archived = 0;
|
||||
|
||||
if ((lv->vg->status & PARTIAL_VG) &&
|
||||
if (!(lv->vg->status & LVM_WRITE) &&
|
||||
(arg_count(contiguous_ARG) || arg_count(permission_ARG) ||
|
||||
arg_count(readahead_ARG))) {
|
||||
log_error("Only -a permitted with partial volume group \"%s\"",
|
||||
log_error("Only -a permitted with read-only volume group \"%s\"",
|
||||
lv->vg->name);
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user