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

Skip to content
Commit b7bfceea authored by Can Guo's avatar Can Guo Committed by Pranav Vashi
Browse files

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: default avatarZiqi Chen <ziqichen@codeaurora.org>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarUtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent 245e13cc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment