summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-10-23 05:45:11 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-23 17:32:06 +0200
commit85bfb4da8cad483a4e550ec89060d05a4daf895b (patch)
tree8cbdfb71e4000a6b3f1ac23d95fcc6caa7085443
parentprocfs: fix kernel-doc param warnings (diff)
downloadlinux-85bfb4da8cad483a4e550ec89060d05a4daf895b.tar.xz
linux-85bfb4da8cad483a4e550ec89060d05a4daf895b.zip
md: fix an unsigned compare to allow creation of bitmaps with v1.0 metadata
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>
-rw-r--r--drivers/md/bitmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 927cb34c4805..7c426d07a555 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -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;