mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: watch for failing _info_by_dev
Separate handling of error code from _info_by_dev. This error can only happeng when we are running out of memory. In such case there is urgent need to stop any futher proceeding of command and run to error ASAP.
This commit is contained in:
parent
b74e7f6a78
commit
63368a5064
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.146 -
|
Version 1.02.146 -
|
||||||
====================================
|
====================================
|
||||||
|
Do not ignore failure of _info_by_dev().
|
||||||
Propagate delayed resume for pvmove subvolumes.
|
Propagate delayed resume for pvmove subvolumes.
|
||||||
Suppress integrity encryption keys in 'table' output unless --showkeys supplied.
|
Suppress integrity encryption keys in 'table' output unless --showkeys supplied.
|
||||||
|
|
||||||
|
@ -1011,8 +1011,10 @@ static int _node_has_closed_parents(struct dm_tree_node *node,
|
|||||||
return_0; /* FIXME Is this normal? */
|
return_0; /* FIXME Is this normal? */
|
||||||
|
|
||||||
/* Refresh open_count */
|
/* Refresh open_count */
|
||||||
if (!_info_by_dev(dinfo->major, dinfo->minor, 1, &info, NULL, NULL, NULL) ||
|
if (!_info_by_dev(dinfo->major, dinfo->minor, 1, &info, NULL, NULL, NULL))
|
||||||
!info.exists)
|
return_0;
|
||||||
|
|
||||||
|
if (!info.exists)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (info.open_count) {
|
if (info.open_count) {
|
||||||
@ -1137,7 +1139,7 @@ static int _node_clear_table(struct dm_tree_node *dnode, uint16_t udev_flags)
|
|||||||
|
|
||||||
if (!_info_by_dev(MAJOR(deps->device[i]), MINOR(deps->device[i]), 1,
|
if (!_info_by_dev(MAJOR(deps->device[i]), MINOR(deps->device[i]), 1,
|
||||||
&deps_info, dnode->dtree->mem, &name, &uuid))
|
&deps_info, dnode->dtree->mem, &name, &uuid))
|
||||||
continue;
|
goto_out;
|
||||||
|
|
||||||
/* Proceed if device is an 'orphan' - unreferenced and without a live table. */
|
/* Proceed if device is an 'orphan' - unreferenced and without a live table. */
|
||||||
if (!deps_info.exists || deps_info.live_table || deps_info.open_count)
|
if (!deps_info.exists || deps_info.live_table || deps_info.open_count)
|
||||||
@ -1653,8 +1655,10 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Refresh open_count */
|
/* Refresh open_count */
|
||||||
if (!_info_by_dev(dinfo->major, dinfo->minor, 1, &info, NULL, NULL, NULL) ||
|
if (!_info_by_dev(dinfo->major, dinfo->minor, 1, &info, NULL, NULL, NULL))
|
||||||
!info.exists)
|
return_0;
|
||||||
|
|
||||||
|
if (!info.exists)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (info.open_count) {
|
if (info.open_count) {
|
||||||
@ -1773,8 +1777,10 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
|
|||||||
if (!_children_suspended(child, 1, uuid_prefix, uuid_prefix_len))
|
if (!_children_suspended(child, 1, uuid_prefix, uuid_prefix_len))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!_info_by_dev(dinfo->major, dinfo->minor, 0, &info, NULL, NULL, NULL) ||
|
if (!_info_by_dev(dinfo->major, dinfo->minor, 0, &info, NULL, NULL, NULL))
|
||||||
!info.exists || info.suspended)
|
return_0;
|
||||||
|
|
||||||
|
if (!info.exists || info.suspended)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* If child has some real messages send them */
|
/* If child has some real messages send them */
|
||||||
|
Loading…
Reference in New Issue
Block a user