Commit 6f11adc
committed
io_uring: gate REQ_F_ISREG on !S_ANON_INODE as well
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 <[email protected]>
Cc: [email protected]
Link: ghostty-org/ghostty#7720
Fixes: cfd86ef ("anon_inode: use a proper mode internally")
Signed-off-by: Jens Axboe <[email protected]>1 parent 178b8ff commit 6f11adc
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| 1669 | + | |
1669 | 1670 | | |
1670 | 1671 | | |
1671 | 1672 | | |
1672 | 1673 | | |
1673 | | - | |
| 1674 | + | |
1674 | 1675 | | |
1675 | 1676 | | |
1676 | 1677 | | |
| |||
0 commit comments