1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmlockd: fix sparse snapshot case

A snapshot can be created without a real origin LV
in this case, so there's no lock to use.
This commit is contained in:
David Teigland 2016-02-23 15:44:14 -06:00
parent 79809d6cdc
commit e793253084

View File

@ -2331,6 +2331,12 @@ int lockd_init_lv(struct cmd_context *cmd, struct volume_group *vg, struct logic
* represents itself and all associated cow snapshots.
*/
if (!lp->origin_name) {
/* Sparse LV case. We require a lock from the origin LV. */
log_error("Cannot create snapshot without origin LV in shared VG.");
return 0;
}
if (!(origin_lv = find_lv(vg, lp->origin_name))) {
log_error("Failed to find origin LV %s/%s", vg->name, lp->origin_name);
return 0;