lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fbf2264-04be-4899-9c1f-5c2e0942b158@default>
Date:	Fri, 17 Dec 2010 10:44:06 -0800 (PST)
From:	Dan Magenheimer <dan.magenheimer@...cle.com>
To:	Paul Mundt <lethal@...ux-sh.org>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: RE: [RFC] radix_tree_destroy?

> > +void radix_tree_destroy(struct radix_tree_root *root, void
> (*slot_free)(void *))
> > +{
> > +	if (root->rnode == NULL)
> > +		return;
> > +	if (root->height == 0)
> > +		slot_free(root->rnode);
> 
> Don't you want indirect_to_ptr(root->rnode) here? You probably also
> don't
> want the callback in the !radix_tree_is_indirect_ptr() case.
> 
> > +	else {
> > +		radix_tree_node_destroy(root->rnode, root->height,
> slot_free);
> > +		radix_tree_node_free(root->rnode);
> > +		root->height = 0;
> > +	}
> > +	root->rnode = NULL;
> > +}
> 
> The above will handle the nodes, but what about the root? It looks like
> you're at least going to leak tags on the root, so at the very least
> you'd still want a root_tag_clear_all() here.

Thanks for your help.  Will do both.  My use model doesn't require
tags or rcu, so my hacked version of radix_tree_destroy missed those
subtleties.

So my assumption was correct?  There is no way to efficiently
destroy an entire radix tree without adding this new routine?

Thanks,
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ