* [PATCH] Fix over-zealous tag clearing in radix_tree_delete
[not found] <20060216144112.11116.patches@notabene>
@ 2006-02-16 3:43 ` NeilBrown
2006-02-16 6:05 ` Nick Piggin
0 siblings, 1 reply; 2+ messages in thread
From: NeilBrown @ 2006-02-16 3:43 UTC (permalink / raw)
To: Andrew Morton; +Cc: Nick Piggin, linux-kernel
Against 2.6.16-rc2-mm1. For inclusion in 2.6.16 please.
### Comments for Changeset
If a tag is set for a node being deleted from a radix_tree,
then that tag gets cleared from the parent of the node, even
if it is set for some siblings of the node begin deleted.
This patch changes the logic to include a test for any_tag_set similar
to the logic a little futher down. Care is taken to ensure that
'nr_cleared_tags' remains equals to the number of entries in the
'tags' array which are set to '0' (which means that this tag is not
set in the tree below pathp->node, and should be cleared at
pathp->node and possibly above.
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./lib/radix-tree.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff ./lib/radix-tree.c~current~ ./lib/radix-tree.c
--- ./lib/radix-tree.c~current~ 2006-02-16 13:22:28.000000000 +1100
+++ ./lib/radix-tree.c 2006-02-16 14:31:21.000000000 +1100
@@ -753,12 +753,14 @@ void *radix_tree_delete(struct radix_tre
*/
nr_cleared_tags = 0;
for (tag = 0; tag < RADIX_TREE_TAGS; tag++) {
+ tags[tag] = 1;
if (tag_get(pathp->node, tag, pathp->offset)) {
tag_clear(pathp->node, tag, pathp->offset);
- tags[tag] = 0;
- nr_cleared_tags++;
- } else
- tags[tag] = 1;
+ if (!any_tag_set(pathp->node, tag)) {
+ tags[tag] = 0;
+ nr_cleared_tags++;
+ }
+ }
}
for (pathp--; nr_cleared_tags && pathp->node; pathp--) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix over-zealous tag clearing in radix_tree_delete
2006-02-16 3:43 ` [PATCH] Fix over-zealous tag clearing in radix_tree_delete NeilBrown
@ 2006-02-16 6:05 ` Nick Piggin
0 siblings, 0 replies; 2+ messages in thread
From: Nick Piggin @ 2006-02-16 6:05 UTC (permalink / raw)
To: NeilBrown, Linus Torvalds; +Cc: Andrew Morton, Nick Piggin, linux-kernel
NeilBrown wrote:
> Against 2.6.16-rc2-mm1. For inclusion in 2.6.16 please.
>
> ### Comments for Changeset
>
> If a tag is set for a node being deleted from a radix_tree,
> then that tag gets cleared from the parent of the node, even
> if it is set for some siblings of the node begin deleted.
>
> This patch changes the logic to include a test for any_tag_set similar
> to the logic a little futher down. Care is taken to ensure that
> 'nr_cleared_tags' remains equals to the number of entries in the
> 'tags' array which are set to '0' (which means that this tag is not
> set in the tree below pathp->node, and should be cleared at
> pathp->node and possibly above.
>
> Acked-by: Nick Piggin <npiggin@suse.de>
> Signed-off-by: Neil Brown <neilb@suse.de>
>
Linus FYI, I was able to modify the radix tree test harness to catch
the bug and can no longer trigger it after the fix. Resulting code
passes all other harness tests as well of course.
Should be applied ASAP. However, unlike Andrew I don't think this is
a filesystem corrupting bug (maybe he was talking about NFS?).
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-16 6:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20060216144112.11116.patches@notabene>
2006-02-16 3:43 ` [PATCH] Fix over-zealous tag clearing in radix_tree_delete NeilBrown
2006-02-16 6:05 ` Nick Piggin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.