1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Free memory in _raw_read_mda_header() error paths.

Fix ambiguous vgsplit error message for split LV.
Fix lvextend man page typo.
This commit is contained in:
Alasdair Kergon 2007-01-09 21:12:41 +00:00
parent 33f732c5e9
commit e62436fc70
4 changed files with 16 additions and 10 deletions

View File

@ -1,5 +1,8 @@
Version 2.02.18 - Version 2.02.18 -
==================================== ====================================
Free memory in _raw_read_mda_header() error paths.
Fix ambiguous vgsplit error message for split LV.
Fix lvextend man page typo.
Add configure --with-dmdir to compile against a device-mapper source tree. Add configure --with-dmdir to compile against a device-mapper source tree.
Use no flush suspending for mirrors. Use no flush suspending for mirrors.
Add dmeventd_mirror register_mutex, tidy initialisation & add memlock. Add dmeventd_mirror register_mutex, tidy initialisation & add memlock.

View File

@ -132,37 +132,40 @@ static struct mda_header *_raw_read_mda_header(const struct format_type *fmt,
if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah)) { if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah)) {
stack; stack;
dm_pool_free(fmt->cmd->mem, mdah); goto error;
return NULL;
} }
if (mdah->checksum_xl != xlate32(calc_crc(INITIAL_CRC, mdah->magic, if (mdah->checksum_xl != xlate32(calc_crc(INITIAL_CRC, mdah->magic,
MDA_HEADER_SIZE - MDA_HEADER_SIZE -
sizeof(mdah->checksum_xl)))) { sizeof(mdah->checksum_xl)))) {
log_error("Incorrect metadata area header checksum"); log_error("Incorrect metadata area header checksum");
return NULL; goto error;
} }
_xlate_mdah(mdah); _xlate_mdah(mdah);
if (strncmp((char *)mdah->magic, FMTT_MAGIC, sizeof(mdah->magic))) { if (strncmp((char *)mdah->magic, FMTT_MAGIC, sizeof(mdah->magic))) {
log_error("Wrong magic number in metadata area header"); log_error("Wrong magic number in metadata area header");
return NULL; goto error;
} }
if (mdah->version != FMTT_VERSION) { if (mdah->version != FMTT_VERSION) {
log_error("Incompatible metadata area header version: %d", log_error("Incompatible metadata area header version: %d",
mdah->version); mdah->version);
return NULL; goto error;
} }
if (mdah->start != dev_area->start) { if (mdah->start != dev_area->start) {
log_error("Incorrect start sector in metadata area header: %" log_error("Incorrect start sector in metadata area header: %"
PRIu64, mdah->start); PRIu64, mdah->start);
return NULL; goto error;
} }
return mdah; return mdah;
error:
dm_pool_free(fmt->cmd->mem, mdah);
return NULL;
} }
static int _raw_write_mda_header(const struct format_type *fmt, static int _raw_write_mda_header(const struct format_type *fmt,

View File

@ -31,7 +31,7 @@ size of the Logical Volume with the suffix %LV or as a percentage of the remaini
free space in the Volume Group with the suffix %FREE. free space in the Volume Group with the suffix %FREE.
.TP .TP
.I \-L, \-\-size [+]LogicalVolumeSize[kKmMgGtTpPeE] .I \-L, \-\-size [+]LogicalVolumeSize[kKmMgGtTpPeE]
Extend or set the logical volume size in units in units of megabytes. Extend or set the logical volume size in units of megabytes.
A size suffix of M for megabytes, A size suffix of M for megabytes,
G for gigabytes, T for terabytes, P for petabytes G for gigabytes, T for terabytes, P for petabytes
or E for exabytes is optional. or E for exabytes is optional.

View File

@ -84,9 +84,9 @@ static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to)
pv = seg_pv(seg, s); pv = seg_pv(seg, s);
if (vg_with) { if (vg_with) {
if (!pv_is_in_vg(vg_with, pv)) { if (!pv_is_in_vg(vg_with, pv)) {
log_error("Logical Volume %s " log_error("Can't split Logical "
"split between " "Volume %s between "
"Volume Groups", "two Volume Groups",
lv->name); lv->name);
return 0; return 0;
} }