diff --git a/WHATS_NEW b/WHATS_NEW index cc974a62d..bc2630c16 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.117 - ==================================== + Allow lvchange -p to change kernel state only if metadata state differs. Fix incorrect persistent .cache after report with label fields only (2.02.106). Reinstate PV tag recognition for pvs if reporting label fields only (2.02.105). Rescan devices before vgimport with lvmetad so exported VG is seen. diff --git a/tools/lvchange.c b/tools/lvchange.c index 6ed953f45..bf7e356f1 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -32,6 +32,13 @@ static int _lvchange_permission(struct cmd_context *cmd, } if (!(lv_access & LVM_WRITE) && !(lv->status & LVM_WRITE)) { + /* Refresh if it's read-only in metadata but read-write in kernel */ + if (lv_info(cmd, lv, 0, &info, 0, 0) && + (info_obtained = 1, info.exists) && !info.read_only) { + log_print_unless_silent("Logical volume \"%s\" is already read-only. Refreshing kernel state.", + lv->name); + return lv_refresh(cmd, lv); + } log_error("Logical volume \"%s\" is already read only", lv->name); return 0;