1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

thin: delayed resume for LV conversion

When we have some existing LV and this LV is being converted to
external origin - during the DM table manipulation there is a short
moment when the LV is being 'resumed' as 'read-only' volume
while still being live as 'rw' volume i.e. we could have had
a single thin LV active twice.

To avoid such weird scenarios of dual access to a same volume, we
just postpone a resume until a moment, where the existing volume
is already suspended thus no I/O can be in flight to such device.

Note: however there is slight catch - that we now have basically
a different 'risk' case where a resume of such i.e. new external
origin LV might fail and we are already in suspend tree state -
resolving error path in this situation is untrivial as well...
This commit is contained in:
Zdenek Kabelac 2024-03-04 11:45:35 +01:00
parent 386f0bfb4f
commit 3bd9f936da

View File

@ -4363,6 +4363,12 @@ int dm_tree_node_set_thin_external_origin(struct dm_tree_node *node,
seg->external = external; seg->external = external;
if (!external->info.minor) {
log_debug_activation("Delaying resume for new external origin %s.",
external->name);
external->props.delay_resume_if_new = 1;
}
return 1; return 1;
} }