]> sourceware.org Git - lvm2.git/commit
metadata: fix automatic updates of PV extension headers to newest version
authorPeter Rajnoha <prajnoha@redhat.com>
Tue, 26 Jul 2016 13:46:36 +0000 (15:46 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Tue, 26 Jul 2016 14:22:55 +0000 (16:22 +0200)
commit070c0d31ab3847240081e7593f959b03e716923d
tree59ea959286daf2f08db1c49fd70519ebd7021057
parentf9697ea0067ef574aff09f1c8f25e1c7fab74c17
metadata: fix automatic updates of PV extension headers to newest version

Before, the automatic update from older to newer version of PV extension
header happened within vg_write call. This may have caused problems under
some circumnstances where there's a code in between vg_write and vg_commit
which may have failed. In such situation, we reverted precommitted metadata
and put back the state to working version of VG metadata.

However, we don't have revert for PV write operation at the moment. So
if we updated PV headers already and we reverted vg_write due to failure
in subsequent code (before vg_commit), we ended up with lost VG metadata
(because old metadata pointers got reset by the PV write operation).

To minimize problematic situations here, we should put vg_write and
vg_commit that is done after PV header rewrites as close to each
other as possible.

This patch moves the automatic PV header rewrite for new extension
header part from vg_write to _vg_read where it's done the same way
as we do any other VG repairs if detected during VG read operation
(under VG write lock).
WHATS_NEW
lib/metadata/metadata.c
This page took 0.039061 seconds and 5 git commands to generate.