diff options
author | NeilBrown <neilb@suse.com> | 2015-10-01 08:03:38 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-10-02 09:24:13 +0200 |
commit | da6fb7a9e5bd6f04f7e15070f630bdf1ea502841 (patch) | |
tree | cc7f1bf1d5b2e213bc3ff759d8dcf3c318907da7 /drivers/md/bitmap.c | |
parent | md/raid1: Avoid raid1 resync getting stuck (diff) | |
download | linux-da6fb7a9e5bd6f04f7e15070f630bdf1ea502841.tar.xz linux-da6fb7a9e5bd6f04f7e15070f630bdf1ea502841.zip |
md/bitmap: don't pass -1 to bitmap_storage_alloc.
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: b97e92574c0b ("Use separate bitmaps for each nodes in the cluster")
Cc: stable@vger.kernel.org (v4.1+)
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/md/bitmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index e51de52eeb94..48b5890c28e3 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -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; |