[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#986837: aoe: kernel crash on blk_update_request: I/O error, BUG: scheduling while atomic



Hi,

I finally managed to identify the root cause of this issue and do have a patch and a more detailed description of the issue attched to the kernel bugtracker. The attached patch is applicable to stable (5.10.92) and experimental (5.17-rc4) kernels. As I did not receive any response to the original upstream report, I fear that this might be the same for the proposed patch as well.
Do you have any suggestions on what to do?
I would now follow up with a mail to the maintainers, the linux-block list and the lkml but I don't know anything more I could try.

Regards,
Valentin
Index: linux-5.10.92/drivers/block/aoe/aoedev.c
===================================================================
--- linux-5.10.92.orig/drivers/block/aoe/aoedev.c
+++ linux-5.10.92/drivers/block/aoe/aoedev.c
@@ -198,6 +198,7 @@ aoedev_downdev(struct aoedev *d)
 {
 	struct aoetgt *t, **tt, **te;
 	struct list_head *head, *pos, *nx;
+	struct request *rq;
 	int i;
 
 	d->flags &= ~DEVFL_UP;
@@ -225,11 +226,13 @@ aoedev_downdev(struct aoedev *d)
 
 	/* fast fail all pending I/O */
 	if (d->blkq) {
-		/* UP is cleared, freeze+quiesce to insure all are errored */
-		blk_mq_freeze_queue(d->blkq);
-		blk_mq_quiesce_queue(d->blkq);
-		blk_mq_unquiesce_queue(d->blkq);
-		blk_mq_unfreeze_queue(d->blkq);
+		/* UP is cleared, error all requests without sleeping */
+		while ((rq = list_first_entry_or_null(&d->rq_list, struct request,
+				queuelist))) {
+			list_del_init(&rq->queuelist);
+			blk_mq_start_request(rq);
+			aoe_end_request(d, rq, 1);
+		}
 	}
 
 	if (d->gd)

Reply to: