Make sure to bubble the node aug bits up the treap

We forgot to or in a node's children's augmentation bits when setting
the augmentation bits up in the parent's ref.  This stopped ring
dirtying from finding all the dirty nodes in the treap.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-01-02 10:33:02 -08:00
parent 3333d89f82
commit be497f3fcf

View File

@@ -168,17 +168,19 @@ static u8 old_aug_bit(struct scoutfs_treap *treap)
return off_aug_bit(treap, tinf->dirty_off) ^ SCOUTFS_TREAP_AUG_HALVES;
}
/* Return the aug bits that'll be used to refer to the given node. */
/*
* Return the aug bits that'll be used to refer to the given node.
* We calculate the bits for the node itself and then or those with the
* bits in its references to its children.
*/
static u8 node_aug_bits(struct scoutfs_treap *treap, struct treap_node *node)
{
DECLARE_TREAP_INFO(treap->sb, tinf);
u8 aug_bits = 0;
if (node->off == tinf->dirty_off)
aug_bits |= SCOUTFS_TREAP_AUG_DIRTY;
return aug_bits | off_aug_bit(treap, node->off);
return (node->off == tinf->dirty_off ? SCOUTFS_TREAP_AUG_DIRTY : 0) |
off_aug_bit(treap, node->off) |
node->left.aug_bits |
node->right.aug_bits;
}
/*