[rh7] Revert "ploop: Add check that ploop don't grow endlessly"

Submitted by Kirill Tkhai on Aug. 19, 2019, 11:58 a.m.

Details

Message ID 156621588752.14831.4854592277373711448.stgit@localhost.localdomain
State New
Series "Revert "ploop: Add check that ploop don't grow endlessly""
Headers show

Commit Message

Kirill Tkhai Aug. 19, 2019, 11:58 a.m.
This reverts commit fb0ee1714de24c6fd167cfcd48d86005e83bc2b8.

The sanity check is wrong, since it does not account BAT-occupied
clusters. Also, it's possible to hit this check on grow after
huge shrink, when cluster at end of ploop image may be occupied.

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

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

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index 5fc2931ee324..5ca9f257be31 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -351,10 +351,8 @@  ploop1_allocate(struct ploop_delta * delta, struct ploop_request * preq,
 		struct bio_list * sbl, unsigned int size)
 {
 	struct ploop1_private * ph = delta->priv;
-	unsigned int log = delta->cluster_log;
-	struct ploop_device *plo = delta->plo;
+	unsigned int max_size;
 	cluster_t cluster = 0;
-	u64 max_size;
 	int ret;
 
 	if (delta->holes_bitmap) {
@@ -365,13 +363,7 @@  ploop1_allocate(struct ploop_delta * delta, struct ploop_request * preq,
 			cluster = 0; /* grow in process? */
 	}
 
-	max_size = delta->max_delta_size;
-	if (plo->maintenance_type == PLOOP_MNTN_GROW) {
-		/* Even in case of resize, alloc_head can't grow endlessly */
-		max_size = min(plo->grow_new_size >> 9, max_size);
-	}
-	max_size = max_size >> log;
-
+	max_size = (delta->max_delta_size >> delta->cluster_log);
 	if (!cluster && delta->io.alloc_head >= max_size) {
 		PLOOP_FAIL_REQUEST(preq, -E2BIG);
 		return;