[RHEL7,COMMIT] ploop: Disable discard on ploop1 v1 after snapshot

Submitted by Vasily Averin on Sept. 4, 2020, 7:31 a.m.

Details

Message ID 202009040731.0847VLev025127@vz7build.vvs.sw.ru
State New
Series "ploop: Rework queue_settings autoconfig and allow fuse 4K discard"
Headers show

Commit Message

Vasily Averin Sept. 4, 2020, 7:31 a.m.
The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.18.2.vz7.163.16
------>
commit de57566e992d5de7c8d82f00acf3183b06889511
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Sep 4 10:31:21 2020 +0300

    ploop: Disable discard on ploop1 v1 after snapshot
    
    1)Base delta is RAW
    2)Comming snapshot is ploop1 v1, which may contain unaligned clusters.
    
    https://jira.sw.ru/browse/PSBM-107598
    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 8a0f0a8..113394d 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;