public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/lib/metadata raid_manip.c
@ 2011-08-19 19:35 agk
0 siblings, 0 replies; 2+ messages in thread
From: agk @ 2011-08-19 19:35 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk@sourceware.org 2011-08-19 19:35:50
Modified files:
lib/metadata : raid_manip.c
Log message:
clarify comment
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/raid_manip.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
--- LVM2/lib/metadata/raid_manip.c 2011/08/19 15:59:15 1.10
+++ LVM2/lib/metadata/raid_manip.c 2011/08/19 19:35:50 1.11
@@ -220,7 +220,7 @@
lv->vg->name, lv->name);
/*
* Rather than wiping lv->size, we can simply
- * wipe '1' to remove the superblock of any previous
+ * wipe the first sector to remove the superblock of any previous
* RAID devices. It is much quicker.
*/
if (!set_lv(lv->vg->cmd, lv, 1, 0)) {
@@ -572,7 +572,7 @@
return 1;
fail:
- /* Cleanly remove newly allocated LVs that failed insertion attempt */
+ /* Cleanly remove newly-allocated LVs that failed insertion attempt */
dm_list_iterate_items(lvl, &meta_lvs)
if (!lv_remove(lvl->lv))
^ permalink raw reply [flat|nested] 2+ messages in thread
* LVM2/lib/metadata raid_manip.c
@ 2011-09-22 15:33 jbrassow
0 siblings, 0 replies; 2+ messages in thread
From: jbrassow @ 2011-09-22 15:33 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow@sourceware.org 2011-09-22 15:33:21
Modified files:
lib/metadata : raid_manip.c
Log message:
When up-converting a RAID1 array, we need to allocate new larger arrays for
seg->areas and seg->meta_areas. We also need to copy the memory from the
old arrays to the newly allocated arrays. The amount of memory to copy was
determined by seg->area_count. However, seg->area_count was being set to the
higher value after copying the 'seg->areas' information, but before copying
the 'seg->meta_areas' information. This means we were copying more memory
than necessary for 'seg->meta_areas' - something that could lead to a segfault.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/raid_manip.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
--- LVM2/lib/metadata/raid_manip.c 2011/09/14 09:57:35 1.14
+++ LVM2/lib/metadata/raid_manip.c 2011/09/22 15:33:21 1.15
@@ -499,7 +499,6 @@
goto fail;
memcpy(new_areas, seg->areas, seg->area_count * sizeof(*seg->areas));
seg->areas = new_areas;
- seg->area_count = new_count;
/* Expand meta_areas array */
if (!(new_areas = dm_pool_zalloc(lv->vg->cmd->mem,
@@ -508,6 +507,7 @@
memcpy(new_areas, seg->meta_areas,
seg->area_count * sizeof(*seg->meta_areas));
seg->meta_areas = new_areas;
+ seg->area_count = new_count;
/* Set segment areas for metadata sub_lvs */
s = old_count;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-22 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19 19:35 LVM2/lib/metadata raid_manip.c agk
2011-09-22 15:33 jbrassow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).