Can Guo c7b34f96e4 block: pm: Fix possible unbalanced nr_pending
When someone calls blk_get_request() and blk_put_request() without invoking
blk_execute_rq() in between, nr_pending will be unbalanced. Fix this by
adding a flag, namely the RQF_PM_ADDED, to track the usage of nr_pending,
so that blk_pm_put_request() won't touch nr_pending if the flag is not set.
Extra care should be given to blk_pm_requeue_request(), because blk-flush.c
inserts flush requests into queue without calling blk_pm_add_request(), if
the flush requests get requeued by LLD, blk_pm_requeue_request() should
anyways decrease nr_pending in this situation to keep it balanced.

Change-Id: I7baa2049ac532e4fd22a0ce358133ba88266a314
Signed-off-by: Ziqi Chen <ziqichen@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2021-06-05 14:55:41 +05:30
..
2019-12-17 20:39:59 +01:00
2021-04-17 19:08:56 +05:30
2021-03-30 11:06:46 +05:30
2019-11-05 05:46:34 -08:00
2021-04-17 19:08:56 +05:30
2020-05-20 12:15:34 +02:00
2019-11-27 15:27:44 +05:30
2021-05-25 19:26:37 +05:30
2020-04-02 16:34:21 +02:00
2020-01-13 19:40:11 +00:00
2019-12-17 21:13:36 +01:00
2020-06-25 15:41:59 +02:00
2021-03-30 11:06:46 +05:30
2019-12-31 12:37:21 +01:00
2020-05-03 08:51:19 +02:00
2020-06-16 12:53:13 -07:00
2019-08-12 13:29:46 -04:00
2021-05-25 19:26:37 +05:30
2020-04-02 16:34:36 +02:00
2020-01-09 14:58:35 -08:00
2019-08-12 13:29:46 -04:00
2021-03-12 12:51:46 +05:30
2020-02-13 14:17:03 +05:30
2020-04-02 16:34:36 +02:00