Skip to content

Commit 7f90d45

Browse files
Justin Sandersaxboe
authored andcommitted
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: 3582dd2 ("aoe: convert aoeblk to blk-mq") Signed-off-by: Justin Sanders <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-By: Valentin Kleibel <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9ce6c98 commit 7f90d45

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/block/aoe/aoedev.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ aoedev_downdev(struct aoedev *d)
198198
{
199199
struct aoetgt *t, **tt, **te;
200200
struct list_head *head, *pos, *nx;
201+
struct request *rq, *rqnext;
201202
int i;
202203

203204
d->flags &= ~DEVFL_UP;
@@ -223,6 +224,13 @@ aoedev_downdev(struct aoedev *d)
223224
/* clean out the in-process request (if any) */
224225
aoe_failip(d);
225226

227+
/* clean out any queued block requests */
228+
list_for_each_entry_safe(rq, rqnext, &d->rq_list, queuelist) {
229+
list_del_init(&rq->queuelist);
230+
blk_mq_start_request(rq);
231+
blk_mq_end_request(rq, BLK_STS_IOERR);
232+
}
233+
226234
/* fast fail all pending I/O */
227235
if (d->blkq) {
228236
/* UP is cleared, freeze+quiesce to insure all are errored */

0 commit comments

Comments
 (0)