[RHEL7,COMMIT] ploop: Set discard limits after blk_queue_stack_limits()

Submitted by Konstantin Khorenko on March 2, 2020, 12:07 p.m.

Details

Message ID 202003021207.022C7agg007398@finist-ce7.sw.ru
State New
Series "ploop: Set discard limits after blk_queue_stack_limits()"
Headers show

Commit Message

Konstantin Khorenko March 2, 2020, 12:07 p.m.
The commit is pushed to "branch-rh7-3.10.0-1062.12.1.vz7.131.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.12.1.vz7.131.5
------>
commit 4a7da5a54634ffad206c2944afc13142124cd8b6
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Mon Mar 2 15:07:36 2020 +0300

    ploop: Set discard limits after blk_queue_stack_limits()
    
    We do not care about host block device discard_granularity
    and max_discard_sectors, because of filesystem block size
    is much less then standard ploop cluster size (1Mb). Even
    in case of underlining host block device has a huge discard
    granuality, host filesystem will be able to reuse the blocks
    we mark unused on fallocate(FALLOC_FL_PUNCH_HOLE).
    
    This came from OpenVZ bug, where host block device discard
    granuality is 2Mb, while ploop cluster size is 1Mb.
    
    https://bugs.openvz.org/browse/OVZ-7130
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/io_direct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index 1fa7bfd6a2bbf..f4bc099c05e99 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -1675,8 +1675,8 @@  static int dio_congested(struct ploop_io * io, int bits)
 
 static void dio_queue_settings(struct ploop_io * io, struct request_queue * q)
 {
-	ploop_set_discard_limits(io->plo);
 	blk_queue_stack_limits(q, bdev_get_queue(io->files.bdev));
+	ploop_set_discard_limits(io->plo);
 }
 
 static void dio_issue_flush(struct ploop_io * io, struct ploop_request *preq)