Skip to content

Commit

Permalink
md/bitmap: don't pass -1 to bitmap_storage_alloc.
Browse files Browse the repository at this point in the history
commit da6fb7a upstream.

Passing -1 to bitmap_storage_alloc() causes page->index to be set to
-1, which is quite problematic.

So only pass ->cluster_slot if mddev_is_clustered().

Fixes: b97e925 ("Use separate bitmaps for each nodes in the cluster")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
  • Loading branch information
NeilBrown authored and sashalevin committed Apr 29, 2016
1 parent 919f1ed commit ad491aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,8 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
ret = bitmap_storage_alloc(&store, chunks,
!bitmap->mddev->bitmap_info.external,
bitmap->cluster_slot);
mddev_is_clustered(bitmap->mddev)
? bitmap->cluster_slot : 0);
if (ret)
goto err;

Expand Down

0 comments on commit ad491aa

Please sign in to comment.