]> sourceware.org Git - lvm2.git/commit
metadata: improve write and commit code
authorDavid Teigland <teigland@redhat.com>
Thu, 30 Aug 2018 15:44:53 +0000 (10:44 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 11 Sep 2018 15:06:25 +0000 (10:06 -0500)
commit5fb15b19349af607654f2429850a706bbac4b792
tree46a93d655ccf5600786166671b3a1bebb65aa5dd
parent3832329a6b6a6430c84ea1aaacf17fb122a57b2a
metadata: improve write and commit code

The vg_write/vg_commit code was imprecise, uncommented, and
hard to understand.  Rewrite it with clearer, cleaner code,
extensive comments, descriptions of how it works, and add
more info in debugging output.

The minor changes in behavior are to things that were
either incorrect or probably unintended:

- vg_write/vg_commit no longer check that the current vgname at
  the start of the text metadata matches the vgname being written.
  This has already been done at least twice by the time they are
  called, and repeating it again against the same cached data has
  no use.

- A fragment of old removed code had been left behind that checked
  if the old unused alignment policy would wrap.  It was still
  being checked to decide if the metadata area was full, which
  could possibly cause an incorrect full metadata failure.

- vg_remove now clears both the raw_locns in the mda_header that
  point to committed metadata (raw_locn slot 0) and precommitted
  metadata (raw_locn slot 1).  Previously it fully cleared the
  committed slot, and would only clear the offset field in the
  precommitted slot if it saw a problem with the metadata in the
  vg being removed.

- read_metadata_location_summary was wrongly comparing the number
  of wrapped bytes with an offset to report an error about the
  metadata being too large.  This wrong check is removed, it
  could have resulted in erroneous errors.
lib/format_text/format-text.c
This page took 0.036617 seconds and 5 git commands to generate.