public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: Fix getting file for timeout
@ 2019-11-13 21:11 Pavel Begunkov
  2019-11-13 21:33 ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Begunkov @ 2019-11-13 21:11 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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()

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 6aea62f3bfff..0730c54b2153 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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;
-- 
2.24.0


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

* Re: [PATCH] io_uring: Fix getting file for timeout
  2019-11-13 21:11 [PATCH] io_uring: Fix getting file for timeout Pavel Begunkov
@ 2019-11-13 21:33 ` Jens Axboe
  2019-11-13 21:37   ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2019-11-13 21:33 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 11/13/19 2:11 PM, Pavel Begunkov wrote:
> 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.

-- 
Jens Axboe


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

* Re: [PATCH] io_uring: Fix getting file for timeout
  2019-11-13 21:33 ` Jens Axboe
@ 2019-11-13 21:37   ` Jens Axboe
  2019-11-13 21:47     ` Pavel Begunkov
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2019-11-13 21:37 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 11/13/19 2:33 PM, Jens Axboe wrote:
> On 11/13/19 2:11 PM, Pavel Begunkov wrote:
>> 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.

-- 
Jens Axboe


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

* Re: [PATCH] io_uring: Fix getting file for timeout
  2019-11-13 21:37   ` Jens Axboe
@ 2019-11-13 21:47     ` Pavel Begunkov
  2019-11-13 21:54       ` Jens Axboe
  2019-11-13 21:59       ` [PATCH for-linus] " Pavel Begunkov
  0 siblings, 2 replies; 9+ messages in thread
From: Pavel Begunkov @ 2019-11-13 21:47 UTC (permalink / raw)
  To: Jens Axboe, io-uring


[-- Attachment #1.1: Type: text/plain, Size: 527 bytes --]

On 14/11/2019 00:37, Jens Axboe wrote:
> On 11/13/19 2:33 PM, Jens Axboe wrote:
>> On 11/13/19 2:11 PM, Pavel Begunkov wrote:
>>> 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

-- 
Pavel Begunkov


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] io_uring: Fix getting file for timeout
  2019-11-13 21:47     ` Pavel Begunkov
@ 2019-11-13 21:54       ` Jens Axboe
  2019-11-13 22:05         ` Pavel Begunkov
  2019-11-13 21:59       ` [PATCH for-linus] " Pavel Begunkov
  1 sibling, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2019-11-13 21:54 UTC (permalink / raw)
  To: Pavel Begunkov; +Cc: io-uring

On Nov 13, 2019, at 2:48 PM, Pavel Begunkov <[email protected]> wrote:
> 
> On 14/11/2019 00:37, Jens Axboe wrote:
>>> On 11/13/19 2:33 PM, Jens Axboe wrote:
>>> On 11/13/19 2:11 PM, Pavel Begunkov wrote:
>>>> 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

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


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

* [PATCH for-linus] io_uring: Fix getting file for timeout
  2019-11-13 21:47     ` Pavel Begunkov
  2019-11-13 21:54       ` Jens Axboe
@ 2019-11-13 21:59       ` Pavel Begunkov
  2019-11-13 21:59         ` [PATCH for-5.5] io_uring: update io_op_needs_file Pavel Begunkov
  1 sibling, 1 reply; 9+ messages in thread
From: Pavel Begunkov @ 2019-11-13 21:59 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index f9a38998f2fc..9dfc6d8a2444 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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;
-- 
2.24.0


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

* [PATCH for-5.5] io_uring: update io_op_needs_file
  2019-11-13 21:59       ` [PATCH for-linus] " Pavel Begunkov
@ 2019-11-13 21:59         ` Pavel Begunkov
  0 siblings, 0 replies; 9+ messages in thread
From: Pavel Begunkov @ 2019-11-13 21:59 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3b1aa9e21cc3..0730c54b2153 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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;
-- 
2.24.0


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

* Re: [PATCH] io_uring: Fix getting file for timeout
  2019-11-13 21:54       ` Jens Axboe
@ 2019-11-13 22:05         ` Pavel Begunkov
  2019-11-13 22:27           ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Begunkov @ 2019-11-13 22:05 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring


[-- Attachment #1.1: Type: text/plain, Size: 946 bytes --]

On 14/11/2019 00:54, Jens Axboe wrote:
> On Nov 13, 2019, at 2:48 PM, Pavel Begunkov <[email protected]> wrote:
>>
>> On 14/11/2019 00:37, Jens Axboe wrote:
>>>> On 11/13/19 2:33 PM, Jens Axboe wrote:
>>>> On 11/13/19 2:11 PM, Pavel Begunkov wrote:
>>>>> 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
> 
> 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


-- 
Pavel Begunkov


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] io_uring: Fix getting file for timeout
  2019-11-13 22:05         ` Pavel Begunkov
@ 2019-11-13 22:27           ` Jens Axboe
  0 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2019-11-13 22:27 UTC (permalink / raw)
  To: Pavel Begunkov; +Cc: io-uring

On 11/13/19 3:05 PM, Pavel Begunkov wrote:
> On 14/11/2019 00:54, Jens Axboe wrote:
>> On Nov 13, 2019, at 2:48 PM, Pavel Begunkov <[email protected]> wrote:
>>>
>>> On 14/11/2019 00:37, Jens Axboe wrote:
>>>>> On 11/13/19 2:33 PM, Jens Axboe wrote:
>>>>> On 11/13/19 2:11 PM, Pavel Begunkov wrote:
>>>>>> 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
>>
>> 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.

-- 
Jens Axboe


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

end of thread, other threads:[~2019-11-13 22:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13 21:11 [PATCH] io_uring: Fix getting file for timeout Pavel Begunkov
2019-11-13 21:33 ` Jens Axboe
2019-11-13 21:37   ` Jens Axboe
2019-11-13 21:47     ` Pavel Begunkov
2019-11-13 21:54       ` Jens Axboe
2019-11-13 22:05         ` Pavel Begunkov
2019-11-13 22:27           ` Jens Axboe
2019-11-13 21:59       ` [PATCH for-linus] " Pavel Begunkov
2019-11-13 21:59         ` [PATCH for-5.5] io_uring: update io_op_needs_file Pavel Begunkov

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