[Devel] [PATCH RHEL7 COMMIT] ploop: Replace delta under quiesce state

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 5 13:06:29 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1062.12.1.vz7.131.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.12.1.vz7.131.7
------>
commit 91e73e15d41fd564453877c7764805101265c902
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Mar 5 13:06:28 2020 +0300

    ploop: Replace delta under quiesce state
    
    This is used for vstorage to replace broken image with
    a stub. Race is possible here, so we have to disable IO
    before calling for ->replace_delta.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/dev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 3f70f674e1124..21f6197671d04 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -3409,13 +3409,15 @@ static int ploop_replace_delta(struct ploop_device * plo, unsigned long arg)
 		goto out_close;
 	}
 
+	ploop_quiesce(plo);
 	if (delta->ops->replace_delta) {
 		err = delta->ops->replace_delta(delta);
-		if (err)
+		if (err) {
+			ploop_relax(plo);
 			goto out_kobj_del;
+		}
 	}
 
-	ploop_quiesce(plo);
 	ploop_map_destroy(&plo->map);
 	list_replace_init(&old_delta->list, &delta->list);
 	clear_bit(PLOOP_S_ABORT, &plo->state);


More information about the Devel mailing list