summaryrefslogtreecommitdiffstats
path: root/ctdb/lib/util/idtree.c
Commit message (Collapse)AuthorAgeFilesLines
* ctdb-build: Change from ctdb-util to samba-utilMartin Schwenke2014-10-061-387/+0
| | | | | | | | | | | | | | | | | | Remove local lib/util and lib/tdb-wrap. Update wscript, packaging and includes.h. The only potentially surprising thing here is a fake samba-util subsystem that just depends on samba-util-core. As explained in a comment: When a combined build is implemented, CTDB will wanted to build against samba-util rather than samba-util-core. Similarly, other Samba subsystems expect samba-util. So, for a standalone build, just define a fake samba-util subsystem that pulls in samba-util-core. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Volker Lendecke <vl@samba.org>
* idtree: fix overflow for v. large ids on allocation and removalRusty Russell2010-12-071-1/+1
| | | | | | | | | | | | | | (Imported from SAMBA commit 09a6538969ac). Chris Cowan tracked down a SEGV in sub_alloc: idp->level can actually be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove. (We unfairly blamed a shift of a signed var for this crash in commit 2db1987f5a3a). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 73764104356d3738d9d20a9d06ce51535f74f475)
* idtree: fix right shift of signed ints, crash on large ids on AIXRusty Russell2010-10-081-1/+1
| | | | | | | | | | | | | | | | | | | Right-shifting signed integers in undefined; indeed it seems that on AIX with their compiler, doing a 30-bit shift on (INT_MAX-200) gives 0, not 1 as we might expect. The obvious fix is to make id and oid unsigned: l (level count) is also logically unsigned. (Note: Samba doesn't generally get to ids > 1 billion, but ctdb does) Reported-by: Chris Cowan <cc@us.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@samba.org> Autobuild-Date: Wed Oct 6 08:31:09 UTC 2010 on sn-devel-104 (This used to be ctdb commit 90b7e79446f06990f82c0128b2581e15497094fe)
* idtree: fix handling of large ids (eg INT_MAX)Rusty Russell2010-06-101-2/+4
| | | | | | | | | | | | | Since idtree assigns sequentially, it rarely reaches high numbers. But such numbers can be forced with idr_get_new_above(), and that reveals two bugs: 1) Crash in sub_remove() caused by pa array being too short. 2) Shift by more than 32 in _idr_find(), which is undefined, causing the "outside the current tree" optimization to misfire and return NULL. Signed-off-by: Rusty Russell <rusty@rustorp.com.au> (This used to be ctdb commit 32c04e11ebbcf8239e47016302c6ce802a8b0a6f)
* The author of the upstream code asked for this code to be GPLv2+ not GPLv3Andrew Tridgell2008-09-301-1/+1
| | | | (This used to be ctdb commit 000018f2f4fb9f2452f56731b027dd6a7beda111)
* merged a bugfix for the idtree code from the Linux kernel. ThisAndrew Tridgell2008-09-301-2/+14
| | | | | | | | matches commit 7aae6dd80e265aa9402ed507caaff4a5dba55069 in the kernel. Many thanks to Jim Houston for pointing out this fix to us (This used to be ctdb commit 85f6032cbdb197f3a003d86f086afa2cee898a4d)
* update lib/replace from samba4Andrew Tridgell2007-07-101-3/+2
| | | | (This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
* - added in idtree for efficient reqid handlingAndrew Tridgell2006-11-281-0/+374
- started adding ctdb_call() code - added ctdb_call_local() implementation (This used to be ctdb commit 97b1fdf7fa0e230f36add3f1770ecb3a9faee0a1)