md-bitmap: don't use ->index for pages backing the bitmap file
authorChristoph Hellwig <hch@lst.de>
Thu, 15 Jun 2023 06:48:38 +0000 (08:48 +0200)
committerSong Liu <song@kernel.org>
Thu, 27 Jul 2023 07:13:29 +0000 (00:13 -0700)
commitd7038f951828da19fa9aafddfa087b69032c9687
tree850da5dbedbe91c2a283561ad7738c6383bd1a00
parentf5f2d5ac9f6e807e080311ec36bdf3d6c45b40d4
md-bitmap: don't use ->index for pages backing the bitmap file

The md driver allocates pages for storing the bitmap file data, which
are not page cache pages, and then stores the page granularity file
offset in page->index, which is a field that isn't really valid except
for page cache pages.

Use a separate index for the superblock, and use the scheme used at
read size to recalculate the index for the bitmap pages instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230615064840.629492-10-hch@lst.de
drivers/md/md-bitmap.c
drivers/md/md-bitmap.h