summaryrefslogtreecommitdiff
path: root/drivers/genpd/imx/imx8mp-blk-ctrl.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-10-24 23:39:06 +0300
committerJens Axboe <axboe@kernel.dk>2023-10-25 17:02:29 +0300
commit838b35bb6a89c36da07ca39520ec071d9250334d (patch)
tree598273089e020a7108b9957be3d277d96f09df0a /drivers/genpd/imx/imx8mp-blk-ctrl.c
parent7644b1a1c9a7ae8ab99175989bfc8676055edb46 (diff)
downloadlinux-838b35bb6a89c36da07ca39520ec071d9250334d.tar.xz
io_uring/rw: disable IOCB_DIO_CALLER_COMP
If an application does O_DIRECT writes with io_uring and the file system supports IOCB_DIO_CALLER_COMP, then completions of the dio write side is done from the task_work that will post the completion event for said write as well. Whenever a dio write is done against a file, the inode i_dio_count is elevated. This enables other callers to use inode_dio_wait() to wait for previous writes to complete. If we defer the full dio completion to task_work, we are dependent on that task_work being run before the inode i_dio_count can be decremented. If the same task that issues io_uring dio writes with IOCB_DIO_CALLER_COMP performs a synchronous system call that calls inode_dio_wait(), then we can deadlock as we're blocked sleeping on the event to become true, but not processing the completions that will result in the inode i_dio_count being decremented. Until we can guarantee that this is the case, then disable the deferred caller completions. Fixes: 099ada2c8726 ("io_uring/rw: add write support for IOCB_DIO_CALLER_COMP") Reported-by: Andres Freund <andres@anarazel.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/genpd/imx/imx8mp-blk-ctrl.c')
0 files changed, 0 insertions, 0 deletions