]> git.baikalelectronics.ru Git - kernel.git/commit
md/bitmap: copy correct data for bitmap super
authorShaohua Li <shli@fb.com>
Thu, 17 Aug 2017 17:35:11 +0000 (10:35 -0700)
committerShaohua Li <shli@fb.com>
Thu, 24 Aug 2017 17:04:54 +0000 (10:04 -0700)
commitbe8aee5d1ca422b6afb7ff005b233a0368de6c64
treebbcde9109d222c1e224d077f121fd7e6e9940194
parent53b356ef672a495f0aac2e9457c098618fab444d
md/bitmap: copy correct data for bitmap super

raid5 cache could write bitmap superblock before bitmap superblock is
initialized. The bitmap superblock is less than 512B. The current code will
only copy the superblock to a new page and write the whole 512B, which will
zero the the data after the superblock. Unfortunately the data could include
bitmap, which we should preserve. The patch will make superblock read do 4k
chunk and we always copy the 4k data to new page, so the superblock write will
old data to disk and we don't change the bitmap.

Reported-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Song Liu <songliubraving@fb.com>
Cc: stable@vger.kernel.org (4.10+)
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/bitmap.c