Re: [PATCHSET] idr: implement idr_alloc() and convert existingusers

From: Jeff Layton
Date: Tue Mar 26 2013 - 12:53:01 EST


On Tue, 26 Mar 2013 09:36:35 -0700
Tejun Heo <tj@xxxxxxxxxx> wrote:

> On Tue, Mar 26, 2013 at 09:33:51AM -0700, Tejun Heo wrote:
> > not be too bad. The optimal would be bitmap + hashtable, I suppose.
>
> Oops, with more restricted (or at least dynamically adjusted) ID
> space, that is.
>
> The problem with idr is that it can get pretty wasteful if the IDs
> become very scattered - the worst case being one ID per each idr_layer
> (the internal allocation block). That said, even cyclic allocation
> should yield somewhat clustered IDs, so I don't think it'd be too bad.
>

Right, that's a (minor) concern too...

While we can assume that cyclic allocations will probably give you
clustered IDs, we're somewhat at the mercy of the clients when it comes
to freeing them.

So, one could imagine a hostile client that attempts to DoS the server
by creating new stateids and releasing all but one in each idr_layer as
it goes.

Of course there are probably better ways to bring down the NFS
server :).

--
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/