diff options
author | NeilBrown <neilb@suse.de> | 2007-10-22 23:45:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 11:32:06 -0400 |
commit | 85bfb4da8cad483a4e550ec89060d05a4daf895b (patch) | |
tree | 8cbdfb71e4000a6b3f1ac23d95fcc6caa7085443 /drivers/md | |
parent | 0895e91d60ef9bdef426d1ce14bb94bd5875870d (diff) |
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/bitmap.c | 2 |
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) | |||
274 | if (bitmap->offset < 0) { | 274 | if (bitmap->offset < 0) { |
275 | /* DATA BITMAP METADATA */ | 275 | /* DATA BITMAP METADATA */ |
276 | if (bitmap->offset | 276 | if (bitmap->offset |
277 | + page->index * (PAGE_SIZE/512) | 277 | + (long)(page->index * (PAGE_SIZE/512)) |
278 | + size/512 > 0) | 278 | + size/512 > 0) |
279 | /* bitmap runs in to metadata */ | 279 | /* bitmap runs in to metadata */ |
280 | return -EINVAL; | 280 | return -EINVAL; |