Skip to contentSkip to conversation

io_uring: Fix getting file for timeout

PATCH Applied Pavel Begunkov 2 participants 9 messages Nov 13, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: Fix getting file for timeout

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

---
 fs/io_uring.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/io_uring.c +4 -0
index 6aea62f3bfff..0730c54b2153 100644
@@ -2599,6 +2599,10 @@ static bool io_op_needs_file(const struct io_uring_sqe *sqe)
 	switch (op) {
 	case IORING_OP_NOP:
 	case IORING_OP_POLL_REMOVE:
+	case IORING_OP_TIMEOUT:
+	case IORING_OP_TIMEOUT_REMOVE:
+	case IORING_OP_ASYNC_CANCEL:
+	case IORING_OP_LINK_TIMEOUT:
 		return false;
 	default:
 		return true;
Signature · 1 line
2.24.0
maintainer
#1 lore raw
Quoted 3 lines · Pavel Begunkov

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

Good catch, thanks, applied.

Signature · 1 line
Jens Axboe
maintainer
#2 lore raw
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Pavel Begunkov

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

Good catch, thanks, applied.

Care to send one asap for 5.4 as well? It'd just be TIMEOUT for that one, but we need it fixed there, too.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 11 lines · Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Pavel Begunkov

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

Good catch, thanks, applied.

Care to send one asap for 5.4 as well? It'd just be TIMEOUT for that one, but we need it fixed there, too.

Sure, I'll split this into 2 incremental patches then

Signature · 1 line
Pavel Begunkov
maintainer
#4 lore raw
Quoted 8 lines · Pavel Begunkov
Quoted 6 lines · Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Pavel Begunkov

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Good catch, thanks, applied.

Care to send one asap for 5.4 as well? It'd just be TIMEOUT for that one, but we need it fixed there, too.

Sure, I'll split this into 2 incremental patches then

Just one patch is fine, it’ll be a conflict anyway. So no point in doing two patches for 5.5.

#5 lore raw
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Pavel Begunkov
Quoted 6 lines · Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Pavel Begunkov

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Good catch, thanks, applied.

Care to send one asap for 5.4 as well? It'd just be TIMEOUT for that one, but we need it fixed there, too.

Sure, I'll split this into 2 incremental patches then

Just one patch is fine, it’ll be a conflict anyway. So no point in doing two patches for 5.5.

Ahh, didn't see the message.

I assumed you would drop the first one, and apply new 2 without a conflict. Either way, just skip whatever you don't need

Signature · 1 line
Pavel Begunkov
maintainer Applied
#6 lore raw
Quoted 15 lines · Pavel Begunkov
Quoted 14 lines · Jens Axboe
Quoted 13 lines · Pavel Begunkov
Quoted 11 lines · Jens Axboe
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Pavel Begunkov

For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

Good catch, thanks, applied.

Care to send one asap for 5.4 as well? It'd just be TIMEOUT for that one, but we need it fixed there, too.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Sure, I'll split this into 2 incremental patches then

Just one patch is fine, it’ll be a conflict anyway. So no point in doing two patches for 5.5.

Ahh, didn't see the message.

I assumed you would drop the first one, and apply new 2 without a conflict. Either way, just skip whatever you don't need

That's fine, I'm keeping the one I have for 5.5 but making sure the commit message reflects what it does, right now they both just say 'timeout' which is only correct for the 5.4 variant.

I applied the 5.4 one, thanks.

Signature · 1 line
Jens Axboe
#7 lore raw

PATCH 1/1 io_uring: Fix getting file for timeout

In reply to Pavel Begunkov

For timeout requests io_uring tries to grab a file with specified fd, which is usually stdin/fd=0.
Update io_op_needs_file()

---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)
fs/io_uring.c +1 -0
index f9a38998f2fc..9dfc6d8a2444 100644
@@ -2283,6 +2283,7 @@ static bool io_op_needs_file(const struct io_uring_sqe *sqe)
 	switch (op) {
 	case IORING_OP_NOP:
 	case IORING_OP_POLL_REMOVE:
+	case IORING_OP_TIMEOUT:
 		return false;
 	default:
 		return true;
Signature · 1 line
2.24.0
#8 lore raw

PATCH 1/1 io_uring: update io_op_needs_file

Some new commands don't need a file, so update io_op_needs_file()

---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)
fs/io_uring.c +3 -0
index 3b1aa9e21cc3..0730c54b2153 100644
@@ -2600,6 +2600,9 @@ static bool io_op_needs_file(const struct io_uring_sqe *sqe)
 	case IORING_OP_NOP:
 	case IORING_OP_POLL_REMOVE:
 	case IORING_OP_TIMEOUT:
+	case IORING_OP_TIMEOUT_REMOVE:
+	case IORING_OP_ASYNC_CANCEL:
+	case IORING_OP_LINK_TIMEOUT:
 		return false;
 	default:
 		return true;
Signature · 1 line
2.24.0