Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2583
b: refs/heads/master
c: bc7f77d
h: refs/heads/master
i:
  2581: 48b4fdd
  2579: 81c520b
  2575: 3db3459
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 22, 2005
1 parent 2706a90 commit 11e0271
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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: d80a138c013f81c1b9383c83983934e34e380a2d
refs/heads/master: bc7f77de2cd81718dd789a2cfe68a7cf1b48f016
16 changes: 8 additions & 8 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,26 +781,26 @@ static int bitmap_init_from_disk(struct bitmap *bitmap)
"recovery\n", bmname(bitmap));

bytes = (chunks + 7) / 8;
num_pages = (bytes + PAGE_SIZE - 1) / PAGE_SIZE;

num_pages = (bytes + sizeof(bitmap_super_t) + PAGE_SIZE - 1) / PAGE_SIZE + 1;

if (i_size_read(file->f_mapping->host) < bytes + sizeof(bitmap_super_t)) {
printk(KERN_INFO "%s: bitmap file too short %lu < %lu\n",
bmname(bitmap),
(unsigned long) i_size_read(file->f_mapping->host),
bytes + sizeof(bitmap_super_t));
goto out;
}
num_pages++;

ret = -ENOMEM;

bitmap->filemap = kmalloc(sizeof(struct page *) * num_pages, GFP_KERNEL);
if (!bitmap->filemap) {
ret = -ENOMEM;
if (!bitmap->filemap)
goto out;
}

bitmap->filemap_attr = kmalloc(sizeof(long) * num_pages, GFP_KERNEL);
if (!bitmap->filemap_attr) {
ret = -ENOMEM;
if (!bitmap->filemap_attr)
goto out;
}

memset(bitmap->filemap_attr, 0, sizeof(long) * num_pages);

Expand Down

0 comments on commit 11e0271

Please sign in to comment.