提交 85bfb4da 编写于 作者: N NeilBrown 提交者: Linus Torvalds

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: NNeil Brown <neilb@suse.de>
Cc: Stable <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0895e91d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册