[Devel] [PATCH VZ10 3/3] dm-ploop: dont preallocate clusters for read only table
Vasileios Almpanis
vasileios.almpanis at virtuozzo.com
Thu Jan 29 14:09:07 MSK 2026
Userspace might pass the optional argument fallo_new_clu
to the constructor even though the table is created in
read-only mode. Add a check for read-only ploop and skip
preallocation.
https://virtuozzo.atlassian.net/browse/VSTOR-123292
Signed-off-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
Feature: dm-ploop: ploop target driver
---
drivers/md/dm-ploop-target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 6ab81a56707d..553ade08b0c4 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -635,7 +635,7 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
ti->num_discard_bios = 1;
ti->discards_supported = true;
- if (ploop->nr_deltas > 0)
+ if (!ploop_is_ro(ploop) && !(ploop->nr_deltas > 0))
ploop_should_prealloc(ploop);
return 0;
--
2.43.0
More information about the Devel
mailing list