]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/bitmap.c
md: fix bitmap-on-external-file bug.
[linux-2.6-omap-h63xx.git] / drivers / md / bitmap.c
index ab7c8e4a61f943c516ae5a3534e8775c33180f6b..666b7ba47ec533badd6c2f2b1e7627f6b5eb24fe 100644 (file)
@@ -964,9 +964,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
                                 */
                                page = bitmap->sb_page;
                                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) {
                                page = read_page(file, index, bitmap, count);
                                offset = 0;