diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-08-11 17:46:13 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-08-11 17:46:13 +0000 |
commit | cf98c05082c71aa134b697894f0a92aa10d7be24 (patch) | |
tree | ddf0e570c07255e84feda6332947d189cb0c6322 /lib/cache/lvmcache.c | |
parent | 031c986ea89d2221ebc5dd940112787742c54326 (diff) | |
download | lvm2-cf98c05082c71aa134b697894f0a92aa10d7be24.tar.gz lvm2-cf98c05082c71aa134b697894f0a92aa10d7be24.tar.xz lvm2-cf98c05082c71aa134b697894f0a92aa10d7be24.zip |
Add detect_internal_vg_cache_corruption to lvm.conf
Add config option to enable crc checking of VG structures.
Currently it's disabled by default.
For the internal test-suite this check it is enabled.
Note: In the case the internal error is detected, debug build with
compile option DEBUG_ENFORCE_POOL_LOCKING helps to catch the source
of the problem.
Diffstat (limited to 'lib/cache/lvmcache.c')
-rw-r--r-- | lib/cache/lvmcache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 189ae1e5..50333dcb 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -689,7 +689,7 @@ struct volume_group *lvmcache_get_vg(const char *vgid, unsigned precommitted) vginfo->vg_use_count = 0; vg->vginfo = vginfo; - if (!dm_pool_lock(vg->vgmem, 1)) + if (!dm_pool_lock(vg->vgmem, detect_internal_vg_cache_corruption())) goto_bad; out: @@ -720,6 +720,7 @@ int vginfo_holders_dec_and_test_for_zero(struct lvmcache_vginfo *vginfo) /* Debug perform crc check only when it's been used more then once */ if (!dm_pool_unlock(vginfo->cached_vg->vgmem, + detect_internal_vg_cache_corruption() && (vginfo->vg_use_count > 1))) stack; |