Skip to content

Commit ddb4873

Browse files
Christoph Hellwigbrauner
authored andcommitted
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: 8dcc1a9 ("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>
1 parent f9f8514 commit ddb4873

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

fs/iomap/direct-io.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,18 @@ static void iomap_dio_done(struct iomap_dio *dio)
173173

174174
WRITE_ONCE(dio->submit.waiter, NULL);
175175
blk_wake_io_task(waiter);
176-
} else if (dio->flags & IOMAP_DIO_INLINE_COMP) {
176+
return;
177+
}
178+
179+
/*
180+
* Always run error completions in user context. These are not
181+
* performance critical and some code relies on taking sleeping locks
182+
* for error handling.
183+
*/
184+
if (dio->error)
185+
dio->flags &= ~IOMAP_DIO_INLINE_COMP;
186+
187+
if (dio->flags & IOMAP_DIO_INLINE_COMP) {
177188
WRITE_ONCE(iocb->private, NULL);
178189
iomap_dio_complete_work(&dio->aio.work);
179190
} else {

0 commit comments

Comments
 (0)