diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-11-13 18:06:27 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-11-25 10:22:18 +0100 |
| commit | ddb4873286e03e193c5a3bebb5fc6fa820e9ee3a (patch) | |
| tree | ae358193f591a5dca1ba8fdd9c80cc82423b64d9 | |
| parent | f9f85149994dbb9db43202ae8fabf68940c0ac0f (diff) | |
iomap: always run error completions in user context
At least zonefs expects error completions to be able to sleep. Because
error completions aren't performance critical, just defer them to workqueue
context unconditionally.
Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20251113170633.1453259-3-hch@lst.de
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
| -rw-r--r-- | fs/iomap/direct-io.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 7659db85083a..765ab6dd6637 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -173,7 +173,18 @@ static void iomap_dio_done(struct iomap_dio *dio) WRITE_ONCE(dio->submit.waiter, NULL); blk_wake_io_task(waiter); - } else if (dio->flags & IOMAP_DIO_INLINE_COMP) { + return; + } + + /* + * Always run error completions in user context. These are not + * performance critical and some code relies on taking sleeping locks + * for error handling. + */ + if (dio->error) + dio->flags &= ~IOMAP_DIO_INLINE_COMP; + + if (dio->flags & IOMAP_DIO_INLINE_COMP) { WRITE_ONCE(iocb->private, NULL); iomap_dio_complete_work(&dio->aio.work); } else { |
