Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35d37c66 authored by Jens Axboe's avatar Jens Axboe
Browse files

Revert "blk-mq: Micro-optimize bt_get()"



This reverts commit 52f7eb94.

The optimization is only really safe for a single queue, otherwise
'bs' and 'bt' can indeed change, and if we don't do a finish_wait()
for each loop, we'll potentially change the wait structure and
corrupt task wait list.

Reported-by: default avatarJan Kara <jack@suse.cz>
parent 67e2c388
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -248,8 +248,8 @@ static int bt_get(struct blk_mq_alloc_data *data,
	if (!(data->gfp & __GFP_WAIT))
		return -1;

	do {
	bs = bt_wait_ptr(bt, hctx);
	do {
		prepare_to_wait(&bs->wait, &wait, TASK_UNINTERRUPTIBLE);

		tag = __bt_get(hctx, bt, last_tag);
@@ -285,6 +285,8 @@ static int bt_get(struct blk_mq_alloc_data *data,
			hctx = data->hctx;
			bt = &hctx->tags->bitmap_tags;
		}
		finish_wait(&bs->wait, &wait);
		bs = bt_wait_ptr(bt, hctx);
	} while (1);

	finish_wait(&bs->wait, &wait);