linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable-5.10] io_uring: fix clear IORING_SETUP_R_DISABLED in wrong function
@ 2021-07-15 13:18 Yang Yingliang
  2021-07-15 13:22 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Yingliang @ 2021-07-15 13:18 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: gregkh, axboe

In commit 3ebba796fa25 ("io_uring: ensure that SQPOLL thread is started for exit"),
the IORING_SETUP_R_DISABLED is cleared in io_sq_offload_start(), but when backport
it to stable-5.10, IORING_SETUP_R_DISABLED is cleared in __io_req_task_submit(),
move clearing IORING_SETUP_R_DISABLED to io_sq_offload_start() to fix this.

Fixes: 6cae8095490ca ("io_uring: ensure that SQPOLL thread is started for exit")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index fdbaaf579cc60..57db1dfc35829 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2086,7 +2086,6 @@ static void __io_req_task_submit(struct io_kiocb *req)
 		__io_req_task_cancel(req, -EFAULT);
 	mutex_unlock(&ctx->uring_lock);
 
-	ctx->flags &= ~IORING_SETUP_R_DISABLED;
 	if (ctx->flags & IORING_SETUP_SQPOLL)
 		io_sq_thread_drop_mm();
 }
@@ -7998,6 +7997,7 @@ static void io_sq_offload_start(struct io_ring_ctx *ctx)
 {
 	struct io_sq_data *sqd = ctx->sq_data;
 
+	ctx->flags &= ~IORING_SETUP_R_DISABLED;
 	if ((ctx->flags & IORING_SETUP_SQPOLL) && sqd->thread)
 		wake_up_process(sqd->thread);
 }
-- 
2.25.1


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

* Re: [PATCH stable-5.10] io_uring: fix clear IORING_SETUP_R_DISABLED in wrong function
  2021-07-15 13:18 [PATCH stable-5.10] io_uring: fix clear IORING_SETUP_R_DISABLED in wrong function Yang Yingliang
@ 2021-07-15 13:22 ` Greg KH
  2021-07-15 15:27   ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-07-15 13:22 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, stable, axboe

On Thu, Jul 15, 2021 at 09:18:25PM +0800, Yang Yingliang wrote:
> In commit 3ebba796fa25 ("io_uring: ensure that SQPOLL thread is started for exit"),
> the IORING_SETUP_R_DISABLED is cleared in io_sq_offload_start(), but when backport
> it to stable-5.10, IORING_SETUP_R_DISABLED is cleared in __io_req_task_submit(),
> move clearing IORING_SETUP_R_DISABLED to io_sq_offload_start() to fix this.
> 
> Fixes: 6cae8095490ca ("io_uring: ensure that SQPOLL thread is started for exit")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  fs/io_uring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I need an ack from Jens before I can take this...

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

* Re: [PATCH stable-5.10] io_uring: fix clear IORING_SETUP_R_DISABLED in wrong function
  2021-07-15 13:22 ` Greg KH
@ 2021-07-15 15:27   ` Jens Axboe
  2021-07-15 17:32     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-07-15 15:27 UTC (permalink / raw)
  To: Greg KH, Yang Yingliang; +Cc: linux-kernel, stable

On 7/15/21 7:22 AM, Greg KH wrote:
> On Thu, Jul 15, 2021 at 09:18:25PM +0800, Yang Yingliang wrote:
>> In commit 3ebba796fa25 ("io_uring: ensure that SQPOLL thread is started for exit"),
>> the IORING_SETUP_R_DISABLED is cleared in io_sq_offload_start(), but when backport
>> it to stable-5.10, IORING_SETUP_R_DISABLED is cleared in __io_req_task_submit(),
>> move clearing IORING_SETUP_R_DISABLED to io_sq_offload_start() to fix this.
>>
>> Fixes: 6cae8095490ca ("io_uring: ensure that SQPOLL thread is started for exit")
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>  fs/io_uring.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I need an ack from Jens before I can take this...

Ack, that looks like a bad merge. Fine to apply this patch, thanks.

-- 
Jens Axboe


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

* Re: [PATCH stable-5.10] io_uring: fix clear IORING_SETUP_R_DISABLED in wrong function
  2021-07-15 15:27   ` Jens Axboe
@ 2021-07-15 17:32     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-07-15 17:32 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Yang Yingliang, linux-kernel, stable

On Thu, Jul 15, 2021 at 09:27:53AM -0600, Jens Axboe wrote:
> On 7/15/21 7:22 AM, Greg KH wrote:
> > On Thu, Jul 15, 2021 at 09:18:25PM +0800, Yang Yingliang wrote:
> >> In commit 3ebba796fa25 ("io_uring: ensure that SQPOLL thread is started for exit"),
> >> the IORING_SETUP_R_DISABLED is cleared in io_sq_offload_start(), but when backport
> >> it to stable-5.10, IORING_SETUP_R_DISABLED is cleared in __io_req_task_submit(),
> >> move clearing IORING_SETUP_R_DISABLED to io_sq_offload_start() to fix this.
> >>
> >> Fixes: 6cae8095490ca ("io_uring: ensure that SQPOLL thread is started for exit")
> >> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> >> ---
> >>  fs/io_uring.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > I need an ack from Jens before I can take this...
> 
> Ack, that looks like a bad merge. Fine to apply this patch, thanks.

THanks, now queued up.

greg k-h

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

end of thread, other threads:[~2021-07-15 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 13:18 [PATCH stable-5.10] io_uring: fix clear IORING_SETUP_R_DISABLED in wrong function Yang Yingliang
2021-07-15 13:22 ` Greg KH
2021-07-15 15:27   ` Jens Axboe
2021-07-15 17:32     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).