Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

aoe: clean device rq_list in aoedev_downdev()

An aoe device's rq_list contains accepted block requests that are
waiting to be transmitted to the aoe target. This queue was added as
part of the conversion to blk_mq. However, the queue was not cleaned out
when an aoe device is downed which caused blk_mq_freeze_queue() to sleep
indefinitely waiting for those requests to complete, causing a hang. This
fix cleans out the queue before calling blk_mq_freeze_queue().

Link: https://bugzilla.kernel.org/show_bug.cgi?id=212665
Fixes: 3582dd291788 ("aoe: convert aoeblk to blk-mq")
Signed-off-by: Justin Sanders <jsanders.devel@gmail.com>
Link: https://lore.kernel.org/r/20250610170600.869-1-jsanders.devel@gmail.com
Tested-By: Valentin Kleibel <valentin@vrvis.at>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Justin Sanders and committed by
Jens Axboe
7f90d45e 9ce6c987

+8
+8
drivers/block/aoe/aoedev.c
··· 198 198 { 199 199 struct aoetgt *t, **tt, **te; 200 200 struct list_head *head, *pos, *nx; 201 + struct request *rq, *rqnext; 201 202 int i; 202 203 203 204 d->flags &= ~DEVFL_UP; ··· 223 222 224 223 /* clean out the in-process request (if any) */ 225 224 aoe_failip(d); 225 + 226 + /* clean out any queued block requests */ 227 + list_for_each_entry_safe(rq, rqnext, &d->rq_list, queuelist) { 228 + list_del_init(&rq->queuelist); 229 + blk_mq_start_request(rq); 230 + blk_mq_end_request(rq, BLK_STS_IOERR); 231 + } 226 232 227 233 /* fast fail all pending I/O */ 228 234 if (d->blkq) {