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
BugLink: http://bugs.launchpad.net/bugs/1509886

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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Brad Figg <[email protected]>
  • Loading branch information
NeilBrown authored and Luis Henriques committed Nov 10, 2015
1 parent 1068902 commit ef29cf1
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 @@ -1997,7 +1997,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 ef29cf1

Please sign in to comment.