1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

thin: use LV_TEMPORARY for metadata initialization

This flag need to be specified when we create thin pool - to avoid
scanning device with watch rules.
This commit is contained in:
Zdenek Kabelac 2014-01-24 12:28:35 +01:00
parent 432ff4bd72
commit 731c298e12
3 changed files with 13 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
Avoid exposing temporary devices when initializing thin pool volume.
Fix test when checking target version for available thin features.
Detect thin feature external_origin_extend and limit extend when missing.
Rename internal pool_can_resize_metadata() to thin_pool_feature_supported().

View File

@ -106,8 +106,9 @@
should not be scanned */
#define LV_TEMPORARY UINT64_C(0x0000100000000000) /* LV - internal use only - the LV
is supposed to be created and
removed during single LVM
command execution. */
removed or reactivated with
this flag dropped during single
LVM command execution. */
/* Format features flags */
#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */

View File

@ -241,7 +241,13 @@ int create_pool(struct logical_volume *pool_lv,
*
* FIXME: implement lazy clearing when activation is disabled
*/
/* pool_lv is a new LV so the VG lock protects us */
/*
* pool_lv is a new LV so the VG lock protects us
* Pass in LV_TEMPORARY flag, since device is activated purely for wipe
* and later it is either deactivated (in cluster)
* or directly converted to invisible device via suspend/resume
*/
pool_lv->status |= LV_TEMPORARY;
if (!activate_lv_local(pool_lv->vg->cmd, pool_lv) ||
/* Clear 4KB of metadata device for new thin-pool. */
!wipe_lv(pool_lv, (struct wipe_params) { .do_zero = 1 })) {
@ -249,6 +255,7 @@ int create_pool(struct logical_volume *pool_lv,
pool_lv->name);
goto bad;
}
pool_lv->status &= LV_TEMPORARY;
}
if (dm_snprintf(name, sizeof(name), "%s_%s", pool_lv->name,