[Devel] [RFC PATCH vz9 v6 56/62] dm-ploop: support REQ_FUA for data pios
Alexander Atanasov
alexander.atanasov at virtuozzo.com
Fri Dec 6 00:56:29 MSK 2024
If we see a bio with REQ_FUA set we need to request a sync.
https://virtuozzo.atlassian.net/browse/VSTOR-91816
Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
drivers/md/dm-ploop-map.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index c47fa48f1da6..970f0dc52307 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -223,6 +223,14 @@ static void ploop_do_pio_endio(struct pio *pio)
if (!atomic_dec_and_test(&pio->remaining))
return;
+ /* REQ_FUA requires us to flush all before pio is completed */
+ if (pio->bi_op & REQ_FUA) {
+ struct file *file;
+
+ file = ploop_top_delta(pio->ploop)->file;
+ vfs_fsync(file, 1);
+ }
+
endio_cb(pio, endio_cb_data, pio->bi_status);
if (free_on_endio)
--
2.43.0
More information about the Devel
mailing list