Skip to contentSkip to conversation

FAILED: Patch "io_uring/filetable: clamp alloc_hint to the configured alloc range" failed to apply to 6.1-stable tree

PATCH Sasha Levin 2 participants 7 messages Mar 1 – Mar 2

Subsystems (2)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From a6bded921ed35f21b3f6bd8e629bf488499ca442 Mon Sep 17 00:00:00 2001
From: Jens Axboe <[email protected]>
Date: Wed, 11 Feb 2026 15:12:03 -0700
Subject: [PATCH] io_uring/filetable: clamp alloc_hint to the configured alloc
range

Explicit fixed file install/remove operations on slots outside the configured alloc range can corrupt alloc_hint via io_file_bitmap_set() and io_file_bitmap_clear(), which unconditionally update alloc_hint to the bit position. This causes subsequent auto-allocations to fall outside the configured range.

For example, if the alloc range is [10, 20) and a file is removed at slot 2, alloc_hint gets set to 2. The next auto-alloc then starts searching from slot 2, potentially returning a slot below the range.

Fix this by clamping alloc_hint to [file_alloc_start, file_alloc_end) at the top of io_file_bitmap_get() before starting the search.

Fixes 6e73dffbb93c ("io_uring: let to set a range for file slot allocation")
---
 io_uring/filetable.c | 4 ++++
 1 file changed, 4 insertions(+)
io_uring/filetable.c +4 -0
index 794ef95df293c..cb1838c9fc377 100644
@@ -22,6 +22,10 @@ static int io_file_bitmap_get(struct io_ring_ctx *ctx)
 	if (!table->bitmap)
 		return -ENFILE;
 
+	if (table->alloc_hint < ctx->file_alloc_start ||
+	    table->alloc_hint >= ctx->file_alloc_end)
+		table->alloc_hint = ctx->file_alloc_start;
+
 	do {
 		ret = find_next_zero_bit(table->bitmap, nr, table->alloc_hint);
 		if (ret != nr)
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 4 lines · Sasha Levin

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

And this one also picks cleanly into 6.1-stable. Not sure what is going on at your end?

Signature · 1 line
Jens Axboe
maintainer
#2 lore raw
Quoted 8 lines · Jens Axboe
Quoted 4 lines · Sasha Levin

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

And this one also picks cleanly into 6.1-stable. Not sure what is going on at your end?

Are these and the other "FAILED" false positives getting applied or not? I didn't hear anything back on any of them.

Signature · 1 line
Jens Axboe
author maintainer
#3 lore raw
Quoted 7 lines · Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 4 lines · Sasha Levin

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Quoted 5 lines
Quoted 2 lines

And this one also picks cleanly into 6.1-stable. Not sure what is going on at your end?

Are these and the other "FAILED" false positives getting applied or not? I didn't hear anything back on any of them.

Appologies for all of this. There's an explanation of what happened here:
https://lore.kernel.org/all/aaWWE5uQqz_eG69i@laps/

These should be part of the -rc2 I did earlier today.

Signature · 2 lines
Thanks,
Sasha
maintainer
#4 lore raw
Quoted 11 lines · Sasha Levin
Quoted 10 lines · Jens Axboe
Quoted 8 lines · Jens Axboe
Quoted 4 lines · Sasha Levin

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

And this one also picks cleanly into 6.1-stable. Not sure what is going on at your end?

Quoted 7 lines
Quoted 2 lines

Are these and the other "FAILED" false positives getting applied or not? I didn't hear anything back on any of them.

Appologies for all of this. There's an explanation of what happened here:
https://lore.kernel.org/all/aaWWE5uQqz_eG69i@laps/

These should be part of the -rc2 I did earlier today.

Gotcha, yeah it's not easy to know when you don't hear back, either as a reply or as a new "added to stable" email. For those of us that do take stable seriously, I 100% need to know if something is landing or not.

Signature · 1 line
Jens Axboe
author maintainer
#5 lore raw
Quoted 18 lines · Jens Axboe
Quoted 17 lines · Sasha Levin
Quoted 7 lines · Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 4 lines · Sasha Levin

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Quoted 5 lines
Quoted 2 lines

And this one also picks cleanly into 6.1-stable. Not sure what is going on at your end?

Are these and the other "FAILED" false positives getting applied or not? I didn't hear anything back on any of them.

Appologies for all of this. There's an explanation of what happened here:
https://lore.kernel.org/all/aaWWE5uQqz_eG69i@laps/

Quoted 6 lines
Quoted 1 line

These should be part of the -rc2 I did earlier today.

Gotcha, yeah it's not easy to know when you don't hear back, either as a reply or as a new "added to stable" email. For those of us that do take stable seriously, I 100% need to know if something is landing or not.

You're right (and thanks for all the backports!). I had a plan to review all of these again after the release, but I should have sent something out first.

Signature · 2 lines
Thanks,
Sasha
maintainer
#6 lore raw
Quoted 21 lines · Sasha Levin
Quoted 20 lines · Jens Axboe
Quoted 18 lines · Sasha Levin
Quoted 7 lines · Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 4 lines · Sasha Levin

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Quoted 5 lines
Quoted 2 lines

And this one also picks cleanly into 6.1-stable. Not sure what is going on at your end?

Are these and the other "FAILED" false positives getting applied or not? I didn't hear anything back on any of them.

Appologies for all of this. There's an explanation of what happened here:
https://lore.kernel.org/all/aaWWE5uQqz_eG69i@laps/

These should be part of the -rc2 I did earlier today.

Quoted 8 lines
Quoted 4 lines

Gotcha, yeah it's not easy to know when you don't hear back, either as a reply or as a new "added to stable" email. For those of us that do take stable seriously, I 100% need to know if something is landing or not.

You're right (and thanks for all the backports!). I had a plan to review all of these again after the release, but I should have sent something out first.

Sounds good, it was more of a note for the future, should something like this happen again.

Signature · 1 line
Jens Axboe