From: Pavel Tikhomirov <[email protected]>
https://virtuozzo.atlassian.net/browse/VSTOR-108868
Co-developed-by: Andrey Zhadchenko <[email protected]>
Signed-off-by: Pavel Tikhomirov <[email protected]>
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 b59e0d514c95f..aa3cd483f6a55 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;
--
2.43.0
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel