mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Fix regex optimiser not to ignore RHS of OR nodes in _find_leftmost_common.
This commit is contained in:
parent
2955b913ea
commit
4b429b6c33
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.76 -
|
Version 2.02.76 -
|
||||||
===================================
|
===================================
|
||||||
|
Fix regex optimiser not to ignore RHS of OR nodes in _find_leftmost_common.
|
||||||
Fix handling of online filesystem resize (using new fsadm return code).
|
Fix handling of online filesystem resize (using new fsadm return code).
|
||||||
Add DIAGNOSTICS section to fsadm man page.
|
Add DIAGNOSTICS section to fsadm man page.
|
||||||
Modify fsadm to return different status code for check of mounted filesystem.
|
Modify fsadm to return different status code for check of mounted filesystem.
|
||||||
|
@ -473,16 +473,19 @@ static int _find_leftmost_common(struct rx_node *or,
|
|||||||
unsigned left_depth = _depth(left, leftmost);
|
unsigned left_depth = _depth(left, leftmost);
|
||||||
unsigned right_depth = _depth(right, leftmost);
|
unsigned right_depth = _depth(right, leftmost);
|
||||||
|
|
||||||
while (left_depth > right_depth) {
|
while (left_depth > right_depth && left->type != OR) {
|
||||||
left = LEFT(left);
|
left = LEFT(left);
|
||||||
left_depth--;
|
left_depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (right_depth > left_depth) {
|
while (right_depth > left_depth && right->type != OR) {
|
||||||
right = LEFT(right);
|
right = LEFT(right);
|
||||||
right_depth--;
|
right_depth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (left_depth != right_depth)
|
||||||
|
return 0;
|
||||||
|
|
||||||
while (left_depth) {
|
while (left_depth) {
|
||||||
if (left->type == CAT && right->type == CAT) {
|
if (left->type == CAT && right->type == CAT) {
|
||||||
if (_nodes_equal(LEFT(left), LEFT(right))) {
|
if (_nodes_equal(LEFT(left), LEFT(right))) {
|
||||||
@ -491,6 +494,8 @@ static int _find_leftmost_common(struct rx_node *or,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (left->type == OR || right->type == OR)
|
||||||
|
break;
|
||||||
left = LEFT(left);
|
left = LEFT(left);
|
||||||
right = LEFT(right);
|
right = LEFT(right);
|
||||||
left_depth--;
|
left_depth--;
|
||||||
@ -568,7 +573,6 @@ static struct rx_node *_pass(struct dm_pool *mem,
|
|||||||
case QUEST:
|
case QUEST:
|
||||||
if (!(r->left = _pass(mem, r->left, changed)))
|
if (!(r->left = _pass(mem, r->left, changed)))
|
||||||
return_NULL;
|
return_NULL;
|
||||||
break;
|
|
||||||
|
|
||||||
case OR:
|
case OR:
|
||||||
/* It's important we optimise sub nodes first */
|
/* It's important we optimise sub nodes first */
|
||||||
@ -577,7 +581,6 @@ static struct rx_node *_pass(struct dm_pool *mem,
|
|||||||
|
|
||||||
if (!(r->right = _pass(mem, r->right, changed)))
|
if (!(r->right = _pass(mem, r->right, changed)))
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If rotate_ors changes the tree, left and right are stale,
|
* If rotate_ors changes the tree, left and right are stale,
|
||||||
* so just set 'changed' to repeat the search.
|
* so just set 'changed' to repeat the search.
|
||||||
|
Loading…
Reference in New Issue
Block a user