No, REQ_FUA does not oblige us to make sync. REQ_FUA is translated into IOCB_DSYNC. It is IOCB layer job to datasync this exact request. Also REQ_FUA usually is coupled with REQ_PREFLUSH and we already handle that.

On 12/5/24 22:56, Alexander Atanasov wrote:
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.atana...@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)
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to