All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix overlap detection in _vg_write_raw()
@ 2008-10-15 14:32 Edward Allcutt
  0 siblings, 0 replies; only message in thread
From: Edward Allcutt @ 2008-10-15 14:32 UTC (permalink / raw)
  To: lvm-devel

The tests for checking if the new metadata overlaps the old has a flaw.
The amount by which the new metadata wraps is compared to the offset of
the old metadata. However the old metadata offset is from the beginning
of the metadata header whereas new_wrap is from the beginning of the
text area.

My patch fixes this comparison by adding the offset of the text area in
the header to new_wrap.

The first patch[0] applies just this simple fix.

The second alternative patch[1] precomputes the end position of the new
metadata, which simplifies the later comparison. It also extends
new_wrap and old_wrap to uint64_t as all the sizes and offsets used to
calculate them and with which they are compared are already 64-bit.

I've not included the patches directly as I can't convince my MUA not to
wrap the long lines.

[0] - http://allcutt.me.uk/lvm-minimal.diff
[1] - http://allcutt.me.uk/lvm.diff

Thanks to agk for pointing out the location of the bug on IRC.

-- 
Edward Allcutt



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-15 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15 14:32 [PATCH] Fix overlap detection in _vg_write_raw() Edward Allcutt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.