[Devel] [PATCH rh7] ploop: Do not warn when BAT is wider than disk size

Kirill Tkhai ktkhai at virtuozzo.com
Thu Jun 13 13:58:29 MSK 2019


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 at virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index 32437175dadb..c666ac34ff77 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -163,7 +163,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,



More information about the Devel mailing list