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

Submitted by Kirill Tkhai on June 13, 2019, 10:58 a.m.

Details

Message ID 156042349248.4585.9472305830598689653.stgit@localhost.localdomain
State New
Series "ploop: Do not warn when BAT is wider than disk size"
Headers show

Commit Message

Kirill Tkhai June 13, 2019, 10:58 a.m.
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 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,