[Devel] [PATCH RHEL8 COMMIT] ploop: Resume queue after failed suspend
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jul 15 16:30:40 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.55
------>
commit 86f41859985a0f3084e3dd978f6c923958199c4b
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Thu Jul 15 16:30:40 2021 +0300
ploop: Resume queue after failed suspend
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