Re: [RFC PATCH 1/1] idr: do not create idr if new id would be outside given range
From: Matthew Wilcox
Date: Fri Nov 28 2025 - 12:50:45 EST
On Fri, Nov 28, 2025 at 04:47:17PM +0000, Sokolowski, Jan wrote:
> > No. You didn't co-develop anything. You reported the bug, badly.
> >
> And I've sent a potential patch on how it should've been fixed. That should count for something, right?
Literally everything about that patch was wrong. If I'd used any of it,
you'd have a point, but the entire approach was wrong.
You _can't_allow the allocation to succeed and then undo it. There might
be an RCU-protected reader which would see the intermediate state.
And that's an inconsistency we guarantee can't happen; an RCU reader
can see the state before the lock, the state after the lock. It must
not see a state that never happened.
If you'd written a test case, I'd happily add a co-developed-by tag.
But you didn't do that either.