[Devel] [PATCH RH8] ploop: Resume queue after failed suspend
Kirill Tkhai
ktkhai at virtuozzo.com
Thu Jul 15 15:00:09 MSK 2021
In case of we failed to switch inflight ref by timeout,
stop_submitting_pios remains to be set. Fix that.
Note, that we move function down just to have
ploop_resume_submitting_pios() visible.
https://jira.sw.ru/browse/PSBM-131852
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/md/dm-ploop-cmd.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index ed775e9bbeb4..14e7b06d88b5 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -120,16 +120,6 @@ static int ploop_inflight_bios_ref_switch(struct ploop *ploop, bool killable)
return 0;
}
-static int ploop_suspend_submitting_pios(struct ploop *ploop)
-{
- spin_lock_irq(&ploop->deferred_lock);
- WARN_ON_ONCE(ploop->stop_submitting_pios);
- ploop->stop_submitting_pios = true;
- spin_unlock_irq(&ploop->deferred_lock);
-
- return ploop_inflight_bios_ref_switch(ploop, true);
-}
-
static void ploop_resume_submitting_pios(struct ploop *ploop)
{
LIST_HEAD(list);
@@ -143,6 +133,21 @@ static void ploop_resume_submitting_pios(struct ploop *ploop)
submit_embedded_pios(ploop, &list);
}
+static int ploop_suspend_submitting_pios(struct ploop *ploop)
+{
+ int ret;
+
+ spin_lock_irq(&ploop->deferred_lock);
+ WARN_ON_ONCE(ploop->stop_submitting_pios);
+ ploop->stop_submitting_pios = true;
+ spin_unlock_irq(&ploop->deferred_lock);
+
+ ret = ploop_inflight_bios_ref_switch(ploop, true);
+ if (ret)
+ ploop_resume_submitting_pios(ploop);
+ return ret;
+}
+
/* Find existing BAT clu pointing to dst_clu */
static u32 ploop_find_bat_entry(struct ploop *ploop, u32 dst_clu, bool *is_locked)
{
More information about the Devel
mailing list