mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: validate thin-pool before sending messages
Alhtough lvm2 does validation on its side, ensure DM code is not sending messages to failed thin pool.
This commit is contained in:
parent
4b0565b82f
commit
b2a326b511
@ -1600,6 +1600,15 @@ static int _node_send_messages(struct dm_tree_node *dnode,
|
|||||||
if (!have_messages || !send)
|
if (!have_messages || !send)
|
||||||
return 1; /* transaction_id is matching */
|
return 1; /* transaction_id is matching */
|
||||||
|
|
||||||
|
if (stp.fail || stp.read_only || stp.needs_check) {
|
||||||
|
log_error("Cannot send messages to thin pool %s%s%s%s.",
|
||||||
|
_node_name(dnode),
|
||||||
|
stp.fail ? " in failed state" : "",
|
||||||
|
stp.read_only ? " with read only metadata" : "",
|
||||||
|
stp.needs_check ? " which needs check first" : "");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
dm_list_iterate_items(tmsg, &seg->thin_messages) {
|
dm_list_iterate_items(tmsg, &seg->thin_messages) {
|
||||||
if (!(_thin_pool_node_message(dnode, tmsg)))
|
if (!(_thin_pool_node_message(dnode, tmsg)))
|
||||||
return_0;
|
return_0;
|
||||||
|
Loading…
Reference in New Issue
Block a user