Skip to contentSkip to conversation

io_uring: do not use prio task_work_add in uring_cmd

PATCH Applied Dylan Yudaken 3 participants 3 messages Jun 16, 2022

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

PATCH 1/1 io_uring: do not use prio task_work_add in uring_cmd

io_req_task_prio_work_add has a strict assumption that it will only be used with io_req_task_complete. There is a codepath that assumes this is the case and will not even call the completion function if it is hit.

For uring_cmd with an arbitrary completion function change the call to the correct non-priority version.

Fixes ee692a21e9bf8 ("fs,io_uring: add infrastructure for uring-cmd")
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index 3aab4182fd89..a7ac2d3bce76 100644
@@ -5079,7 +5079,7 @@ void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd,
 
 	req->uring_cmd.task_work_cb = task_work_cb;
 	req->io_task_work.func = io_uring_cmd_work;
-	io_req_task_prio_work_add(req);
+	io_req_task_work_add(req);
 }
 EXPORT_SYMBOL_GPL(io_uring_cmd_complete_in_task);
 

base-commit: b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3

Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dylan Yudaken

io_req_task_prio_work_add has a strict assumption that it will only be used with io_req_task_complete. There is a codepath that assumes this is the case and will not even call the completion function if it is hit.

For uring_cmd with an arbitrary completion function change the call to the correct non-priority version.

Quoted 21 lines
Fixes ee692a21e9bf8 ("fs,io_uring: add infrastructure for uring-cmd")
---
  fs/io_uring.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index 3aab4182fd89..a7ac2d3bce76 100644
@@ -5079,7 +5079,7 @@ void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd,
 
  	req->uring_cmd.task_work_cb = task_work_cb;
  	req->io_task_work.func = io_uring_cmd_work;
-	io_req_task_prio_work_add(req);
+	io_req_task_work_add(req);
  }
  EXPORT_SYMBOL_GPL(io_uring_cmd_complete_in_task);
 

base-commit: b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3

Signature · 1 line
Pavel Begunkov
maintainer Applied
#2 lore raw
In reply to Dylan Yudaken
Quoted 8 lines · Dylan Yudaken

io_req_task_prio_work_add has a strict assumption that it will only be used with io_req_task_complete. There is a codepath that assumes this is the case and will not even call the completion function if it is hit.

For uring_cmd with an arbitrary completion function change the call to the correct non-priority version.

[...]

Applied, thanks!

[1/1] io_uring: do not use prio task_work_add in uring_cmd

      commit: 32fc810b364f3dd30930c594e461ffa1761fef39

Best regards,

Signature · 1 line
Jens Axboe