[Devel] [PATCH] ploop: Enable discard support for ploop1 format backed by io_direct

Kirill Tkhai ktkhai at virtuozzo.com
Thu Mar 7 13:53:51 MSK 2019


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index c2be627b924d..1281a343bff4 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -189,7 +189,8 @@ ploop1_open(struct ploop_delta * delta)
 	    ((u64)ph->bd_size + ph->l1_off) << 9)
 		delta->flags |= PLOOP_FMT_PREALLOCATED;
 
-	set_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
+	if (delta->io.ops->id != PLOOP_IO_DIRECT)
+		set_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
 
 	return 0;
 



More information about the Devel mailing list