Commit 938b533d authored by Shaohua Li's avatar Shaohua Li

md/bitmap: revert a patch

This reverts commit 8031c3dd. That patches doesn't work well if PAGE_SIZE >
4k. We will fix the original problem with a different approach.

Fix: 8031c3dd(md/bitmap: copy correct data for bitmap super)
Reported-by: default avatarJoshua Kinard <kumba@gentoo.org>
Cc: stable@vger.kernel.org (4.10+)
Suggested-by: default avatarNeil Brown <neilb@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent d1d90147
...@@ -625,7 +625,7 @@ static int bitmap_read_sb(struct bitmap *bitmap) ...@@ -625,7 +625,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
err = read_sb_page(bitmap->mddev, err = read_sb_page(bitmap->mddev,
offset, offset,
sb_page, sb_page,
0, PAGE_SIZE); 0, sizeof(bitmap_super_t));
} }
if (err) if (err)
return err; return err;
...@@ -2123,7 +2123,7 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks, ...@@ -2123,7 +2123,7 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
if (store.sb_page && bitmap->storage.sb_page) if (store.sb_page && bitmap->storage.sb_page)
memcpy(page_address(store.sb_page), memcpy(page_address(store.sb_page),
page_address(bitmap->storage.sb_page), page_address(bitmap->storage.sb_page),
PAGE_SIZE); sizeof(bitmap_super_t));
bitmap_file_unmap(&bitmap->storage); bitmap_file_unmap(&bitmap->storage);
bitmap->storage = store; bitmap->storage = store;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment