[Devel] [PATCH RHEL7 COMMIT] ploop: Clear PLOOP_S_NO_FALLOC_DISCARD on restart

Vasily Averin vvs at virtuozzo.com
Fri Aug 28 07:37:54 MSK 2020


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 at 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 at virtuozzo.com>
---
 drivers/block/ploop/dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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)


More information about the Devel mailing list