aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-03-18 21:46:37 -0400
committerNeilBrown <neilb@suse.de>2012-03-18 21:46:37 -0400
commit4474ca42e2577563a919fd3ed782e2ec55bf11a2 (patch)
treedb451c8fad37b281ddbf1d00a779257537cc61ff /drivers/md/bitmap.c
parentc744a65c1e2d59acc54333ce80a5b0702a98010b (diff)
md/bitmap: ensure to load bitmap when creating via sysfs.
When commit 69e51b449d383e (md/bitmap: separate out loading a bitmap...) created bitmap_load, it missed calling it after bitmap_create when a bitmap is created through the sysfs interface. So if a bitmap is added this way, we don't allocate memory properly and can crash. This is suitable for any -stable release since 2.6.35. Cc: stable@vger.kernel.org Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index cdf36b1e9aa6..239af9a9aad1 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1904,6 +1904,8 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
1904 if (mddev->pers) { 1904 if (mddev->pers) {
1905 mddev->pers->quiesce(mddev, 1); 1905 mddev->pers->quiesce(mddev, 1);
1906 rv = bitmap_create(mddev); 1906 rv = bitmap_create(mddev);
1907 if (!rv)
1908 rv = bitmap_load(mddev);
1907 if (rv) { 1909 if (rv) {
1908 bitmap_destroy(mddev); 1910 bitmap_destroy(mddev);
1909 mddev->bitmap_info.offset = 0; 1911 mddev->bitmap_info.offset = 0;