Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45842
b: refs/heads/master
c: f49d5e6
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jan 26, 2007
1 parent 0bfdbca commit fe00f6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1031be7a5fafd3a858dfaabb74d98f9ca20744a8
refs/heads/master: f49d5e62d9352d33b30c9befbaf0fd9c88265ec1
12 changes: 8 additions & 4 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,12 @@ static int bitmap_read_sb(struct bitmap *bitmap)
int err = -EINVAL;

/* page 0 is the superblock, read it... */
if (bitmap->file)
bitmap->sb_page = read_page(bitmap->file, 0, bitmap, PAGE_SIZE);
else {
if (bitmap->file) {
loff_t isize = i_size_read(bitmap->file->f_mapping->host);
int bytes = isize > PAGE_SIZE ? PAGE_SIZE : isize;

bitmap->sb_page = read_page(bitmap->file, 0, bitmap, bytes);
} else {
bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0);
}
if (IS_ERR(bitmap->sb_page)) {
Expand Down Expand Up @@ -877,7 +880,8 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
int count;
/* unmap the old page, we're done with it */
if (index == num_pages-1)
count = bytes - index * PAGE_SIZE;
count = bytes + sizeof(bitmap_super_t)
- index * PAGE_SIZE;
else
count = PAGE_SIZE;
if (index == 0) {
Expand Down

0 comments on commit fe00f6d

Please sign in to comment.