[RH7,6/6] ploop: Disable discard on ploop1 v1 after snapshot

Submitted by Kirill Tkhai on Sept. 3, 2020, 2:13 p.m.

Details

Message ID 159914242226.142757.3350438899317789228.stgit@localhost.localdomain
State New
Series "ploop: Rework queue_settings autoconfig and allow fuse 4K discard"
Headers show

Commit Message

Kirill Tkhai Sept. 3, 2020, 2:13 p.m.
1)Base delta is RAW
2)Comming snapshot is ploop1 v1, which may contain unaligned clusters.

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

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 8a0f0a8fe3f7..113394d4ae8f 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -3773,6 +3773,9 @@  static int ploop_snapshot(struct ploop_device * plo, unsigned long arg,
 	if (err)
 		goto out_close2;
 
+	if (!may_allow_falloc_discard(plo))
+		set_bit(PLOOP_S_NO_FALLOC_DISCARD, &plo->state);
+
 	enable_discard(plo);
 	return 0;