[RHEL7,COMMIT] ploop: Do not warn when BAT is wider than disk size

Submitted by Konstantin Khorenko on June 14, 2019, 4:08 p.m.

Details

Message ID 201906141608.x5EG8hZF009206@finist-ce7.sw.ru
State New
Series "ploop: Do not warn when BAT is wider than disk size"
Headers show

Commit Message

Konstantin Khorenko June 14, 2019, 4:08 p.m.
The commit is pushed to "branch-rh7-3.10.0-957.12.2.vz7.96.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.2.vz7.96.15
------>
commit 68adc3cf3897fbb488cc960c2c71db9eedd7bd53
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Jun 14 19:08:43 2019 +0300

    ploop: Do not warn when BAT is wider than disk size
    
    BAT area can address wider region, than disk size.
    This may be a result of shrinking large disk
    to a small size, when we just change disk size,
    but the first data block offset and nr bat entries
    remain the same.
    
    https://jira.sw.ru/browse/PSBM-95293
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c | 8 +++++++-
 1 file changed, 7 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 1e2e8f1cc3d1..0d4c587f46b4 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -164,7 +164,13 @@  static int populate_holes_bitmap(struct ploop_delta *delta,
 	block = 0;
 	while (block < nr_blocks) {
 		if (!ploop1_map_index(delta, block, &sec)) {
-			WARN_ONCE(1, "Can't map block\n");
+			/*
+			 * BAT area can address wider region, than disk size.
+			 * This may be a result of shrinking large disk
+			 * to a small size.
+			 */
+			pr_info("ploop%u: bat is bigger than disk size\n",
+				delta->plo->index);
 			goto put_page;
 		}
 		ret = delta->io.ops->sync_read(&delta->io, page,