Skip to content

Commit

Permalink
md: fix an unsigned compare to allow creation of bitmaps with v1.0 me…
Browse files Browse the repository at this point in the history
…tadata

As page->index is unsigned, this all becomes an unsigned comparison,
which almost always returns an error.

Signed-off-by: Neil Brown <neilb@suse.de>
Cc: Stable <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Oct 23, 2007
1 parent 0895e91 commit 85bfb4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
if (bitmap->offset < 0) {
/* DATA BITMAP METADATA */
if (bitmap->offset
+ page->index * (PAGE_SIZE/512)
+ (long)(page->index * (PAGE_SIZE/512))
+ size/512 > 0)
/* bitmap runs in to metadata */
return -EINVAL;
Expand Down

0 comments on commit 85bfb4d

Please sign in to comment.