[Devel] [PATCH RHEL9 COMMIT] dm-ploop: make ploop_preallocate_cluster() return error on unexpected file size change
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Jul 8 14:02:06 MSK 2025
The commit is pushed to "branch-rh9-5.14.0-427.55.1.vz9.82.x-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh9-5.14.0-427.55.1.vz9.82.3
------>
commit 37be51378b4dcbe0c43ced0e069a132b4a498da9
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date: Mon Jul 7 15:07:02 2025 +0200
dm-ploop: make ploop_preallocate_cluster() return error on unexpected file size change
https://virtuozzo.atlassian.net/browse/VSTOR-108868
Co-developed-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Feature: dm-ploop: ploop target driver
---
drivers/md/dm-ploop-map.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 0ddcb3d889b31..6c057ec92ee18 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1194,12 +1194,16 @@ static int ploop_preallocate_cluster(struct ploop *ploop, struct file *file)
goto out;
}
- /* here must be the only place to change file_size */
+ /*
+ * Here must be the only place to change file_size.
+ */
spin_lock_irqsave(&ploop->bat_lock, flags);
if (top->file_size < new_len) {
top->file_size = new_len;
} else {
PL_ERR("unexpected file size change\n");
+ ret = -EIO;
+ goto out;
}
if (ploop->prealloc_size)
goto prealloc_more;
More information about the Devel
mailing list