Skip to content

Commit

Permalink
fuse: {uring} Handle IO_URING_F_TASK_DEAD
Browse files Browse the repository at this point in the history
The ring task is terminating, it not safe to still access
its resources. Also no need for further actions.

Signed-off-by: Bernd Schubert <[email protected]>
  • Loading branch information
bsbernd committed Sep 1, 2024
1 parent bed58a6 commit 332f051
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/fuse/dev_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,9 @@ fuse_uring_send_req_in_task(struct io_uring_cmd *cmd,

BUILD_BUG_ON(sizeof(pdu) > sizeof(cmd->pdu));

if (unlikely(issue_flags & IO_URING_F_TASK_DEAD))
goto terminating;

err = fuse_uring_prepare_send(ring_ent);
if (err)
goto err;
Expand All @@ -1007,6 +1010,10 @@ fuse_uring_send_req_in_task(struct io_uring_cmd *cmd,
return;
err:
fuse_uring_next_fuse_req(ring_ent, queue);

terminating:
/* Avoid all actions as the task that issues the ring is terminating */
io_uring_cmd_done(cmd, -ECANCELED, 0, issue_flags);
}

/* queue a fuse request and send it if a ring entry is available */
Expand Down

0 comments on commit 332f051

Please sign in to comment.