[RHEL7,COMMIT] Revert "ploop: Add check that ploop don't grow endlessly"

Submitted by Konstantin Khorenko on Aug. 20, 2019, 10:32 a.m.

Details

Message ID 201908201032.x7KAWgjj009605@finist-ce7.sw.ru
State New
Series "Revert "ploop: Add check that ploop don't grow endlessly""
Headers show

Commit Message

Konstantin Khorenko Aug. 20, 2019, 10:32 a.m.
The commit is pushed to "branch-rh7-3.10.0-957.27.2.vz7.107.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.27.2.vz7.107.4
------>
commit e8c0d1ac3c895ceb50b2556e8a56cc1d93fe36c1
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Tue Aug 20 13:32:41 2019 +0300

    Revert "ploop: Add check that ploop don't grow endlessly"
    
    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;