2008-11-24 19:09:21

by Stefan Richter

[permalink] [raw]
Subject: idr: IDs guaranteed to be less than 1<<31? (was Re: [PATCH] firewire: us an idr rather than a linked list for resources)

Jay Fenlason wrote at linux1394-devel:
> As mentioned in the comments, there is a theoretical problem with this
> code if someone manages to allocate 2^31 resources on a 32-bit
> machine, or 2^32+1 resources on a 64+-bit machine.

The kerneldoc of idr_get_new() says that we only get IDs in the range of
0...0x7fffffff. But is this true with 64bit kernels?
--
Stefan Richter
-=====-==--- =-== ==---
http://arcgraph.de/sr/