[Devel] [PATCH rh8 5/7] ploop: Care about timeout on process_notify_delta_merged()

Kirill Tkhai ktkhai at virtuozzo.com
Tue Mar 10 15:16:34 MSK 2020


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-cmd.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 8201b1a4c8b2..ad6635b1d14c 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -817,6 +817,14 @@ static void process_notify_delta_merged(struct ploop *ploop,
 	u8 level = cmd->notify_delta_merged.level;
 	struct file *file;
 	u8 *bat_levels;
+	int ret;
+
+	force_defer_bio_count_inc(ploop);
+	ret = ploop_inflight_bios_ref_switch(ploop, true);
+	if (ret) {
+		cmd->retval = ret;
+		goto out;
+	}
 
 	bat_entries = ploop->bat_entries;
 	bat_levels = ploop->bat_levels;
@@ -853,10 +861,10 @@ static void process_notify_delta_merged(struct ploop *ploop,
 	ploop->deltas[--ploop->nr_deltas].file = NULL;
 	write_unlock_irq(&ploop->bat_rwlock);
 
-	ploop_inflight_bios_ref_switch(ploop, false);
 	fput(file);
-
 	cmd->retval = 0;
+out:
+	force_defer_bio_count_dec(ploop);
 	complete(&cmd->comp); /* Last touch of cmd memory */
 }
 




More information about the Devel mailing list