mbox series

[0/2] io_uring: fix locking in __io_run_local_work

Message ID 20221027144429.3971400-1-dylany@meta.com (mailing list archive)
Headers show
Series io_uring: fix locking in __io_run_local_work | expand

Message

Dylan Yudaken Oct. 27, 2022, 2:44 p.m. UTC
If locked was not set in __io_run_local_work, but some task work managed
to lock the context, it would leave things locked indefinitely.  Fix that
by passing the pointer in.

Patch 1 is a tiny cleanup to simplify things
Patch 2 is the fix

Dylan Yudaken (2):
  io_uring: use io_run_local_work_locked helper
  io_uring: unlock if __io_run_local_work locked inside

 io_uring/io_uring.c | 11 +++++------
 io_uring/io_uring.h | 12 ++++++++++--
 2 files changed, 15 insertions(+), 8 deletions(-)


base-commit: 247f34f7b80357943234f93f247a1ae6b6c3a740

Comments

Jens Axboe Oct. 27, 2022, 3:52 p.m. UTC | #1
On Thu, 27 Oct 2022 07:44:27 -0700, Dylan Yudaken wrote:
> If locked was not set in __io_run_local_work, but some task work managed
> to lock the context, it would leave things locked indefinitely.  Fix that
> by passing the pointer in.
> 
> Patch 1 is a tiny cleanup to simplify things
> Patch 2 is the fix
> 
> [...]

Applied, thanks!

[1/2] io_uring: use io_run_local_work_locked helper
      commit: 8de11cdc96bf58b324c59a28512eb9513fd02553
[2/2] io_uring: unlock if __io_run_local_work locked inside
      commit: b3026767e15b488860d4bbf1649d69612bab2c25

Best regards,
Jens Axboe Oct. 27, 2022, 3:57 p.m. UTC | #2
On 10/27/22 9:52 AM, Jens Axboe wrote:
> On Thu, 27 Oct 2022 07:44:27 -0700, Dylan Yudaken wrote:
>> If locked was not set in __io_run_local_work, but some task work managed
>> to lock the context, it would leave things locked indefinitely.  Fix that
>> by passing the pointer in.
>>
>> Patch 1 is a tiny cleanup to simplify things
>> Patch 2 is the fix
>>
>> [...]
> 
> Applied, thanks!
> 
> [1/2] io_uring: use io_run_local_work_locked helper
>       commit: 8de11cdc96bf58b324c59a28512eb9513fd02553
> [2/2] io_uring: unlock if __io_run_local_work locked inside
>       commit: b3026767e15b488860d4bbf1649d69612bab2c25

I made the WARN_ON() -> WARN_ON_ONCE() edit and added a small
comment as well, while applying.