diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-06-24 12:11:21 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-06-24 15:01:03 +0200 |
commit | bc39d5bec6fea787a8d8d16fa484084b7d2a7c29 (patch) | |
tree | 7a8356e0db261249990f854db1b7f7f4addcaa43 /lib/config | |
parent | edbc5a62b26806e5c4de59b5292609e955303576 (diff) | |
download | lvm2-bc39d5bec6fea787a8d8d16fa484084b7d2a7c29.tar.gz |
pool: zero metadata
To avoid polution of metadata with some 'garbage' content or eventualy
some leak of stale data in case user want to upload metadata somewhere,
ensure upon allocation the metadata device is fully zeroed.
Behaviour may slow down allocation of thin-pool or cache-pool a bit
so the old behaviour can be restored with lvm.conf setting:
allocation/zero_metadata=0
TODO: add zeroing for extension of metadata volume.
Diffstat (limited to 'lib/config')
-rw-r--r-- | lib/config/config_settings.h | 5 | ||||
-rw-r--r-- | lib/config/defaults.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h index 2bb72ba71..531fb139d 100644 --- a/lib/config/config_settings.h +++ b/lib/config/config_settings.h @@ -626,7 +626,7 @@ cfg(allocation_cache_pool_max_chunks_CFG, "cache_pool_max_chunks", allocation_CF "Using cache pool with more chunks may degrade cache performance.\n") cfg(allocation_thin_pool_metadata_require_separate_pvs_CFG, "thin_pool_metadata_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS, vsn(2, 2, 89), NULL, 0, NULL, - "Thin pool metdata and data will always use different PVs.\n") + "Thin pool metadata and data will always use different PVs.\n") cfg(allocation_thin_pool_zero_CFG, "thin_pool_zero", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_ZERO, vsn(2, 2, 99), NULL, 0, NULL, "Thin pool data chunks are zeroed before they are first used.\n" @@ -657,6 +657,9 @@ cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", a " 512KiB.\n" "#\n") +cfg(allocation_zero_metadata_CFG, "zero_metadata", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ZERO_METADATA, vsn(2, 3, 10), NULL, 0, NULL, + "Zero whole metadata area before use with thin or cache pool.\n") + cfg_runtime(allocation_thin_pool_chunk_size_CFG, "thin_pool_chunk_size", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, vsn(2, 2, 99), 0, NULL, "The minimal chunk size in KiB for thin pool volumes.\n" "Larger chunk sizes may improve performance for plain thin volumes,\n" diff --git a/lib/config/defaults.h b/lib/config/defaults.h index be4f5ff7f..708a57554 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -129,6 +129,7 @@ #define DEFAULT_THIN_POOL_DISCARDS "passdown" #define DEFAULT_THIN_POOL_ZERO 1 #define DEFAULT_POOL_METADATA_SPARE 1 /* thin + cache */ +#define DEFAULT_ZERO_METADATA 1 /* thin + cache */ #ifdef CACHE_CHECK_NEEDS_CHECK # define DEFAULT_CACHE_CHECK_OPTION1 "-q" |