The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will 
appear at [email protected]:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.16.vz10
------>
commit 1b9c1700dfb020919024c99913f72267b1f77207
Author: Pavel Tikhomirov <[email protected]>
Date:   Mon Nov 10 15:32:33 2025 +0800

    md: mark dm-ploop and dm-qcow2 targets non-fua
    
    This effectively makes dm layer handle REQ_FUA by itself, by sending
    explicit sync instead of relying that dm-ploop and dm-qcow2 will do
    that. We already had REQ_FUA support in dm-ploop but it looks more
    robust to unload this to general dm code.
    
    We don't really have an existing way to force device mapper to switch to
    non-fua mode, so let's add queue_limits->fua field to configure that.
    
    Note: on vz10 there is a memset 0 in blk_set_stacking_limits, so we
    don't need to initialize fua explicitly (as BLK_FUA == 0).
    
    https://virtuozzo.atlassian.net/browse/VSTOR-118628
    Signed-off-by: Pavel Tikhomirov <[email protected]>
    
    Feature: dm-ploop: ploop target driver
    Feature: dm-qcow2: block device over QCOW2 files driver
---
 block/blk-settings.c         | 3 +++
 drivers/md/dm-ploop-target.c | 2 ++
 drivers/md/dm-qcow2-target.c | 2 ++
 drivers/md/dm-table.c        | 3 ++-
 include/linux/blkdev.h       | 6 ++++++
 5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index a446654ddee5e..e85367e9b20df 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -505,6 +505,9 @@ int blk_stack_limits(struct queue_limits *t, struct 
queue_limits *b,
 {
        unsigned int top, bottom, alignment, ret = 0;
 
+       if (b->fua == BLK_NO_FUA)
+               t->fua = BLK_NO_FUA;
+
        t->features |= (b->features & BLK_FEAT_INHERIT_MASK);
 
        /*
diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index d95efea1e5356..5853e7e9120ec 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -661,6 +661,8 @@ static void ploop_io_hints(struct dm_target *ti, struct 
queue_limits *limits)
        limits->max_hw_discard_sectors = CLU_TO_SEC(ploop, 1);
        limits->discard_granularity = CLU_SIZE(ploop);
        limits->discard_alignment = 0;
+
+       limits->fua = BLK_NO_FUA;
 }
 
 static void ploop_status(struct dm_target *ti, status_type_t type,
diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c
index 90f3153159766..b17343b4be975 100644
--- a/drivers/md/dm-qcow2-target.c
+++ b/drivers/md/dm-qcow2-target.c
@@ -1054,6 +1054,8 @@ static void qcow2_io_hints(struct dm_target *ti, struct 
queue_limits *limits)
 
        limits->io_min = block_size;
        limits->io_opt = qcow2->clu_size;
+
+       limits->fua = BLK_NO_FUA;
 }
 
 static void qcow2_status(struct dm_target *ti, status_type_t type,
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 286e4f1c48dc0..e8ecef67538e0 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1836,7 +1836,8 @@ int dm_table_set_restrictions(struct dm_table *t, struct 
request_queue *q,
                limits->max_secure_erase_sectors = 0;
 
        if (dm_table_supports_flush(t))
-               limits->features |= BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA;
+               limits->features |= BLK_FEAT_WRITE_CACHE |
+                                   (limits->fua == BLK_FUA ? BLK_FEAT_FUA : 0);
 
        if (dm_table_supports_dax(t, device_not_dax_capable)) {
                limits->features |= BLK_FEAT_DAX;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 030242b56e04c..64c28dbb44b48 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -353,7 +353,13 @@ typedef unsigned int __bitwise blk_flags_t;
 /* I/O topology is misaligned */
 #define BLK_FLAG_MISALIGNED            ((__force blk_flags_t)(1u << 1))
 
+enum blk_fua {
+       BLK_FUA,
+       BLK_NO_FUA,
+};
+
 struct queue_limits {
+       enum blk_fua            fua;
        blk_features_t          features;
        blk_flags_t             flags;
        unsigned long           seg_boundary_mask;
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to