[Devel] [PATCH RH8 42/61] ploop: Fixup flush

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 14 18:58:23 MSK 2021


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

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 289114511246..5a5ce5183d8b 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1622,16 +1622,22 @@ void do_ploop_fsync_work(struct work_struct *ws)
 {
 	struct ploop *ploop = container_of(ws, struct ploop, fsync_worker);
 	LIST_HEAD(flush_pios);
+	struct file *file;
 	struct pio *pio;
+	int ret;
 
 	spin_lock_irq(&ploop->deferred_lock);
 	list_splice_init(&ploop->flush_pios, &flush_pios);
 	spin_unlock_irq(&ploop->deferred_lock);
 
-	/* FIXME: issue flush */
+	file = top_delta(ploop)->file;
+	ret = vfs_fsync(file, 0);
 
-	while ((pio = pio_list_pop(&flush_pios)) != NULL)
+	while ((pio = pio_list_pop(&flush_pios)) != NULL) {
+		if (unlikely(ret))
+			pio->bi_status = errno_to_blk_status(ret);
 		pio_endio(pio);
+	}
 }
 
 /*




More information about the Devel mailing list