Browse Source

md: fix bitmap-on-external-file bug.

commit a2ed9615e3222645007fc19991aedf30eed3ecfd
fixed a bug with 'internal' bitmaps, but in the process broke
'in a file' bitmaps.  So they are broken in 2.6.28

This fixes it, and needs to go in 2.6.28-stable.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
NeilBrown 16 years ago
parent
commit
538452700d
1 changed files with 5 additions and 3 deletions
  1. 5 3
      drivers/md/bitmap.c

+ 5 - 3
drivers/md/bitmap.c

@@ -964,9 +964,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
 				 */
 				 */
 				page = bitmap->sb_page;
 				page = bitmap->sb_page;
 				offset = sizeof(bitmap_super_t);
 				offset = sizeof(bitmap_super_t);
-				read_sb_page(bitmap->mddev, bitmap->offset,
-					     page,
-					     index, count);
+				if (!file)
+					read_sb_page(bitmap->mddev,
+						     bitmap->offset,
+						     page,
+						     index, count);
 			} else if (file) {
 			} else if (file) {
 				page = read_page(file, index, bitmap, count);
 				page = read_page(file, index, bitmap, count);
 				offset = 0;
 				offset = 0;