[RHEL7,COMMIT] ploop: Clear PLOOP_S_NO_FALLOC_DISCARD on restart

Submitted by Vasily Averin on Aug. 28, 2020, 4:37 a.m.

Details

Message ID 202008280437.07S4bsFu009513@vz7build.vvs.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Vasily Averin Aug. 28, 2020, 4:37 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.13
------>
commit c186d0585d7f98c0eb8153e4bfb82159c4f8a9b4
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Aug 28 07:37:54 2020 +0300

    ploop: Clear PLOOP_S_NO_FALLOC_DISCARD on restart
    
    It looks there is no a better place to do that,
    since we do not remove device after it becomes
    unused (stop+last delta is removed).
    
    This is indicator of cached ploop device was reused
    for another mount.
    
    https://jira.sw.ru/browse/PSBM-105347
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 197faa5..64127fa 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -3420,8 +3420,10 @@  static int ploop_add_delta(struct ploop_device * plo, unsigned long arg)
 	if (err)
 		goto out_destroy;
 
-	if (list_empty(&plo->map.delta_list))
+	if (list_empty(&plo->map.delta_list)) {
 		plo->fmt_version = PLOOP_FMT_UNDEFINED;
+		clear_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
+	}
 
 	err = delta->ops->open(delta);
 	if (err)