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

Commit 9b8ec916 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull core block fix from Jens Axboe:
 "Jan reported a problem this morning with a crash in blk-mq, and after
  looking over the recent changes, it's obvious that the blk-mq-tag
  waitqueue handling change is buggy.  We could end up _not_ doing
  finish_wait() before switching to a new waitqueue, thus corrupting the
  wait task list"

* 'for-linus' of git://git.kernel.dk/linux-block:
  Revert "blk-mq: Micro-optimize bt_get()"
parents 27cb8823 35d37c66
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -248,8 +248,8 @@ static int bt_get(struct blk_mq_alloc_data *data,
	if (!(data->gfp & __GFP_WAIT))
	if (!(data->gfp & __GFP_WAIT))
		return -1;
		return -1;


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


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


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