[rh7] ploop: Set discard limits after blk_queue_stack_limits()

Submitted by Kirill Tkhai on Feb. 28, 2020, 3:01 p.m.


Message ID 158290206888.613216.1863155813239332261.stgit@localhost.localdomain
State New
Series "ploop: Set discard limits after blk_queue_stack_limits()"
Headers show

Commit Message

Kirill Tkhai Feb. 28, 2020, 3:01 p.m.
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.


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 1fa7bfd6a2bb..f4bc099c05e9 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)