[rh7] ploop: Fallback to maintaince_mode in ploop v1 format

Submitted by Kirill Tkhai on Sept. 4, 2019, 1:58 p.m.

Details

Message ID 156760546893.28194.11005077491434752143.stgit@localhost.localdomain
State New
Series "ploop: Fallback to maintaince_mode in ploop v1 format"
Headers show

Commit Message

Kirill Tkhai Sept. 4, 2019, 1:58 p.m.
In v1 format (vz6 default) holes_bitmap is not allocated,
while holes are punched. So, further realloc increases
image size more and more (despite really allocated block
number is small). Then, we go over image limits.

This patch prohibits discard for v1 format completely.

https://jira.sw.ru/browse/PSBM-97319

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index 5fc2931ee324..fd928bd12cf7 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -153,8 +153,10 @@  static int populate_holes_bitmap(struct ploop_delta *delta,
 		return 0;
 
 	/* To do: add discard alignment for v1 */
-	if (delta->plo->fmt_version != PLOOP_FMT_V2)
+	if (delta->plo->fmt_version != PLOOP_FMT_V2) {
+		set_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
 		return 0;
+	}
 
 	ret = -ENOMEM;
 	page = alloc_page(GFP_KERNEL);