[Devel] [PATCH rh7 37/38] ploop: force FUA of nullified blocks for BAT grow

Andrey Smetanin asmetanin at virtuozzo.com
Fri May 15 09:48:38 PDT 2015


Lately we think we does sync of nullified blocks at format
driver by image fsync before header BAT size grow update.
But we write this data directly into underlying device
bypassing EXT4 by usage of extent map tree
(see dio_submit()). So fsync of EXT4 image doesnt help us.
We need to force sync of nullified blocks. This patch does
it by marking preq via PLOOP_REQ_FORCE_FUA flag.

https://jira.sw.ru/browse/PSBM-31969

Signed-off-by: Andrey Smetanin <asmetanin at parallels.com>
Acked-by: Andrew Vagin <avagin at parallels.com>
---
 drivers/block/ploop/map.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/block/ploop/map.c b/drivers/block/ploop/map.c
index 67e2852..8ea67e9 100644
--- a/drivers/block/ploop/map.c
+++ b/drivers/block/ploop/map.c
@@ -1056,10 +1056,14 @@ static void map_wb_complete_post_process(struct ploop_map *map,
 		       0, PAGE_SIZE);
 
 	/*
-	 * FUA of this data occures at format driver ->complete_grow() by
-	 * all image sync. After that header size increased to use this
-	 * cluster as BAT cluster.
+	 * Lately we think we does sync of nullified blocks at format
+	 * driver by image fsync before header update.
+	 * But we write this data directly into underlying device
+	 * bypassing EXT4 by usage of extent map tree
+	 * (see dio_submit()). So fsync of EXT4 image doesnt help us.
+	 * We need to force sync of nullified blocks.
 	 */
+	set_bit(PLOOP_REQ_FORCE_FUA, &preq->state);
 	top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
 				  &sbl, preq->iblock, 1<<plo->cluster_log);
 }
-- 
1.9.3




More information about the Devel mailing list