ploop: Enable discard support for ploop1 format backed by io_direct

Submitted by Kirill Tkhai on March 7, 2019, 10:53 a.m.

Details

Message ID 155195602749.27264.5981040375317540708.stgit@localhost.localdomain
State New
Series "ploop: Enable discard support for ploop1 format backed by io_direct"
Headers show

Commit Message

Kirill Tkhai March 7, 2019, 10:53 a.m.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;