1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00

Driver version 1 compatibility fix for snapshots.

This commit is contained in:
Alasdair Kergon 2003-07-05 23:24:10 +00:00
parent b8f6e20aa5
commit 27ab6e0f86

View File

@ -943,6 +943,7 @@ static int _populate_snapshot(struct dev_manager *dm,
char params[PATH_MAX * 2 + 32];
struct snapshot *s;
struct dev_layer *dlo, *dlc;
char devbufo[10], devbufc[10];
if (!(s = find_cow(dl->lv))) {
log_error("Couldn't find snapshot for '%s'.", dl->lv->name);
@ -970,9 +971,22 @@ static int _populate_snapshot(struct dev_manager *dm,
return 0;
}
if (snprintf(params, sizeof(params), "%03u:%03u %03u:%03u P %d",
dlo->info.major, dlo->info.minor,
dlc->info.major, dlc->info.minor, s->chunk_size) == -1) {
if (!dm_format_dev(devbufo, sizeof(devbufo), dlo->info.major,
dlo->info.minor)) {
log_error("Couldn't create origin device parameters for '%s'.",
s->origin->name);
return 0;
}
if (!dm_format_dev(devbufc, sizeof(devbufc), dlc->info.major,
dlc->info.minor)) {
log_error("Couldn't create cow device parameters for '%s'.",
s->cow->name);
return 0;
}
if (snprintf(params, sizeof(params), "%s %s P %d",
devbufo, devbufc, s->chunk_size) == -1) {
stack;
return 0;
}