blk-mq: do not reset plug->rq_count before the list is sorted
authorDongli Zhang <dongli.zhang@oracle.com>
Thu, 4 Apr 2019 02:57:44 +0000 (10:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:22:53 +0000 (07:22 +0200)
commit2c52a30e2158ef98a6ade3673e7236d2cde6e429
tree06f5e5ab23fe2d779e99545342689a06684bcd3f
parent9bc06b41fd0d7e942ae501762266934b4743d09d
blk-mq: do not reset plug->rq_count before the list is sorted

[ Upstream commit bcc816dfe51ab86ca94663c7b225f2d6eb0fddb9 ]

We would never be able to sort the list if we first reset plug->rq_count
which is used in conditional check later.

Fixes: ce5b009cff19 ("block: improve logic around when to sort a plug list")
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
block/blk-mq.c