[Devel] [PATCH VZ9 4/4] dm-ploop: dont preallocate clusters for read only table

Vasileios Almpanis vasileios.almpanis at virtuozzo.com
Thu Jan 29 14:15: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 34fa0665935d..10eb0b4e670b 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -634,7 +634,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