[Devel] [PATCH RH7 1/5] ploop: Clear PLOOP_S_NO_FALLOC_DISCARD on restart
Kirill Tkhai
ktkhai at virtuozzo.com
Thu Aug 27 18:40:53 MSK 2020
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.
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 197faa5db05d..64127fa10c45 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