md-bitmap: refactor md_bitmap_init_from_disk
authorChristoph Hellwig <hch@lst.de>
Thu, 15 Jun 2023 06:48:35 +0000 (08:48 +0200)
committerSong Liu <song@kernel.org>
Thu, 27 Jul 2023 07:13:29 +0000 (00:13 -0700)
commit844dc6691ad5f53a624f4b07bf84037abbb8fce2
tree4c8b07c8e219d81e094f15c6d80b30a2d6578c36
parentd681054c2f67cfc45042c2de25845b06bb89c148
md-bitmap: refactor md_bitmap_init_from_disk

Split the confusing loop in md_bitmap_init_from_disk that iterates over
all chunks but also needs to read and map the pages into three separate
loops: one that iterates over the pages to read them, a second optional
one to iterate over the pages to mark them invalid if the bitmaps are
out of date, and a final one that actually iterates over the chunks.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306160552.smw0qbmb-lkp@intel.com/
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230615064840.629492-7-hch@lst.de
drivers/md/md-bitmap.c