Red Hat Bugzilla – Bug 1512844
cache_restore tool may corrupt cache metadata
Last modified: 2018-04-10 09:18:48 EDT
Description of problem: Under some circumstances cache_restore tool corrupts metadata. Version-Release number of selected component (if applicable): device-mapper-persistent-data-0.7.3 Sorry for being so vague. Waiting for devel to fill in reproducer.
v0.7.0 of the tools introduced support for cache metadata v2. However cache restore was not writing a crucial field to the superblock. So the kernel cannot load the metadata. This patch fixes it: https://github.com/jthornber/thin-provisioning-tools/commit/e3b7d825696c23c23f6bd867de4dbda69be38db8 The bug wasn't discovered for a long time because a separate bug meant v1 metadata was always being written even if v2 was requested. v0.7.5 behaves correctly.
before: # cache_restore -V 0.7.0-0.1.rc6.el7 # cache_restore -i metadata -o /dev/mapper/vgtest-swapvol --debug-override-metadata-version 2 cache_restore: /usr/include/boost/optional/optional.hpp:631: boost::optional<T>::reference_type boost::optional<T>::get() [with T = long unsigned int; boost::optional<T>::reference_type = long unsigned int&]: Assertion `this->is_initialized()' failed. Aborted (core dumped) with this patch: # cache_restore -V 0.7.0-0.1.rc6.el7_4.1 # cache_restore -i metadata -o /dev/mapper/vgtest-swapvol --debug-override-metadata-version 2 Restoring: [==================================================] 100%
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0776