Linux kernel -stable discussions
 help / color / mirror / Atom feed
* 6.15.5 stable request, regression from 6.15.3..6.15.4
@ 2025-07-01  1:03 Jens Axboe
  2025-07-02  8:50 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2025-07-01  1:03 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman, Sasha Levin

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

Hi,

Details in the patch attached, but an unrelated vfs change broke io_uring
for anon inode reading/writing. Please queue this up asap for 6.15.5 so we
don't have have any further 6.15-stable kernels with this regression.

You can also just cherry pick it, picks cleanly. Sha is:

6f11adcc6f36ffd8f33dbdf5f5ce073368975bc3

Thanks,
-- 
Jens Axboe


[-- Attachment #2: 0001-io_uring-gate-REQ_F_ISREG-on-S_ANON_INODE-as-well.patch --]
[-- Type: text/x-patch, Size: 2081 bytes --]

From d00a0db5ea1d6c55c3fdf9c582333b3cb512cb73 Mon Sep 17 00:00:00 2001
From: Jens Axboe <axboe@kernel.dk>
Date: Sun, 29 Jun 2025 16:48:28 -0600
Subject: [PATCH] io_uring: gate REQ_F_ISREG on !S_ANON_INODE as well

Commit 6f11adcc6f36ffd8f33dbdf5f5ce073368975bc3 upstream.

io_uring marks a request as dealing with a regular file on S_ISREG. This
drives things like retries on short reads or writes, which is generally
not expected on a regular file (or bdev). Applications tend to not
expect that, so io_uring tries hard to ensure it doesn't deliver short
IO on regular files.

However, a recent commit added S_IFREG to anonymous inodes. When
io_uring is used to read from various things that are backed by anon
inodes, like eventfd, timerfd, etc, then it'll now all of a sudden wait
for more data when rather than deliver what was read or written in a
single operation. This breaks applications that issue reads on anon
inodes, if they ask for more data than a single read delivers.

Add a check for !S_ANON_INODE as well before setting REQ_F_ISREG to
prevent that.

Cc: Christian Brauner <brauner@kernel.org>
Cc: stable@vger.kernel.org
Link: https://github.com/ghostty-org/ghostty/discussions/7720
Fixes: cfd86ef7e8e7 ("anon_inode: use a proper mode internally")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 io_uring/io_uring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 74218c7b7604..211f7f5f507e 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1647,11 +1647,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
 
 io_req_flags_t io_file_get_flags(struct file *file)
 {
+	struct inode *inode = file_inode(file);
 	io_req_flags_t res = 0;
 
 	BUILD_BUG_ON(REQ_F_ISREG_BIT != REQ_F_SUPPORT_NOWAIT_BIT + 1);
 
-	if (S_ISREG(file_inode(file)->i_mode))
+	if (S_ISREG(inode->i_mode) && !(inode->i_flags & S_ANON_INODE))
 		res |= REQ_F_ISREG;
 	if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
 		res |= REQ_F_SUPPORT_NOWAIT;
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: 6.15.5 stable request, regression from 6.15.3..6.15.4
  2025-07-01  1:03 6.15.5 stable request, regression from 6.15.3..6.15.4 Jens Axboe
@ 2025-07-02  8:50 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2025-07-02  8:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: stable, Sasha Levin

On Mon, Jun 30, 2025 at 07:03:06PM -0600, Jens Axboe wrote:
> Hi,
> 
> Details in the patch attached, but an unrelated vfs change broke io_uring
> for anon inode reading/writing. Please queue this up asap for 6.15.5 so we
> don't have have any further 6.15-stable kernels with this regression.
> 
> You can also just cherry pick it, picks cleanly. Sha is:
> 
> 6f11adcc6f36ffd8f33dbdf5f5ce073368975bc3

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-02  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01  1:03 6.15.5 stable request, regression from 6.15.3..6.15.4 Jens Axboe
2025-07-02  8:50 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox