mirror of
git://sourceware.org/git/lvm2.git
synced 2025-12-07 04:23:49 +03:00
Tie all snapshot (de)activation requests to (de)activation of origin device.
This commit is contained in:
@@ -67,7 +67,9 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv)
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
if (lv_is_origin(lv)) {
|
||||
if (lv_is_origin(lv) &&
|
||||
(arg_count(cmd, contiguous_ARG) || arg_count(cmd, permission_ARG) ||
|
||||
arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG))) {
|
||||
log_error("Can't change logical volume \"%s\" under snapshot",
|
||||
lv->name);
|
||||
return ECMD_FAILED;
|
||||
@@ -187,6 +189,7 @@ static int lvchange_availability(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
if (activate) {
|
||||
/* FIXME Tighter locking if lv_is_origin() */
|
||||
log_verbose("Activating logical volume \"%s\"", lv->name);
|
||||
if (!lock_vol(cmd, lv->lvid.s, LCK_LV_ACTIVATE))
|
||||
return 0;
|
||||
|
||||
@@ -35,6 +35,10 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
|
||||
list_iterate(lvh, &vg->lvs) {
|
||||
lv = list_item(lvh, struct lv_list)->lv;
|
||||
|
||||
/* Only request activatation of snapshot origin devices */
|
||||
if (lv_is_cow(lv))
|
||||
continue;
|
||||
|
||||
if (!lock_vol(cmd, lv->lvid.s, lock | LCK_NONBLOCK))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user